PreciseDocs

Limits and errors

The limits the sandbox enforces and the error codes a caller meets, with what to do next. Each code on this page was returned by the live sandbox or read from the code it runs, and the page says which.

On this page
CapabilityRuntimeStatus
Inspect the public sandbox’s queue, limits and errorsSandboxLive
Read the error codes on configured public-test AccessSandboxPreview

Request limits

LimitValueWhat you get past it
Request body4 MB413 body_too_large
Query text20,000 characters400 invalid_query
Rows returned by one querymax_rows from 1 to 200truncated: true, with the full count in total_rows
Query timetimeout_ms from 100 to 120,000504 query_pending, with the run_id to ask for again

A query is one read-only SELECT over the ten tables of the sample book. A VALUES list, a second statement, and a field name that denotes personal data such as email or ip_address are turned away.

The query queue

Queries take turns, and that queue is the concurrency limit each authenticated sandbox caller meets.

RuleValue
Queries running at once on the service2
Queries one caller runs at once1
Queries one caller may have waiting2
Queries waiting in total16

A query that finds the line full answers 429 query_busy. The answer carries a Retry-After header in seconds and the same number as retry_after_seconds in the body. Wait that long, then send the same request.

POST /api/sql/run, POST /api/mcp, POST /api/gateway/run, POST /api/workflow/run and POST /api/holdout/size have no per-minute limit of their own.

Rate limits

Four routes that these docs do not use carry a rate limit. Each answers 429 rate_limited with Retry-After.

RouteLimit
POST /api/preview/gateway, used by the sandbox's own page40 a minute per caller
POST /api/sql/generate, drafting a query from a question20 a minute per caller
Opening a workspace30 an hour across the service
Requesting access25 an hour across the service

Error shape

The sandbox's REST routes answer an error as one flat object:

JSON
{"error": "A query is at most 20,000 characters; this one is 20,845.", "code": "invalid_query"}

Branch on code. The error text is written for a person and can change.

This read-only sizing request returns HTTP 409. The sample order exists and has no unit test.

Runtime: SandboxStatus: LivePOST /api/holdout/size
curl -sS --fail-with-body https://sandbox.precise.ai/api/holdout/size \
  -H 'content-type: application/json' \
  -d '{"order_id":"ORD-001"}'

An underpowered test is a successful sizing result. For ORD-067 read verdict and limitation.code in the response body.

Codes a sandbox caller meets

StatusCodeWhat happenedWhat to do
400invalid_jsonThe body is not valid JSONFix the body
400invalid_queryThe request is not one query the sandbox accepts: no sql or join_spec, both at once, a VALUES list, over 20,000 characters, or max_rows outside 1 to 200Read the error text; it names the rule
400invalid_requestA field is missing or has the wrong typeCheck the request against the route's guide
400pii_not_acceptedThe query names a personal-data fieldCount or group; leave person-level fields out
400method_not_offered, workflow_not_offeredThe method or workflow is not one this route runsThe error text lists the ones it runs
401workspace_requiredA gated sandbox, SQL, Gateway, or MCP request carries no valid workspace keySend Authorization: Bearer <workspace key>
401invalid_keyThe key is not one the sandbox knowsCheck the key
404not_foundNo route at that addressCheck the path
404campaign_not_foundNo campaign or order with that id in the bookList them with GET /api/campaigns
404order_not_foundNo order with that id, on a route that takes an orderTry ORD-012 or ORD-067
404run_not_foundThe run is not one this caller can reopenRun the request again for a fresh run_id
404guide_section_not_foundNo such section in the guideRead the guide's index first
404method_not_mountedThe method is in the catalog and is not mounted on this GatewayUse hero_methods with live: true from run_analysis {"list_contracts":true}. The catalog also lists description-only entries
409order_has_no_holdoutThe selected sample order has no Audience HoldoutChoose ORD-012 or use workspace sizing with your baseline, effect and volume
405method_not_allowedThe route does not take that HTTP methodUse the method the guide shows
413body_too_largeThe body is over 4 MBSend less
422query_failedThe query is not a single read-only SELECT, or names a table, column or function the catalog does not haveFix the SQL; the error text quotes the engine
429query_busyThe query queue is fullWait Retry-After seconds
503gateway_start_timeout, gateway_stoppedThe query engine is starting, or was stoppedTry again shortly
504query_pendingThe query is still running at your timeout_msAsk again after 2 seconds; the answer carries the run_id

The live sandbox returned these while this page was written: invalid_json, invalid_query, pii_not_accepted, workspace_required, invalid_key, not_found, campaign_not_found, order_not_found, run_not_found, guide_section_not_found, method_not_allowed and query_failed. The rest were read from the code the sandbox runs.

Codes that need a workspace

