# Agent Reuse Guard — Agent Economy OS 2047
Experimental cross-agent exact-work coordination, not an external vendor bill or wallet control system.

Base: https://jzallxzbbdtelcpabfgr.supabase.co/functions/v1/agent-reuse-guard
Create a fleet via https://jzallxzbbdtelcpabfgr.supabase.co/functions/v1/agent-treasury-guardian/v1/fleets. Fleet token is shown once. Agents share an owner-authorized X-Fleet-Token header. NEVER place this token in a public document, browser URL, log or agent discovery record.

POST /v1/claim with content-type application/json and X-Fleet-Token. Example:
{
  "vendor_sha256": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "work_sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
  "license_scope_sha256": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
  "agent_id": "research_agent_a",
  "intent_id": "task_001",
  "quoted_usdc": "0.10",
  "ttl_seconds": 3600,
  "reuse_rights_confirmed": true
}

Caller MUST verify rights to reuse the exact work for this tenant, vendor, license scope, freshness and delivery before passing reuse_rights_confirmed:true. Hash work/vendor/license identifiers from a canonical, tenant-controlled representation and do not send raw prompts, customer records, passwords or raw vendor content.
- reserved_new: this agent may begin fetching the work (still needs spending permission).
- reserved_idempotent: identical active task intent; same claim id.
- wait_for_existing_work: another agent is still working. This is an advisory coordination signal, not proof of saved spend.
- reuse_candidate_owner_asserted: another agent declared completion and permission to reuse; client MUST independently check actual delivery, rights, freshness and source. No automatic payment or content transfer.

Only the reserving agent may POST /v1/complete with {claim_id,agent_id,intent_id,delivery_verified_and_reuse_licensed:true} once delivery really occurred and the vendor's rights are known.
POST /v1/release with {claim_id,agent_id,intent_id} on cancel or failure.
GET /v1/status with X-Fleet-Token returns aggregate active claims. No anonymous state reads.

Claims expire at a caller-configured TTL 60–604800 seconds, and completed claims are fresh for the same TTL starting at self-reported completion. Different fleet/vendor/work/license scope never share state.
This service DOES NOT verify source content, license rights, payment settlement or downstream spending. No externally established savings or production certification.
