Security & Guardrails
Authentication and scope
Hosted chat, session, and store requests require runtime authentication, even when the app is public. See Authentication.
A token without a pinned scope_id, such as an API key or operator token, is not limited to one scope. See Embedding & Multi-tenancy for scope precedence and the checks a multi-tenant backend makes.
Coverage
| Control | Applies to | Does not apply to |
|---|---|---|
| Hooks | Model tool calls and string tool results in the root chat loop and subagent loops; input and assistant text in the root chat loop | Calls your own code makes (composite child calls, ctx.request(), durable intents, triggered tools, direct tool evals), structured tool results, and reasoning |
| Endpoint policy and confirmation | Model calls to request and native OpenAPI tools | ctx.request() in custom tools, MCP tools, and connection-driver tools |
| Field restrictions | Responses to request, native OpenAPI tools and ctx.request(), on every path | MCP tools, connection-driver tools, and the model's reply |
Enforce permissions for uncovered paths in the tool handler or the downstream API. Use a preOutput hook for redaction of the model's reply.
Field restrictions apply only when the response shape matches the policy. Verify removal and redaction with an eval that contains the values to withhold.
Resource access
An agent's declared tools, skills, connections, stores, mcp, and subagents determine its session's resources. Each entry names one resource exactly, with no wildcard. A name that matches no loaded resource grants nothing. Conditional entries in agent.ts can check verified claims through ctx.claims. See Agents.
Runtime HTTP roles (user, admin, ops) are separate from these declarations.
Execution limits
| Limit | Default | Effect |
|---|---|---|
| Model turns | 50 | Stops a chat run at the turn limit. |
| Turn deadline | 10 minutes when the caller passes no signal | Aborts the turn through its cancellation signal. |
| Hook call | 1500 ms | A timed-out hook follows its failPolicy. |