A workspace key is requested on the sandbox's own page at https://sandbox.precise.ai, and arrives by email. These codes answer requests that carry one.

StatusCodeWhat happened
400invalid_baseline, invalid_mde, invalid_volume, invalid_holdoutA sizing input of your own is out of range
409holdout_not_computedThe sizing method did not reach an answer on those inputs
400invalid_prediction, invalid_confidenceA recorded Decision needs lower ≤ predicted_value ≤ upper, and a confidence between 0 and 1
400missing_outcome, missing_lessonScoring a Decision needs its outcome, or a reason it cannot be computed, and what it changes next time
409score_not_computed, policy_not_compiledThe Gateway could not score the Decision, or compile the policy, on that input

Two more codes belong to workspaces: 401 workspace_expired and run_not_in_workspace. All of the codes in this section were read from the code the sandbox runs. No workspace was opened to write this page.

MCP errors

POST /api/mcp answers in JSON-RPC, so most errors arrive with HTTP 200 and an error object.

CaseHTTPJSON-RPCNotes
The Accept header does not list both application/json and text/event-stream406-32000Send accept: application/json, text/event-stream
Unknown method200-32601 Method not found
Unknown tool200-32602 Tool not found
Arguments that do not fit the tool's schema200A result whose text starts "Input validation error"The text names the field and what was expected
A gated MCP tool called without a valid workspace key401-32001, with data.code workspace_requiredThe www-authenticate header points at the protected-resource metadata

This message calls an MCP tool without a key so you can see the exact 401 challenge shape:

Runtime: SandboxStatus: Livetools/call · advance_time
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "advance_time",
    "arguments": {}
  }
}

The Precise app API

Unified Access returns a structured error. These two cases were run against the public-test profile on 24 Nov 2026.

HTTPCodeRecovery
400INVALID_REQUESTSend the required sql and pin to POST /api/v1/query. The message identifies the missing fields.
404REFERENCE_NOT_FOUNDUse list_decisions to resolve a current decision ID. The invalid ID D-999 returned this code with recovery: "correctable".
401AUTH_REQUIREDA credentialed Access profile needs its bearer credential. A public-test reader cannot gain authority by setting Precise-Workspace.

The REST quickstart includes complete JSON for the 400 and 404 cases. On a spend-capable deployment, read the governance and buying guide before retrying an approval, dispatch or settlement.

Exact and sampled attribution

The public four-player Shapley example, the Python batch sampler and the Rust ratio solver have different work limits and error characteristics. Use the engine table, per-player oracle and batch error measurements. The batch error table defines the scale for every percentage. A credit apportions the supplied total. Use a clean holdout to measure a change's causal effect.

Engine and gameDefault behavior and work unit
Python batch, additiveClosed form in the measure's units. The batch accepts up to 500 segments.
Python batch, ratioEnumeration through 20, then 1,000 complementary draws per segment by default. The published error percentages divide by the mean absolute exact credit.
Hosted sandboxThe sandbox example executes the four-player exact reference inside your authenticated workspace. The sample response does not benchmark 500-player attribution.
Rust Gateway, eligible weighted ratioFrom 14 players in auto or exact, Schwinger-Beta uses deterministic quadrature and zero random draws.
Rust Gateway, other large sampled gamesAbove 21, antithetic permutations default to 1,024 permutation evaluations. Explicit exact enumeration is subject to its work and memory budgets.

How long an identifier lasts

  • Use the returned run_id. Changing a normalized input can change the run ID; outer SQL whitespace is normalized.
  • A run reopens on the Gateway process that computed it. After a restart, or on another instance, run the request again.
  • A result_digest is stable for the life of one Gateway process. Compare digests within one session, and compare rows across sessions.
  • Access binds its token to a frozen payload. Intent defaults to 600 seconds, execution to seven days, and the separate human-approval freshness window to 900 seconds.

Limits documented on other pages

LimitValuePage
Native Iceberg import256 MiB a file, 4 GiB a pinCloud connections
Smallest group a Partner Clean Room reportsThe larger of both owners' minimums and the envelope's minimum audiencePartner Clean Room
Scoring container500m CPU, 128Mi memory, 64 connections, 256 proposals an answer, no network egressARTF container guide
This docs site's relay to the sandbox256 KB a request, read-only routesThis docs site

↑↓ to move↵ to open

Connect an agent

Precise Sandbox speaks MCP over Streamable HTTP with a per-company workspace key (penv_...). Request a private sandbox key at sandbox.precise.ai.

https://sandbox.precise.ai/api/mcp/<YOUR_SANDBOX_KEY>

Set PRECISE_SANDBOX_KEY to your per-company workspace key (penv_...), then run once in a terminal.

claude mcp add --transport http precise-sandbox https://sandbox.precise.ai/api/mcp --header "Authorization: Bearer $PRECISE_SANDBOX_KEY"