Replace shared staging with isolated, reproducible sandboxes for every consumer
— human or AI agent. Spec in. Live, traced, resettable API out —
with stateful mocks, scope enforcement, and full request replay.
Why Sandbox
Three things your consumers actually need.
Spec → live in seconds.
Upload an OpenAPI spec. We compile an immutable release and deploy it to
Cloudflare Workers — your sandbox URL is live in under a minute.
OpenAPI 3.0 / 3.1 · Cloudflare Workers
Stateful mocks, deterministic by design.
Five execution modes — static mock, dynamic mock, stateful mock.
Snapshots, scenarios, deterministic clock advance, signed webhook delivery.
Reset to a known seed in a single call.
Every request is traced with auth decisions, policy results, and response provenance.
Replay any traced request in a single CLI command.
Auth · Policy · Lineage
Three strategies, one platform
Pick the level of realism each test actually needs.
Mock
Static example response.
Deterministic example payload pulled straight from your spec. Same input,
same output, every time — perfect for auth and scope checks, scripted demos,
and the 80% of tests that don’t need state.
When the contract is the test.Dynamic mock
Schema-driven, varied per call.
Responses generated from your schema on every request. Shape matches the contract
exactly; values vary so consumers don’t hard-code fixtures. Same release plus
same request fingerprint still returns the same body.
A JSON state model behind every operation. POST creates, GET reads, PATCH mutates,
DELETE removes. Snapshots, scenarios, deterministic clock advance, signed webhook
delivery. Reset to seed in one call.
# Define the auth contract (sandbox-native, no real IdP needed)sdb auth create-profilepayments-sim--modesimulated--schemeBearerAuth=bearer# Compile + deploy an immutable release behind the bank-sim sandboxsdb publish./payments.yaml--sandboxbank-sim--auth-profilepayments-sim# Watch every request your partners make, in real timesdb trace tailbank-sim--limit10
# Connect to a sandbox a publisher invited you tosdb connect<CONNECT_URL># Exchange your client credential for a runtime sessionsdb auth login--client-id<ID>--client-secret-stdin# Hit the sandbox like it's the real APIsdb sandbox requestGET/refunds/ref_123
Install the CLI: pipx install api-sandbox ·
or brew tap digitalapicraft/api-sandbox-cli && brew install api-sandbox
Stateful mocks
Mocks that remember.
Static mocks fall over the moment your test needs to read what it just wrote.
Stateful mocks keep a JSON state model behind every operation —
POST creates, GET reads, PATCH mutates, DELETE removes —
and respond from that state on every request.
State is deterministic and replayable. Seed it from your
simulation pack, snapshot it before a test, advance the clock to fire a
webhook timer, restore the snapshot, and run again — same outcome every time.
Reset returns the sandbox to its seed in one call. No shared staging drift,
no cross-team data corruption, no “who deleted my fixtures” Monday morning.
SeedStart from a known JSON state defined in your simulation pack.
Snapshot & RestoreCapture the live state at any moment; restore it later for replay.
Clock advanceMove simulated time forward to fire scheduled webhooks and timers.
ResetDrop everything back to seed in one CLI call or HTTP request.
Same release, same auth, same scopes — only the state changes between the calls.
Beyond seed and reset
Scenarios, timers, and webhooks — the rest of the simulation surface.
Stateful mocks come with the primitives a real workflow needs: named state transitions you can apply on demand, a deterministic clock that fires scheduled events, and signed webhook delivery your partners can subscribe to.
Scenarios
Flip into a known shape, by name.
Apply credit-ladder, nsf, expired-card, or any scenario you’ve packed. The sandbox jumps to that state immediately. Reusable across teams and CI runs.
Timers
Advance the clock. Watch state move.
Schedule a transition at simulated T+5m. Advance the clock past it. The transition fires deterministically — same as on a real clock, just faster.
Webhooks
Signed events, traced, replayable.
Register a destination. The sandbox emits signed events on every state change. Each delivery is traced; failed ones retry on schedule and stay replayable.
Snapshots
Save state. Restore later. Bit-perfect.
Capture the live state at any moment. Run a destructive test. Call restore — the sandbox returns to that exact JSON, byte-for-byte. Branch your tests without forking your stack.
Restore a production-shaped state, replay the failing trace exactly as the partner saw it, ship the fix, and verify against the same recording.
Built for the agent era
Designed for AI-agent integrations from day one.
Agents need APIs that respond the same way today as they did in last week’s evaluation.
Sandbox is deterministic by default — and the whole platform is shaped for automation.
Every CLI action is one command with structured output. Agents drive Sandbox the same way humans do, just faster.
Snapshot before risky tool calls. Replay the exact trace an agent saw last Tuesday. Reset between runs.
No production data, no rate-limit roulette, no surprises — agents loop on stateful mocks until they get it right.
Scope-bounded client credentials per agent or per task. Revoke without paging anyone.
On Cloudflare’s edge
Every sandbox runs on Cloudflare Workers.
Sandboxes inherit the runtime your production gateway probably already trusts. Geo-distributed,
instant scale, isolated per partner.
Geo-distributed at Cloudflare’s edge — sub-50ms cold start, scales to zero between tests.
Per-partner isolation. One tenant’s traffic never touches another’s runtime or state.
DDoS protection and WAF inherited from Cloudflare’s edge — same posture as production.
Logs, metrics, and traces emitted from the edge straight back into the control plane.