Skip to main content

Sandbox API

Cold start: observe a first-time agent, propose a manifest from what it did, and have a person ratify it. Every route needs the admin bearer and returns 404 unless the control plane runs with AGENTIC_AUTH_SANDBOX_ENABLED=true.

Nothing here can affect a decision. A proposal is a manifest with status proposed, which the policy compiler never selects, so no session can pin it until it is ratified.

:::note What works in 0.4.0

These routes work, but nothing feeds a run a trace yet, so a run ends with no observed behaviour. To propose a manifest today, record the agent with agentic-auth drift record and fold the trace locally with agentic-auth sandbox propose-local. Onboard an agent with no manifest walks through it.

:::

The agent must exist first. Register it with POST /v1/agents and no manifest: that creates the agent with no manifest version, no compiled policy, and therefore no authority.

POST /v1/agents/{agent_id}/sandbox​

Starts an observation run. Every call the agent attempts is allowed and recorded, and every tool it can reach is a mock with nothing real behind it.

Request body (SandboxStart):

{"scope": "support-sandbox", "mock_tools": ["mcp://kb.internal/search"], "deadline_seconds": 300}
FieldNotes
scopeThe synthetic all-allow scope the run is driven under
mock_toolsTool refs to expose, each backed by a recorder that performs nothing. A ref not listed is unreachable.
deadline_secondsOptional. The run ends here whether or not the agent stopped. Defaults to AGENTIC_AUTH_SANDBOX_RUN_DEADLINE_SECONDS (300).

Response: 201 (SandboxRunRead)

{
"id": "...",
"agent_id": "...",
"status": "running",
"scope": "support-sandbox",
"started_at": "...",
"deadline_at": "...",
"ended_at": null,
"recorder_errors": 0,
"observed": null
}

status is one of running, completed, deadline_exceeded or failed. A non-zero recorder_errors means events were lost, so a proposal from the run may be narrower than the agent's real behaviour.

GET /v1/agents/{agent_id}/sandbox​

The agent's runs. Query params: limit. Response: {"data": [...], "next_cursor": ...}.

GET /v1/agents/{agent_id}/sandbox/{run_id}​

One run, as above. 404 for an unknown agent or run.

GET /v1/agents/{agent_id}/proposed-manifest​

The manifest proposed from a completed run, the latest unless run_id is given as a query param. 404 when the agent has no completed run.

Response: 200 (ProposedManifestRead)

{"manifest_id": "...", "agent_id": "...", "run_id": "...", "status": "proposed", "doc": {...}, "covers_no_behaviour": false}

covers_no_behaviour: true means the run reached no tools at all. An empty manifest and "we saw nothing" are different things, so it is flagged rather than presented as complete.

POST /v1/agents/{agent_id}/proposed-manifest/ratify​

Pins a proposal as the agent's manifest. This is the human decision.

Request body (RatifyRequest):

{"run_id": "...", "doc": null, "note": "reviewed against the support runbook"}

Omit doc to ratify the proposal as generated. Supply it to pin your edited document instead.

Response: 201

{"manifest_id": "...", "agent_id": "...", "version": 1, "status": "...", "ratified_by": "admin", "ratified_at": "..."}

For an agent with no prior manifest this pins version 1, immutable from then on. The ratified manifest then reconciles exactly like a hand-written one, and one that fails reconciliation does not admit the agent.