Server HTTP API Reference
The wire contract of the in-sandbox server (agent_sandbox.server, port 9000; PTY WebSocket on 9001). The route-by-route behavior is in the template server HTTP API. The Agents routes are in the Agents API reference. Design background is in Server API Design.
One id per endpoint
Every route is one endpoint with one id (files_download, shell, agents_sessions_create). The same id is used by the policy, the audit log, GET /capabilities, and the client. There are 118 endpoints: core 3, commands 2, file_ops 12, process 8, terminal 6 (including the WebSocket pty_connect), system 6, dev_tools 3, browser 8, agents 70. The table is agent_sandbox.server.endpoints.ENDPOINTS. Nothing is served that is not in it, and there is no /ops or RPC route.
One pipeline
Every request goes through the same steps, in this order:
- Match method and path to an endpoint. No match is
404Not found: <path>. - Authenticate:
Authorization: Bearer <token>orX-Access-Token. Missing or wrong is401unauthorized. Two differentX-Access-Tokenvalues are400ambiguous_credentials. - Admit through the policy engine: the endpoint must be on (
404endpoint_disabled, withrule), the caller must hold the scopes (403missing_scope), and the rate and concurrency limits must have room (429). - A repeated query parameter is
400duplicate_parameter. - The body limit (10 MiB) is checked before the body is read:
413payload_too_large. - The handler runs. Path, command, process, environment, and URL guards answer here.
- The audit entry is written (
audit: off|deny|all).
GET /health is the only route that skips step 2.
Error body
{"error": "<message>", "type": "<ExceptionName>", "code": "<machine code>", "endpoint": "<endpoint id>"}
code and endpoint are present on policy and guard denials. A disabled endpoint also has rule. /v1/ Agents routes use the OpenAI envelope {"error": {"message", "type", "param", "code"}}.
code |
Status | Meaning |
|---|---|---|
unauthorized |
401 | Missing or wrong token |
ambiguous_credentials |
400 | Two different credential values in one request |
endpoint_disabled |
404 | The endpoint is off. rule names the layer, for example policy:endpoints.shell, preset:read-only, code:enable_group:file_ops, env:ABX_SERVER_ENABLED_GROUPS:agents, default:opt-in:browser |
missing_scope |
403 | The caller lacks a scope the endpoint (or command) needs |
scope_required |
403 | A command guard has no allow-list entry that could admit the call |
path_not_allowed |
403 | The path is outside the allowed directories (includes shell cwd) |
path_denied |
403 | The path matches a paths.deny pattern |
read_only |
403 | The endpoint's paths.read_only rejects writes and deletes |
symlink_denied |
403 | paths.symlinks refuses a symlink |
invalid_path |
400 | Missing, NUL byte, or too long |
command_not_allowed |
403 | allow_commands / deny_commands refuse the command |
command_invalid, process_invalid |
400 | Empty or malformed executable |
process_denied |
403 | A process guard refuses the program |
env_var_denied, env_var_not_allowed |
403 | An environment variable is refused |
env_invalid, url_invalid |
400 | Malformed environment map or URL |
url_denied |
403 | url_allow / url_deny / private-network rules refuse the URL |
language_not_allowed |
403 | code_run language not in params.languages |
extension_not_allowed |
403 | Upload extension refused |
file_exists |
409 | overwrite: false and the file exists |
payload_too_large |
413 | Body or file over the limit |
rate_limited, concurrency_limited |
429 | Limit exhausted. Retry-After is set |
duplicate_parameter |
400 | A query parameter was repeated |
Discovery
GET /capabilities returns the state of every endpoint for the caller (enabled, allowed, reason, rule, scopes, limits) and the derived groups and group_summary. POST /capabilities/check answers whether one endpoint (and optionally one path) would be allowed, without running it. Both are described in the template server HTTP API.
Switching endpoints
One layer decides: the endpoint rule. A group name is an alias for its endpoint ids. See Fine-grained capabilities. The only group environment variable is ABX_SERVER_ENABLED_GROUPS.