What you’re building
You’re integrating Clawb as the workspace control plane for an enterprise fleet of agents. Your gateway/backend will:- register and attest agent identities at scale
- verify inbound signed agent requests
- check agent permissions immediately before execution with
POST /v1/check
allow→ proceedchallenge→ require extra proofdeny→ block
Prerequisites
You should have:- Base URL:
https://api.clawb.ai/api - Workspace API key:
ck_live_... - Agent identity material (
agent_id, keypair, attested status) - A backend service or gateway endpoint where agent requests arrive
- Stable server clock (timestamps must be milliseconds)
Fast path architecture (single inbound request)
- Agent sends a signed request to your backend.
- Your backend verifies and normalizes the agent identity (
/v1/verifyor local signature verification). - Your backend requests a permission decision (
/v1/check). - Your backend enforces
allow | challenge | deny. - Your backend logs
trace_idand decision metadata.
Step-by-step implementation
1) Register and attest agent identities
An agent is an identity with anagent_id and one or more keys.
Register and attest each agent once, then reuse the identity on every request.
For large fleets, run this as part of your agent provisioning pipeline.
See Attestation for full language-specific examples.
2) Verify inbound agent request identity
You can:- verify signatures locally (recommended for low latency), or
- call online verification via
/v1/verify.
3) Check permissions with policy
4) Enforce the decision in your service
5) Record trace and audit data
At minimum, log:agent_idpolicy_idactiondecisiontrace_id(if present)reasons/reason_codes(if present)
Failure handling and retries
- Invalid identity (
401orvalid=false): stop immediately, do not run action. - Policy
challenge/deny(403): treat as expected business control outcomes, not transport failures. - Rate/Quota (
429): retry with backoff for non-destructive flows only. - Transient server/network failures (
5xx/ timeout):- prefer fail-closed for high-risk actions,
- allow controlled retry for idempotent operations.
Production readiness checklist
- Signature verification enabled on all sensitive agent endpoints.
- Timestamp validation uses milliseconds and clock skew limits.
/v1/checkwired immediately before execution.- All three branches (
allow,challenge,deny) tested. - Decision + trace metadata logged and queryable.
- Agent registration/attestation flow automated for new agents.
- Incident runbook includes kill switch and credential revocation paths.
Common pitfalls
- If you never attest, the agent may remain pending and policies may return
challenge. - If your service doesn’t verify signatures, any caller can pretend to be an agent by guessing an
agent_id. - Timestamp seconds vs milliseconds mismatch causes verification failures.
- Path/body-hash mismatches cause signature verification failures.