Skip to main content
Two fields control how a hosted agent uses tools: enabled determines whether a tool is exposed to the model, and permission_policy determines how the platform evaluates a tool call from the model. Use them to disable tools that modify external state—such as writing files, running commands, or calling external services—or to require confirmation before those tools execute.

Configuration fields

Both fields apply to built-in toolsets (agent_toolset) and MCP toolsets (mcp_toolset), and both can be configured at two levels:
  • Toolset level: Set inside default_config on the toolset declaration as the default for all tools in that toolset.
  • Per-tool level: Set the same field for an individual tool inside configs to override the toolset-level default.
When neither level is configured, tools are enabled by default and evaluated under always_allow—the platform executes the tool immediately when the model calls it. For every tool call, the evaluated decision is delivered to the client in the evaluated_permission field of the agent.tool_use event.

Handle always_ask confirmations

When the model calls a tool configured with always_ask, the platform emits an agent.tool_use event, pauses execution, and waits for the client to reply with a user.tool_confirmation event via POST /v1/sessions/{session_id}/events. Once the confirmation result arrives, the platform either executes or skips the tool call. For details on subscribing to and resuming event streams, see Event Stream. Pass the top-level id from the originating agent.tool_use event as event_id. To approve execution, set result to allow:
To deny execution, set result to deny and optionally include deny_message to explain the reason; when allowing execution, deny_message must be empty. The request must contain only tool confirmation events; the endpoint returns 202 when accepted.
Recommended practice: leave read-only tools at the default always_allow policy; set tools that can modify external state to always_ask; and set enabled: false at the toolset or per-tool level for any tool the agent should never use.

Configure tool permissions

Include both fields in your tool declarations when you create an agent. You can also modify these settings on an existing agent: pass the tools field when you update an agent, which creates a new agent version without recreating the agent. tools replaces custom and MCP tool declarations in full; if the array omits agent_toolset, the current version’s agent_toolset declaration is kept (or agent_toolset_20261101 is prepended if none exists). The example below sets automatic approval as the default for the built-in toolset while disabling write:
configs[].name must use a tool name from the selected toolset version: for example, the file-writing tool is named write in agent_toolset_20261101, and write_file in agent_toolset_20260901 (legacy name default_toolset_20260901).

MCP toolsets

MCP toolsets configure enabled and permission_policy in default_config and configs in the same way. mcp_server_name must reference a server declared in the same agent’s mcp_servers, and configs[].name uses the actual tool name exposed by that MCP server.
For details on declaring MCP servers, where tool names come from, and how configs behaves when a server’s tool list changes, see Configure MCP Servers.

Next steps

Configure tool declarations

Learn how to declare built-in toolsets and MCP tools.

Handle tool confirmation events

Receive tool call and session status events in real time.