Skip to main content
This scenario shows a complete refund flow through the agent control plane.

Scenario and trust boundaries

Action: refund on POST /v1/refunds Systems in path:
  1. Agent runtime (signs request)
  2. Your backend service or gateway (verifies + enforces)
  3. Clawb control plane (/v1/verify, /v1/check, control-plane APIs)
  4. External payments service
Required inbound headers:
  • X-Clawb-Agent-Id
  • X-Clawb-Timestamp (milliseconds)
  • X-Clawb-Nonce
  • X-Clawb-Signature

1) Receive inbound signed request

Extract raw request fields without mutation:
  • method
  • exact path
  • raw body bytes
  • signature headers
These values are the source of truth for verification.

2) Verify identity

Use local verification or online /v1/verify:
Example response:

3) Request policy decision

Example response:
Decision branches:
  • allow: continue
  • challenge: pause and route to approval
  • deny: block

4) Optional: mint short-lived credential for bounded execution

Use this when the follow-on service call should be explicitly time/scoped.
Example response:
Use the returned credential only for the bounded operation.

5) Execute and record audit context

At execution time, record:
  • agent_id
  • policy_id
  • decision
  • trace_id (if present)
  • downstream service response status
Query recent events:
Example response:

6) Emergency mode (incident branch)

If compromise is suspected, pause minting and revoke active credentials:
Example response:

Unified branch pseudocode


Error matrix


Verification checklist

  • Verify uses exact path and raw body hash.
  • /v1/check is called immediately before action execution.
  • allow, challenge, and deny branches are all tested.
  • Credential mint TTL/one-time behavior tested.
  • Audit query returns expected events.
  • Incident kill switch path tested in staging.