One change
create
api/beta/sessions/create
Nearest release: v2.1.239, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/sessions/create Changed · +1140 / -678 lines
The two sides of this change are too far apart to line up, so this is the differ's own diff of it.
from line 345
Per-tool configuration overrides. - - `name: "bash" or "edit" or "read" or 5 more` - - Built-in agent tool identifier. - - - `"bash"` - - - `"edit"` - - - `"read"` - - - `"write"` - - - `"glob"` - - - `"grep"` - - - `"web_fetch"` - - - `"web_search"` + - `BetaManagedAgentsBashToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the bash tool. + + - `name: "bash"` + + Must be "bash". + + - `"bash"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `type: "always_allow"` + + - `"always_allow"` + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "always_ask"` + + - `"always_ask"` + + - `type: optional "bash"` + + - `"bash"` + + - `BetaManagedAgentsEditToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the edit tool. + + - `name: "edit"` + + Must be "edit". + + - `"edit"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "edit"` + + - `"edit"` + + - `BetaManagedAgentsReadToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the read tool. + + - `name: "read"` + + Must be "read". + + - `"read"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "read"` + + - `"read"` + + - `BetaManagedAgentsWriteToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the write tool. + + - `name: "write"` + + Must be "write". + + - `"write"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "write"` + + - `"write"` + + - `BetaManagedAgentsGlobToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the glob tool. + + - `name: "glob"` + + Must be "glob". + + - `"glob"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "glob"` + + - `"glob"` + + - `BetaManagedAgentsGrepToolConfigParams object { name, enabled, permission_policy, type }` + + Configuration override for the grep tool. + + - `name: "grep"` + + Must be "grep". + + - `"grep"` + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "grep"` + + - `"grep"` + + - `BetaManagedAgentsWebFetchToolConfigParams object { name, allowed_domains, blocked_domains, 4 more }` + + Configuration override for the web_fetch tool. + + - `name: "web_fetch"` + + Must be "web_fetch". + + - `"web_fetch"` + + - `allowed_domains: optional array of string` + + Only fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains. + + - `blocked_domains: optional array of string` + + Never fetch URLs whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme, port, or path). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains. + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `max_content_tokens: optional number or null` + + Maximum number of tokens of fetched text content to include in context per call. Does not apply to binary content such as PDFs. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "web_fetch"` + + - `"web_fetch"` + + - `BetaManagedAgentsWebSearchToolConfigParams object { name, allowed_domains, blocked_domains, 4 more }` + + Configuration override for the web_search tool. + + - `name: "web_search"` + + Must be "web_search". + + - `"web_search"` + + - `allowed_domains: optional array of string` + + Only return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "docs.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with blocked_domains. + + - `blocked_domains: optional array of string` + + Never return search results whose host is one of these domains or a subdomain of one. Each entry is a plain hostname like "ads.example.com" (no scheme or port; an optional path suffix is accepted). At most 64 entries; an empty list is rejected (omit the field instead). Cannot be combined with allowed_domains. + + - `enabled: optional boolean or null` + + Whether this tool is enabled and available to Claude. Overrides the default_config setting. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: optional "web_search"` + + - `"web_search"` + + - `user_location: optional BetaManagedAgentsUserLocation or null` + + Approximate user location for search result localization. + + - `type: "approximate"` + + Location precision. Only "approximate" is supported. + + - `"approximate"` + + - `city: optional string or null` + + City name. + + - `country: optional string or null` + + Two-letter ISO 3166-1 country code, uppercase. + + - `region: optional string or null` + + Region or state name. + + - `timezone: optional string or null` + + IANA timezone identifier, e.g. "America/Los_Angeles". + + - `default_config: optional BetaManagedAgentsAgentToolsetDefaultConfigParams or null` + + Default configuration for all tools in a toolset. - `enabled: optional boolean or null` - Whether this tool is enabled and available to Claude. Overrides the default_config setting. + Whether tools are enabled and available to Claude by default. Defaults to true if not specified. - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null`
from line 655
Tool calls are automatically approved without user confirmation. - - `type: "always_allow"` - - - `"always_allow"` - - `BetaManagedAgentsAlwaysAskPolicy object { type }` Tool calls require user confirmation before execution. - - `type: "always_ask"` - - - `"always_ask"` - - - `default_config: optional BetaManagedAgentsAgentToolsetDefaultConfigParams or null` - - Default configuration for all tools in a toolset. + - `BetaManagedAgentsMCPToolsetParams object { mcp_server_name, type, configs, default_config }` + + Configuration for tools from an MCP server defined in `mcp_servers`. + + - `mcp_server_name: string` + + Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters. + + - `type: "mcp_toolset"` + + - `"mcp_toolset"` + + - `configs: optional array of BetaManagedAgentsMCPToolConfigParams` + + Per-tool configuration overrides. + + - `name: string` + + Name of the MCP tool to configure. 1-128 characters. - `enabled: optional boolean or null` - Whether tools are enabled and available to Claude by default. Defaults to true if not specified. + Whether this tool is enabled. Overrides the `default_config` setting. - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null`
from line 695
Tool calls require user confirmation before execution. - - `BetaManagedAgentsMCPToolsetParams object { mcp_server_name, type, configs, default_config }` - - Configuration for tools from an MCP server defined in `mcp_servers`. - - - `mcp_server_name: string` - - Name of the MCP server. Must match a server name from the mcp_servers array. 1-255 characters. - - - `type: "mcp_toolset"` - - - `"mcp_toolset"` - - - `configs: optional array of BetaManagedAgentsMCPToolConfigParams` - - Per-tool configuration overrides. + - `default_config: optional BetaManagedAgentsMCPToolsetDefaultConfigParams or null` + + Default configuration for all tools from an MCP server. + + - `enabled: optional boolean or null` + + Whether tools are enabled by default. Defaults to true if not specified. + + - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `BetaManagedAgentsCustomToolParams object { description, input_schema, name, type }` + + A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event. + + - `description: string` + + Description of what the tool does, shown to the agent to help it decide when to use the tool. + + - `input_schema: BetaManagedAgentsCustomToolInputSchema` + + JSON Schema for custom tool input parameters. + + - `type: "object"` + + - `"object"` + + - `properties: optional map[unknown] or null` + + - `required: optional array of string or null` + + - `name: string` + + Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens. + + - `type: "custom"` + + - `"custom"` + + - `version: optional number` + + The specific `agent` version to use. Omit to use the latest version. + +- `environment_id: string` + + ID of the `environment` defining the container configuration for this session. + +- `budget: optional BetaManagedAgentsBudgetLimit` + + A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. + + - `max_list_cost: BetaMonetaryAmount` + + A monetary amount in a specific currency. + + - `amount: string` + + Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied. + + - `currency: BetaCurrency` + + Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced. + + - `"USD"` + + - `type: "limit"` + + - `"limit"` + +- `initial_events: optional array of BetaManagedAgentsUserMessageEventParams or BetaManagedAgentsUserDefineOutcomeEventParams` + + Initial events to send to the `session` at creation, processed in order. Supports `user.message` and `user.define_outcome` events. Maximum 50 events. + + - `BetaManagedAgentsUserMessageEventParams object { content, type }` + + Parameters for sending a user message to the session. + + - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock` + + Array of content blocks for the user message. + + - `BetaManagedAgentsTextBlock object { text, type }` + + Regular text content. + + - `text: string` + + The text content. + + - `type: "text"` + + - `"text"` + + - `BetaManagedAgentsImageBlock object { source, type }` + + Image content specified directly as base64 data or as a reference via a URL. + + - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource` + + Union type for image source variants. + + - `BetaManagedAgentsBase64ImageSource object { data, media_type, type }` + + Base64-encoded image data. + + - `data: string` + + Base64-encoded image data. + + - `media_type: string` + + MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp"). + + - `type: "base64"` + + - `"base64"` + + - `BetaManagedAgentsURLImageSource object { type, url }` + + Image referenced by URL. + + - `type: "url"` + + - `"url"` + + - `url: string` + + URL of the image to fetch. + + - `BetaManagedAgentsFileImageSource object { file_id, type }` + + Image referenced by file ID. + + - `file_id: string` + + ID of a previously uploaded file. + + - `type: "file"` + + - `"file"` + + - `type: "image"` + + - `"image"` + + - `BetaManagedAgentsDocumentBlock object { source, type, context, title }` + + Document content, either specified directly as base64 data, as text, or as a reference via a URL. + + - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource` + + Union type for document source variants. + + - `BetaManagedAgentsBase64DocumentSource object { data, media_type, type }` + + Base64-encoded document data. + + - `data: string` + + Base64-encoded document data. + + - `media_type: string` + + MIME type of the document (e.g., "application/pdf"). + + - `type: "base64"` + + - `"base64"` + + - `BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }` + + Plain text document content. + + - `data: string` + + The plain text content. + + - `media_type: "text/plain"` + + MIME type of the text content. Must be "text/plain". + + - `"text/plain"` + + - `type: "text"` + + - `"text"` + + - `BetaManagedAgentsURLDocumentSource object { type, url }` + + Document referenced by URL. + + - `type: "url"` + + - `"url"` + + - `url: string` + + URL of the document to fetch. + + - `BetaManagedAgentsFileDocumentSource object { file_id, type }` + + Document referenced by file ID. + + - `file_id: string` + + ID of a previously uploaded file. + + - `type: "file"` + + - `"file"` + + - `type: "document"` + + - `"document"` + + - `context: optional string or null` + + Additional context about the document for the model. + + - `title: optional string or null` + + The title of the document. + + - `BetaManagedAgentsRedactedBlock object { type }` + + Placeholder for content withheld by Anthropic model policy. + + - `type: "redacted"` + + - `"redacted"` + + - `type: "user.message"` + + - `"user.message"` + + - `BetaManagedAgentsUserDefineOutcomeEventParams object { description, rubric, type, max_iterations }` + + Parameters for defining an outcome the agent should work toward. The agent begins work on receipt. + + - `description: string` + + What the agent should produce. This is the task specification. + + - `rubric: BetaManagedAgentsFileRubricParams or BetaManagedAgentsTextRubricParams` + + Rubric for grading the quality of an outcome. + + - `BetaManagedAgentsFileRubricParams object { file_id, type }` + + Rubric referenced by a file uploaded via the Files API. + + - `file_id: string` + + ID of the rubric file. + + - `type: "file"` + + - `"file"` + + - `BetaManagedAgentsTextRubricParams object { content, type }` + + Rubric content provided inline as text. + + - `content: string` + + Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters. + + - `type: "text"` + + - `"text"` + + - `type: "user.define_outcome"` + + - `"user.define_outcome"` + + - `max_iterations: optional number or null` + + Eval→revision cycles before giving up. Default 3, max 20. + +- `metadata: optional map[string]` + + Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars. + +- `resources: optional array of BetaManagedAgentsGitHubRepositoryResourceParams or BetaManagedAgentsFileResourceParams or BetaManagedAgentsMemoryStoreResourceParam` + + Resources (e.g. repositories, files) to mount into the session's container. + + - `BetaManagedAgentsGitHubRepositoryResourceParams object { authorization_token, type, url, 2 more }` + + Mount a GitHub repository into the session's container. + + - `authorization_token: string` + + GitHub authorization token used to clone the repository. + + - `type: "github_repository"` + + - `"github_repository"` + + - `url: string` + + Github URL of the repository + + - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout or null` + + Branch or commit to check out. Defaults to the repository's default branch. + + - `BetaManagedAgentsBranchCheckout object { name, type }` + + - `name: string` + + Branch name to check out. + + - `type: "branch"` + + - `"branch"` + + - `BetaManagedAgentsCommitCheckout object { sha, type }` + + - `sha: string` + + Full commit SHA to check out. + + - `type: "commit"` + + - `"commit"` + + - `mount_path: optional string or null` + + Mount path in the container. Defaults to `/workspace/<repo-name>`. + + - `BetaManagedAgentsFileResourceParams object { file_id, type, mount_path }` + + Mount a file uploaded via the Files API into the session. + + - `file_id: string` + + ID of a previously uploaded file. + + - `type: "file"` + + - `"file"` + + - `mount_path: optional string or null` + + Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. + + - `BetaManagedAgentsMemoryStoreResourceParam object { memory_store_id, type, access, instructions }` + + Parameters for attaching a memory store to an agent session. + + - `memory_store_id: string` + + The memory store ID (memstore_...). Must belong to the caller's organization and workspace. + + - `type: "memory_store"` + + - `"memory_store"` + + - `access: optional "read_write" or "read_only" or null` + + Access mode for an attached memory store. + + - `"read_write"` + + - `"read_only"` + + - `instructions: optional string or null` + + Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. + +- `title: optional string or null` + + Human-readable session title. + +- `vault_ids: optional array of string` + + Vault IDs for stored credentials the agent can use during the session. + +### Returns + +- `BetaManagedAgentsSession object { id, agent, archived_at, 14 more }` + + A Managed Agents `session`. + + - `id: string` + + - `agent: BetaManagedAgentsSessionAgent` + + Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. + + - `id: string` + + - `description: string or null` + + - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition` + + - `name: string` + + - `type: "url"` + + - `"url"` + + - `url: string` + + - `model: BetaManagedAgentsModelConfig` + + Model identifier and configuration. + + - `id: BetaManagedAgentsModel` + + The model that will power your agent. + + See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. + + - `"claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more` + + The model that will power your agent. + + See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. + + - `"claude-sonnet-5"` + + High-performance model for coding and agents + + - `"claude-fable-5"` + + Next generation of intelligence for the hardest knowledge work and coding problems + + - `"claude-opus-5"` + + Powerful intelligence for long-running agents and coding + + - `"claude-opus-4-8"` + + Powerful intelligence for long-running agents and coding + + - `"claude-opus-4-7"` + + Powerful intelligence for long-running agents and coding + + - `"claude-opus-4-6"` + + Powerful intelligence for long-running agents and coding + + - `"claude-sonnet-4-6"` + + Best combination of speed and intelligence + + - `"claude-haiku-4-5"` + + Fastest model with near-frontier intelligence + + - `"claude-haiku-4-5-20251001"` + + Fastest model with near-frontier intelligence + + - `"claude-opus-4-5"` + + Powerful intelligence for long-running agents and coding + + - `"claude-opus-4-5-20251101"` + + Powerful intelligence for long-running agents and coding + + - `"claude-sonnet-4-5"` + + High-performance model for agents and coding + + - `"claude-sonnet-4-5-20250929"` + + High-performance model for agents and coding + + - `string` + + - `effort: optional BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or BetaManagedAgentsEffortHigh or 2 more` + + How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. + + - `BetaManagedAgentsEffortLow object { type }` + + Low effort. Favors latency over reasoning depth. + + - `type: "low"` + + - `"low"` + + - `BetaManagedAgentsEffortMedium object { type }` + + Medium effort. Balances latency and reasoning depth. + + - `type: "medium"` + + - `"medium"` + + - `BetaManagedAgentsEffortHigh object { type }` + + High effort. Favors reasoning depth. + + - `type: "high"` + + - `"high"` + + - `BetaManagedAgentsEffortXhigh object { type }` + + Extra-high effort. Not all models accept this level. + + - `type: "xhigh"` + + - `"xhigh"` + + - `BetaManagedAgentsEffortMax object { type }` + + Maximum effort. Favors reasoning depth over latency. + + - `type: "max"` + + - `"max"` + + - `inference_geo: optional string` + + Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. + + - `speed: optional "standard" or "fast"` + + Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. + + - `"standard"` + + - `"fast"` + + - `multiagent: BetaManagedAgentsSessionMultiagentCoordinator or null` + + Resolved coordinator topology with full agent definitions for each roster member. + + - `agents: array of BetaManagedAgentsSessionThreadAgent or BetaManagedAgentsAdvisor` + + Full `agent` definitions the coordinator may spawn as session threads. + + - `BetaManagedAgentsSessionThreadAgent object { id, description, mcp_servers, 7 more }` + + Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`. + + - `id: string` + + - `description: string or null` + + - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition` + + - `name: string` + + - `type: "url"` + + - `url: string` + + - `model: BetaManagedAgentsModelConfig` + + Model identifier and configuration. - `name: string` - Name of the MCP tool to configure. 1-128 characters. - - - `enabled: optional boolean or null` - - Whether this tool is enabled. Overrides the `default_config` setting. - - - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` - - Permission policy for tool execution. - - - `BetaManagedAgentsAlwaysAllowPolicy object { type }` - - Tool calls are automatically approved without user confirmation. - - - `BetaManagedAgentsAlwaysAskPolicy object { type }` - - Tool calls require user confirmation before execution. - - - `default_config: optional BetaManagedAgentsMCPToolsetDefaultConfigParams or null` - - Default configuration for all tools from an MCP server. - - - `enabled: optional boolean or null` - - Whether tools are enabled by default. Defaults to true if not specified. - - - `permission_policy: optional BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy or null` - - Permission policy for tool execution. - - - `BetaManagedAgentsAlwaysAllowPolicy object { type }` - - Tool calls are automatically approved without user confirmation. - - - `BetaManagedAgentsAlwaysAskPolicy object { type }` - - Tool calls require user confirmation before execution. - - - `BetaManagedAgentsCustomToolParams object { description, input_schema, name, type }` - - A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event. - - - `description: string` - - Description of what the tool does, shown to the agent to help it decide when to use the tool. - - - `input_schema: BetaManagedAgentsCustomToolInputSchema` - - JSON Schema for custom tool input parameters. - - - `type: "object"` - - - `"object"` - - - `properties: optional map[unknown] or null` - - - `required: optional array of string or null` - - - `name: string` - - Unique name for the tool. 1-128 characters; letters, digits, underscores, and hyphens. - - - `type: "custom"` - - - `"custom"` - - - `version: optional number` - - The specific `agent` version to use. Omit to use the latest version. - -- `environment_id: string` - - ID of the `environment` defining the container configuration for this session. - -- `budget: optional BetaManagedAgentsBudgetLimit` - - A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. - - - `max_list_cost: BetaMonetaryAmount` - - A monetary amount in a specific currency. - - - `amount: string` - - Amount in minor units of the currency, as an integer decimal string with no leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a number so no float rounding is ever applied. - - - `currency: BetaCurrency` - - Uppercase ISO-4217 currency code. `USD` is the only currency currently supported; the accepted set is closed and grows only when a new currency is priced. - - - `"USD"` - - - `type: "limit"` - - - `"limit"` - -- `initial_events: optional array of BetaManagedAgentsUserMessageEventParams or BetaManagedAgentsUserDefineOutcomeEventParams` - - Initial events to send to the `session` at creation, processed in order. Supports `user.message` and `user.define_outcome` events. Maximum 50 events. - - - `BetaManagedAgentsUserMessageEventParams object { content, type }` - - Parameters for sending a user message to the session. - - - `content: array of BetaManagedAgentsTextBlock or BetaManagedAgentsImageBlock or BetaManagedAgentsDocumentBlock or BetaManagedAgentsRedactedBlock` - - Array of content blocks for the user message. - - - `BetaManagedAgentsTextBlock object { text, type }` - - Regular text content. - - - `text: string` - - The text content. - - - `type: "text"` - - - `"text"` - - - `BetaManagedAgentsImageBlock object { source, type }` - - Image content specified directly as base64 data or as a reference via a URL. - - - `source: BetaManagedAgentsBase64ImageSource or BetaManagedAgentsURLImageSource or BetaManagedAgentsFileImageSource` - - Union type for image source variants. - - - `BetaManagedAgentsBase64ImageSource object { data, media_type, type }` - - Base64-encoded image data. - - - `data: string` - - Base64-encoded image data. - - - `media_type: string` - - MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp"). - - - `type: "base64"` - - - `"base64"` - - - `BetaManagedAgentsURLImageSource object { type, url }` - - Image referenced by URL. - - - `type: "url"` - - - `"url"` - - - `url: string` - - URL of the image to fetch. - - - `BetaManagedAgentsFileImageSource object { file_id, type }` - - Image referenced by file ID. - - - `file_id: string` - - ID of a previously uploaded file. - - - `type: "file"` - - - `"file"` - - - `type: "image"` - - - `"image"` - - - `BetaManagedAgentsDocumentBlock object { source, type, context, title }` - - Document content, either specified directly as base64 data, as text, or as a reference via a URL. - - - `source: BetaManagedAgentsBase64DocumentSource or BetaManagedAgentsPlainTextDocumentSource or BetaManagedAgentsURLDocumentSource or BetaManagedAgentsFileDocumentSource` - - Union type for document source variants. - - - `BetaManagedAgentsBase64DocumentSource object { data, media_type, type }` - - Base64-encoded document data. - - - `data: string` - - Base64-encoded document data. - - - `media_type: string` - - MIME type of the document (e.g., "application/pdf"). - - - `type: "base64"` - - - `"base64"` - - - `BetaManagedAgentsPlainTextDocumentSource object { data, media_type, type }` - - Plain text document content. - - - `data: string` - - The plain text content. - - - `media_type: "text/plain"` - - MIME type of the text content. Must be "text/plain". - - - `"text/plain"` - - - `type: "text"` - - - `"text"` - - - `BetaManagedAgentsURLDocumentSource object { type, url }` - - Document referenced by URL. - - - `type: "url"` - - - `"url"` - - - `url: string` - - URL of the document to fetch. - - - `BetaManagedAgentsFileDocumentSource object { file_id, type }` - - Document referenced by file ID. - - - `file_id: string` - - ID of a previously uploaded file. - - - `type: "file"` - - - `"file"` - - - `type: "document"` - - - `"document"` - - - `context: optional string or null` - - Additional context about the document for the model. - - - `title: optional string or null` - - The title of the document. - - - `BetaManagedAgentsRedactedBlock object { type }` - - Placeholder for content withheld by Anthropic model policy. - - - `type: "redacted"` - - - `"redacted"` - - - `type: "user.message"` - - - `"user.message"` - - - `BetaManagedAgentsUserDefineOutcomeEventParams object { description, rubric, type, max_iterations }` - - Parameters for defining an outcome the agent should work toward. The agent begins work on receipt. - - - `description: string` - - What the agent should produce. This is the task specification. - - - `rubric: BetaManagedAgentsFileRubricParams or BetaManagedAgentsTextRubricParams` - - Rubric for grading the quality of an outcome. - - - `BetaManagedAgentsFileRubricParams object { file_id, type }` - - Rubric referenced by a file uploaded via the Files API. - - - `file_id: string` - - ID of the rubric file. - - - `type: "file"` - - - `"file"` - - - `BetaManagedAgentsTextRubricParams object { content, type }` - - Rubric content provided inline as text. - - - `content: string` - - Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters. - - - `type: "text"` - - - `"text"` - - - `type: "user.define_outcome"` - - - `"user.define_outcome"` - - - `max_iterations: optional number or null` - - Eval→revision cycles before giving up. Default 3, max 20. - -- `metadata: optional map[string]` - - Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars. - -- `resources: optional array of BetaManagedAgentsGitHubRepositoryResourceParams or BetaManagedAgentsFileResourceParams or BetaManagedAgentsMemoryStoreResourceParam` - - Resources (e.g. repositories, files) to mount into the session's container. - - - `BetaManagedAgentsGitHubRepositoryResourceParams object { authorization_token, type, url, 2 more }` - - Mount a GitHub repository into the session's container. - - - `authorization_token: string` - - GitHub authorization token used to clone the repository. - - - `type: "github_repository"` - - - `"github_repository"` - - - `url: string` - - Github URL of the repository - - - `checkout: optional BetaManagedAgentsBranchCheckout or BetaManagedAgentsCommitCheckout or null` - - Branch or commit to check out. Defaults to the repository's default branch. - - - `BetaManagedAgentsBranchCheckout object { name, type }` - - - `name: string` - - Branch name to check out. - - - `type: "branch"` - - - `"branch"` - - - `BetaManagedAgentsCommitCheckout object { sha, type }` - - - `sha: string` - - Full commit SHA to check out. - - - `type: "commit"` - - - `"commit"` - - - `mount_path: optional string or null` - - Mount path in the container. Defaults to `/workspace/<repo-name>`. - - - `BetaManagedAgentsFileResourceParams object { file_id, type, mount_path }` - - Mount a file uploaded via the Files API into the session. - - - `file_id: string` - - ID of a previously uploaded file. - - - `type: "file"` - - - `"file"` - - - `mount_path: optional string or null` - - Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. - - - `BetaManagedAgentsMemoryStoreResourceParam object { memory_store_id, type, access, instructions }` - - Parameters for attaching a memory store to an agent session. - - - `memory_store_id: string` - - The memory store ID (memstore_...). Must belong to the caller's organization and workspace. - - - `type: "memory_store"` - - - `"memory_store"` - - - `access: optional "read_write" or "read_only" or null` - - Access mode for an attached memory store. - - - `"read_write"` - - - `"read_only"` - - - `instructions: optional string or null` - - Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. - -- `title: optional string or null` - - Human-readable session title. - -- `vault_ids: optional array of string` - - Vault IDs for stored credentials the agent can use during the session. - -### Returns - -- `BetaManagedAgentsSession object { id, agent, archived_at, 14 more }` - - A Managed Agents `session`. - - - `id: string` - - - `agent: BetaManagedAgentsSessionAgent` - - Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. - - - `id: string` - - - `description: string or null` - - - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition` - - - `name: string` - - - `type: "url"` - - - `"url"` - - - `url: string` - - - `model: BetaManagedAgentsModelConfig` - - Model identifier and configuration. - - - `id: BetaManagedAgentsModel` - - The model that will power your agent. - - See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - - - `"claude-sonnet-5" or "claude-fable-5" or "claude-opus-5" or 10 more` - - The model that will power your agent. - - See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. - - - `"claude-sonnet-5"` - - High-performance model for coding and agents - - - `"claude-fable-5"` - - Next generation of intelligence for the hardest knowledge work and coding problems - - - `"claude-opus-5"` - - Powerful intelligence for long-running agents and coding - - - `"claude-opus-4-8"` - - Powerful intelligence for long-running agents and coding - - - `"claude-opus-4-7"` - - Powerful intelligence for long-running agents and coding - - - `"claude-opus-4-6"` - - Powerful intelligence for long-running agents and coding - - - `"claude-sonnet-4-6"` - - Best combination of speed and intelligence - - - `"claude-haiku-4-5"` - - Fastest model with near-frontier intelligence - - - `"claude-haiku-4-5-20251001"` - - Fastest model with near-frontier intelligence - - - `"claude-opus-4-5"` - - Powerful intelligence for long-running agents and coding - - - `"claude-opus-4-5-20251101"` - - Powerful intelligence for long-running agents and coding - - - `"claude-sonnet-4-5"` - - High-performance model for agents and coding - - - `"claude-sonnet-4-5-20250929"` - - High-performance model for agents and coding - - - `string` - - - `effort: optional BetaManagedAgentsEffortLow or BetaManagedAgentsEffortMedium or BetaManagedAgentsEffortHigh or 2 more` - - How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. - - - `BetaManagedAgentsEffortLow object { type }` - - Low effort. Favors latency over reasoning depth. - - - `type: "low"` - - - `"low"` - - - `BetaManagedAgentsEffortMedium object { type }` - - Medium effort. Balances latency and reasoning depth. - - - `type: "medium"` - - - `"medium"` - - - `BetaManagedAgentsEffortHigh object { type }` - - High effort. Favors reasoning depth. - - - `type: "high"` - - - `"high"` - - - `BetaManagedAgentsEffortXhigh object { type }` - - Extra-high effort. Not all models accept this level. - - - `type: "xhigh"` - - - `"xhigh"` - - - `BetaManagedAgentsEffortMax object { type }` - - Maximum effort. Favors reasoning depth over latency. - - - `type: "max"` - - - `"max"` - - - `inference_geo: optional string` - - Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. - - - `speed: optional "standard" or "fast"` - - Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. - - - `"standard"` - - - `"fast"` - - - `multiagent: BetaManagedAgentsSessionMultiagentCoordinator or null` - - Resolved coordinator topology with full agent definitions for each roster member. - - - `agents: array of BetaManagedAgentsSessionThreadAgent or BetaManagedAgentsAdvisor` - - Full `agent` definitions the coordinator may spawn as session threads. - - - `BetaManagedAgentsSessionThreadAgent object { id, description, mcp_servers, 7 more }` - - Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`. - - - `id: string` - - - `description: string or null` - - - `mcp_servers: array of BetaManagedAgentsMCPServerURLDefinition` - - - `name: string` - - - `type: "url"` - - - `url: string` - - - `model: BetaManagedAgentsModelConfig` - - Model identifier and configuration. - - - `name: string` - - `skills: array of BetaManagedAgentsAnthropicSkill or BetaManagedAgentsCustomSkill` - `BetaManagedAgentsAnthropicSkill object { skill_id, type, version }`
from line 1299
- `configs: array of BetaManagedAgentsAgentToolConfig` - - `enabled: boolean` - - - `name: "bash" or "edit" or "read" or 5 more` - - Built-in agent tool identifier. - - - `"bash"` - - - `"edit"` - - - `"read"` - - - `"write"` - - - `"glob"` - - - `"grep"` - - - `"web_fetch"` - - - `"web_search"` - - - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` - - Permission policy for tool execution. - - - `BetaManagedAgentsAlwaysAllowPolicy object { type }` - - Tool calls are automatically approved without user confirmation. - - - `type: "always_allow"` - - - `"always_allow"` - - - `BetaManagedAgentsAlwaysAskPolicy object { type }` - - Tool calls require user confirmation before execution. - - - `type: "always_ask"` - - - `"always_ask"` + - `BetaManagedAgentsBashToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the bash tool. + + - `enabled: boolean` + + - `name: "bash"` + + - `"bash"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `type: "always_allow"` + + - `"always_allow"` + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "always_ask"` + + - `"always_ask"` + + - `type: "bash"` + + - `"bash"` + + - `BetaManagedAgentsEditToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the edit tool. + + - `enabled: boolean` + + - `name: "edit"` + + - `"edit"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "edit"` + + - `"edit"` + + - `BetaManagedAgentsReadToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the read tool. + + - `enabled: boolean` + + - `name: "read"` + + - `"read"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "read"` + + - `"read"` + + - `BetaManagedAgentsWriteToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the write tool. + + - `enabled: boolean` + + - `name: "write"` + + - `"write"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "write"` + + - `"write"` + + - `BetaManagedAgentsGlobToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the glob tool. + + - `enabled: boolean` + + - `name: "glob"` + + - `"glob"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "glob"` + + - `"glob"` + + - `BetaManagedAgentsGrepToolConfig object { enabled, name, permission_policy, type }` + + Configuration for the grep tool. + + - `enabled: boolean` + + - `name: "grep"` + + - `"grep"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "grep"` + + - `"grep"` + + - `BetaManagedAgentsWebFetchToolConfig object { enabled, name, permission_policy, 4 more }` + + Configuration for the web_fetch tool. + + - `enabled: boolean` + + - `name: "web_fetch"` + + - `"web_fetch"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "web_fetch"` + + - `"web_fetch"` + + - `allowed_domains: optional array of string` + + - `blocked_domains: optional array of string` + + - `max_content_tokens: optional number or null` + + - `BetaManagedAgentsWebSearchToolConfig object { enabled, name, permission_policy, 4 more }` + + Configuration for the web_search tool. + + - `enabled: boolean` + + - `name: "web_search"` + + - `"web_search"` + + - `permission_policy: BetaManagedAgentsAlwaysAllowPolicy or BetaManagedAgentsAlwaysAskPolicy` + + Permission policy for tool execution. + + - `BetaManagedAgentsAlwaysAllowPolicy object { type }` + + Tool calls are automatically approved without user confirmation. + + - `BetaManagedAgentsAlwaysAskPolicy object { type }` + + Tool calls require user confirmation before execution. + + - `type: "web_search"` + + - `"web_search"` + + - `allowed_domains: optional array of string` + + - `blocked_domains: optional array of string` + + - `user_location: optional BetaManagedAgentsUserLocation or null` + + Approximate user location for search result localization. + + - `type: "approximate"` + + Location precision. Only "approximate" is supported. + + - `"approximate"` + + - `city: optional string or null` + + City name. + + - `country: optional string or null` + + Two-letter ISO 3166-1 country code, uppercase. + + - `region: optional string or null` + + Region or state name. + + - `timezone: optional string or null` + + IANA timezone identifier, e.g. "America/Los_Angeles". - `default_config: BetaManagedAgentsAgentToolsetDefaultConfig`
from line 2024
"name": "bash", "permission_policy": { "type": "always_allow" - } + }, + "type": "bash" } ], "default_config": {
from line 2065
"name": "bash", "permission_policy": { "type": "always_allow" - } + }, + "type": "bash" } ], "default_config": {