What X-Agent-ID + X-Instance-ID actually is
Natural splits agent identity into two layers and requires both on every paid request. It's a deceptively important pattern.
| Layer | What it is | Lifetime | Analogous to |
|---|
| Agent | The logical actor — "Alice's research agent" | Persistent (months) | A user account |
| Instance | A specific running session of that agent | Short (one task / one hour / one job) | A login session / OAuth token |
Why this split is load-bearing:
- Blast-radius containment. If a session gets prompt-injected, loops, or starts misbehaving, you revoke
inst_yyy — the agent keeps working with a fresh session. Without instance IDs, you'd have to nuke the agent (and its lifetime context, history, attached cards).
- Concurrent runs. An agent legitimately runs many instances at once — parallel sub-agents, retries, cron forks. Per-instance scoping keeps their spend, state, and audit trails separate.
- Reply-attack defense. A leaked instance ID expires; a leaked agent key would be catastrophic. Two layers = two TTLs.
- Audit precision. Every dollar traces to which agent, which session, which task. CFOs can't do their job without this.
- Maps cleanly to today's harnesses. Claude Code: agent = Claude Code installation; instance = TaskCreate sub-agent run. LangGraph: agent = graph; instance = thread. Anthropic API: agent = your app; instance = a single tool-loop.
Natural rejects requests that have X-Agent-ID but no X-Instance-ID — they make it a hard requirement. Smart. You should too.
What we're building
acard.sh — persistent, policy-bound virtual cards for agents, with org governance and multi-rail spend (Mastercard + USDC + x402 + ACH), international from day one.
Core primitives, in dependency order:
Org
├── Members (humans with roles: owner / admin / minter / viewer)
├── Funding sources (Stripe ACH, USDC deposit, Natural wallet, etc.)
└── Cards (persistent, never single-use)
├── Policy (budget cadence, vendor allowlist, MCC rules,
│ expiry, min-quality-score, child-card permission)
├── Rails (Lithic Mastercard PAN + Base USDC sub-wallet,
│ automatically maintained in sync)
├── Agents (logical actors authorized to use this card)
│ └── Instances (live runtime sessions)
│ └── Receipts (every charge traces here)
└── Child cards (sub-budgets that auto-expire with parent task)
The card is the credential. One header authenticates everywhere:
Authorization: Card ac_3kJ9...
X-Agent-ID: ag_research_q2
X-Instance-ID: inst_2026_05_10_14_32
X-Task-Tag: "branch-ship-readiness-audit"
The gateway flow on every request:
agent's curl/fetch
│
▼
acard gateway
│
├─▶ card.active? (paused? expired? balance?)
├─▶ policy.allows(merchant) (vendor allowlist, MCC rules)
├─▶ instance.authorized? (revoked? rate-limited?)
├─▶ budget.remaining ≥ price
│
▼
route by rail
├── http_402 / x402 → sign Base USDC payment from card sub-wallet
├── mpp / Solana → sign session via pay.sh wallet bound to card
├── direct merchant → swipe Lithic PAN, auth-stream gate enforces policy
└── natural party → ACH transfer from connected Natural wallet
│
▼
write receipt:
{ card, agent, instance, task, merchant, amount,
rail, latency_ms, response_hash, ts }
What this lets a human do that no other product can:
- Pause one agent instance without killing the agent or the card
- See "this Tuesday afternoon, Claude Code burned $3.42 on Apify scrapes for the SEO audit task" in plain English
- Dispute a single receipt and have settlement held automatically
- Mint a sub-card with $5 budget for a specific task, auto-expiring at task end
- Swap funding from Stripe ACH to USDC mid-month without re-issuing cards
UI sketches
1) Org dashboard (the home view a human sees)
┌──────────────────────────────────────────────────────────────────────────┐
│ acard.sh │ ClawCorp Mike R. ▾ │ ⌘K │
├──────────────────────────────────────────────────────────────────────────┤
│ ◉ Overview Cards Agents Receipts Org Settings │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ This month MTD spend Funding │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ $ 412.18 │ │ 1,847 calls │ │ 2 disputes │ │ $9,587 USD │ │
│ │ ▲ 11% MoM │ │ ▲ 9 agents │ │ $ 0.42 held │ │ $1,201 USDC │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ Active cards (4) + New card │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ ● Claude research — Q2 $34/$50 wk 8 agents exp 47d ▸ │ │
│ │ ● Apify scrapers $12/$25 wk 1 agent exp ∞ ▸ │ │
│ │ ● Anthropic API (prod) $211/$500 mo 3 agents exp 12d ▸ │ │
│ │ ◐ Replit deploy — paused $0/$10 wk 1 agent exp 3d ▸ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ Live now │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ inst_5kQz research-q2 / claude-code $0.03 in 14 calls 3m ago│ │
│ │ inst_9mPa scrape-leads / langgraph $0.21 in 47 calls 12s ago│ │
│ │ inst_1tFd support-bot / cursor $0.00 in 0 calls — │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ Recent receipts View all → │
│ May 10 14:42 IPinfo Lite $0.001 Zero rail inst_5kQz ✓ │
│ May 10 14:42 Apify scraper $0.045 Monid rail inst_9mPa ✓ │
│ May 10 14:38 OpenAI gpt-4.1 $0.012 Stripe inst_5kQz ⚠ disputed │
│ May 10 14:31 Coffee — Sightglass $4.50 Mastercard (human swipe) ✓ │
└──────────────────────────────────────────────────────────────────────────┘
2) Card detail (the workhorse view)
┌──────────────────────────────────────────────────────────────────────────┐
│ ← Cards / Claude research — Q2 Pause Edit ⋯ │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ ╔════════════════════════════════════╗ ac_3kJ9_NfQp │
│ ║ acard ║ │
│ ║ ║ Status ● Active │
│ ║ 4242 •••• •••• 3kJ9 ║ Created 2026-04-23 │
│ ║ ║ Expires 2026-08-08 (47d) │
│ ║ CLAUDE RESEARCH Q2 04/26 ║ Funding ClawCorp Stripe │
│ ║ MIKE RYABOY ••• CVV ║ Rails Mastercard, USDC │
│ ╚════════════════════════════════════╝ │
│ │
│ Policy Edit ✎ │
│ ───────────────────────────────────────────────────────────────────── │
│ Budget $50 / week ($34.18 used, $15.82 remaining) │
│ Vendors data APIs, scraping APIs, AI inference │
│ ✓ Apify ✓ Zero ✓ OpenAI ✓ Anthropic ✗ social media │
│ Min quality ★ 4.0 (Zero rail) — 3 providers excluded │
│ Child cards Allowed up to $5 / 24h, auto-expire with task │
│ │
│ Agents authorized (3) + Invite │
│ ───────────────────────────────────────────────────────────────────── │
│ ag_claude_code Mike's laptop / Claude Code live ▸ │
│ └─ inst_5kQz task: branch-audit 3m ago $0.03 / 14 calls │
│ ag_langgraph_dev us-east staging / LangGraph idle ▸ │
│ ag_cron_morning daily cron / Modal idle ▸ │
│ │
│ Receipts (last 24h, 89 calls, $4.18) ⓘ filter / export ↓ │
│ ───────────────────────────────────────────────────────────────────── │
│ 14:42:11 IPinfo Lite $0.001 USDC/Zero inst_5kQz ✓ │
│ 14:42:09 Apify google-maps $0.045 USD/Monid inst_9mPa ✓ │
│ 14:38:42 OpenAI gpt-4.1 $0.012 Mastercard inst_5kQz ⚠ │
│ 14:31:08 Anthropic claude-opus $0.087 Mastercard inst_5kQz ✓ │
│ 14:22:55 Apify scraper $0.045 USD/Monid inst_9mPa ✓ │
│ ⋮ │
└──────────────────────────────────────────────────────────────────────────┘
3) Live instance view (the "what is my agent doing right now" view)
┌──────────────────────────────────────────────────────────────────────────┐
│ ← Cards / Claude research — Q2 / inst_5kQz ⏸ Pause ⛔ Revoke ⋯ │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ Agent ag_claude_code (Mike's laptop / Claude Code v2.1) │
│ Instance inst_5kQz_2026_05_10_14_32 │
│ Task tag "branch-ship-readiness-audit" │
│ Started 14:32:08 (10m 4s ago) │
│ Spend $0.34 of $5.00 instance cap [████░░░░░░░░░░░░] 6.8% │
│ │
│ Live stream ◉ tail ▼ pause│
│ ───────────────────────────────────────────────────────────────────── │
│ 14:42:11 call → ipinfo.io/lite/8.8.8.8 $0.001 ✓ │
│ 14:42:09 call → api.apify.com/google-maps?q=… $0.045 ✓ │
│ 14:38:42 call → api.openai.com/v1/chat/completions $0.012 ✓ │
│ 14:38:41 policy ⚠ over per-call ceiling, escalating to human │
│ 14:38:40 call → api.openai.com/v1/chat/completions — gated │
│ 14:31:08 call → api.anthropic.com/v1/messages $0.087 ✓ │
│ 14:22:55 call → api.apify.com/scraper $0.045 ✓ │
│ 14:32:08 start inst_5kQz │
│ │
│ Quick actions │
│ ┌────────────────────┐ ┌────────────────────┐ ┌────────────────────┐ │
│ │ Approve gated │ │ Mint child card │ │ Dispute last call │ │
│ │ (1 pending) │ │ for sub-task │ │ rcpt_b2aF… │ │
│ └────────────────────┘ └────────────────────┘ └────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
4) Mint-card form (the human entry point)
┌──────────────────────────────────────────────────────────────────────────┐
│ ← Cards / + New card │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ Name ┌──────────────────────────────────────────────┐ │
│ │ Claude research — Q2 │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ Funding ◉ ClawCorp / Stripe ACH ($9,587 available) │
│ ○ ClawCorp / USDC (Base) ($1,201 available) │
│ ○ Natural wallet (connect) │
│ ○ + Add new source │
│ │
│ Budget $ ┌──────┐ per ┌──────────┐ Hard cap $┌──────┐ │
│ │ 50 │ │ week ▾ │ │ 500 │ │
│ └──────┘ └──────────┘ └──────┘ │
│ │
│ Expiry ◉ 90 days ○ 30 days ○ Never ○ Custom │
│ │
│ Vendor allowlist ✓ Data APIs ✓ Scraping APIs ✓ AI inference │
│ ✗ Social media ✗ Crypto trading ✗ Cloud compute │
│ + Add specific merchant │
│ │
│ Min quality ★ ┌────────────┐ (Zero rail providers below this │
│ │ 4.0 ▾│ are auto-excluded from routing) │
│ └────────────┘ │
│ │
│ Rails ✓ Mastercard (Lithic) │
│ ✓ USDC / x402 (Base) │
│ ☐ MPP / Solana (via pay.sh) │
│ ☐ Natural ACH │
│ │
│ Child cards ◉ Allow, capped at $5 / 24h, auto-expire with task │
│ ○ Disallow │
│ │
│ Authorize ┌──────────────────────────────────────────────┐ │
│ agents │ ag_claude_code (Mike's laptop) ✓ │ │
│ │ ag_langgraph_dev (us-east staging) ✓ │ │
│ │ + Add agent │ │
│ └──────────────────────────────────────────────┘ │
│ │
│ Approval rule Charges over $┌──────┐ require human approval │
│ │ 0.50 │ via Slack notification │
│ └──────┘ │
│ │
│ ┌─────────┐ ┌──────────────┐ │
│ │ Cancel │ │ Mint card → │ │
│ └─────────┘ └──────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
Why these views together prove the thesis
- The org dashboard answers a CFO/founder's question: what did my agents spend this month, on what, where's the risk?
- The card detail is the day-to-day operator surface: policy + agents + receipts in one place.
- The live instance view is the killer demo: I can see my agent calling APIs in real time, with cost, and pause it mid-flight. No competitor has this.
- The mint form shows the policy DSL in human form — every field maps 1:1 to a column in the card record.
Notice what's not there: no wallet addresses, no chain selectors, no PAN exposure beyond the visual card, no "x402 vs MPP" jargon. The human sees a normal card; the agent sees a normal API. The complexity lives in the routing engine.
Want me to spec the gateway's auth-and-policy state machine in code, or the receipt schema next? Either is the thing you'll regret not pinning down before you start writing the API.