Scenario and trust boundaries
Action:refund on POST /v1/refunds
Systems in path:
- Agent runtime (signs request)
- Your backend service or gateway (verifies + enforces)
- Clawb control plane (
/v1/verify,/v1/check, control-plane APIs) - External payments service
X-Clawb-Agent-IdX-Clawb-Timestamp(milliseconds)X-Clawb-NonceX-Clawb-Signature
1) Receive inbound signed request
Extract raw request fields without mutation:- method
- exact path
- raw body bytes
- signature headers
2) Verify identity
Use local verification or online/v1/verify:
3) Request policy decision
allow: continuechallenge: pause and route to approvaldeny: block
4) Optional: mint short-lived credential for bounded execution
Use this when the follow-on service call should be explicitly time/scoped.5) Execute and record audit context
At execution time, record:agent_idpolicy_iddecisiontrace_id(if present)- downstream service response status
6) Emergency mode (incident branch)
If compromise is suspected, pause minting and revoke active credentials:Unified branch pseudocode
Error matrix
| Symptom | Likely cause | Required action |
|---|---|---|
invalid signature / verify fails | method/path/body/timestamp mismatch | Recompute canonical inputs from raw request bytes and exact path. |
timestamp_out_of_range | seconds vs milliseconds or clock skew | Send ms timestamps and sync server clocks. |
policy_denied | policy explicitly blocks action | Stop execution and return safe deny response. |
policy_challenge | step-up condition matched | Trigger approval workflow and retry only after completion. |
429 / quota errors | rate/usage limits exceeded | Backoff + retry for safe/idempotent flows only. |
kill switch paused | incident control active | Do not mint new credentials until incident cleared. |
Verification checklist
- Verify uses exact path and raw body hash.
/v1/checkis called immediately before action execution.allow,challenge, anddenybranches are all tested.- Credential mint TTL/one-time behavior tested.
- Audit query returns expected events.
- Incident kill switch path tested in staging.