Skip to Content
CapabilitiesPolicy and Limits

Policy and Limits

policy bounds how a capability runs: how long it may take, how much it may read and return, and how often it may be called. Set common values once in the top-level defaults section and override them per capability:

defaults: timeout: 10s max_output_bytes: 1MB rate_limit: {requests: 60, per: 1m, burst: 10} capabilities: get_customer: policy: timeout: 3s max_rows: 1

A value in defaults only applies to capabilities where it makes sense; max_rows in defaults does not affect an HTTP capability. Setting a key directly in a capability’s policy where it does not apply is a configuration error.

Settings

KeyDefaultApplies toMeaning
timeout5sallTime budget for execution and output validation, up to 300s
readonlytrueDBtrue allows only SELECT. Set false for INSERT, UPDATE, or DELETE
max_rows100DB SELECT, CSVDB results are truncated at this count. CSV fails with LIMIT_EXCEEDED if more rows match
max_affected_rowsnoneDB mutationsIf more rows are affected, the transaction is rolled back and the call fails with LIMIT_EXCEEDED
max_input_bytes1MBallSize of the JSON input
max_output_bytes1MBcapabilities that publish data or generate CSVSize of the published JSON, and of the data a generated CSV is built from
max_json_depth32allNesting depth of input and output JSON
max_json_items100000allTotal number of values in input and output JSON
rate_limitnoneall{requests, per, burst}. See below
expose_in_openapitrueallWhether the capability appears in OpenAPI and the MCP tool list

Sizes accept plain byte counts or units such as 256KB, 8MiB, or 1GB; KB and KiB both mean 1024 bytes. Every limit must be a positive, finite value; 0 does not mean unlimited.

File limits

These apply only to capabilities that accept or return files:

KeyDefaultMeaning
max_input_files16Number of uploaded files per call
max_input_file_bytes32MiBSize of each uploaded file. A file input’s max_bytes can lower it
max_total_input_file_bytes64MiBCombined size of uploaded files per call
max_output_files16Number of returned files per call
max_output_file_bytes32MiBSize of each returned file
max_total_output_file_bytes64MiBCombined size of returned files per call
file_ttl15mHow long download links and retained files stay valid
mcp_inline_total_bytes1MiBSize of an MCP tool result with delivery.mcp: inline, including Base64 encoding

The gateway has its own request size limits for uploads; see Gateway configuration. Uploads and returned files are staged in the agent’s spool, which has a total quota set by runtime.spool_total_bytes; see Agent configuration.

Rate limits

rate_limit gives each capability a token bucket shared by all its callers. The bucket starts with burst tokens and refills at requests per per:

policy: rate_limit: {requests: 10, per: 1s, burst: 20}

A call that finds the bucket empty fails with RATE_LIMITED before it runs. A capability takes the whole rate_limit object from defaults unless it sets its own. Buckets survive gateway reconnects and reset when the agent restarts.

This limit is enforced by the agent, so it holds even if the gateway’s own per-IP limit is bypassed. The agent also caps concurrent executions with runtime.max_concurrent_requests; calls beyond that and its waiting queue fail with BUSY.

Timeouts

timeout covers the run itself and checking its output. A caller that disconnects or sets a shorter deadline ends the call earlier. Receiving uploaded files and sending large downloads are bounded separately by runtime.transfer_timeout, so a client or proxy in front of the gateway needs a timeout that covers both; see Deployment.

If a mutation, HTTP call, or code capability times out after it started, the result may be unknown. Read Uncertain outcomes before retrying.