Claude Platform Docs

Events

List Events
beta.sessions.events.list(strsession_id, EventListParams**kwargs) -> SyncPageCursor[BetaManagedAgentsSessionEvent]
GET/v1/sessions/{session_id}/events
Send Events
beta.sessions.events.send(strsession_id, EventSendParams**kwargs) -> BetaManagedAgentsSendSessionEvents
POST/v1/sessions/{session_id}/events
Stream Events
beta.sessions.events.stream(strsession_id, EventStreamParams**kwargs) -> BetaManagedAgentsStreamSessionEvents
GET/v1/sessions/{session_id}/events/stream
Models
class BetaManagedAgentsAgentCustomToolUseEvent:

Event emitted when the agent calls a custom tool. The session goes idle until the client sends a user.custom_tool_result event with the result.

id: str

Unique identifier for this event.

input: Dict[str, object]

Input parameters for the tool call.

name: str

Name of the custom tool being called.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.custom_tool_use"]
session_thread_id: Optional[str]

When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Echo this on a user.custom_tool_result event to route the result back.

class BetaManagedAgentsAgentMCPToolResultEvent:

Event representing the result of an MCP tool execution.

class BetaManagedAgentsAgentMCPToolUseEvent:

Event emitted when the agent invokes a tool provided by an MCP server.

id: str

Unique identifier for this event.

input: Dict[str, object]

Input parameters for the tool call.

mcp_server_name: str

Name of the MCP server providing the tool.

name: str

Name of the MCP tool being used.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.mcp_tool_use"]
evaluated_permission: Optional[Literal["allow", "ask", "deny"]]

AgentEvaluatedPermission enum

One of the following:
"allow"
"ask"
"deny"
session_thread_id: Optional[str]

When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a user.tool_confirmation event to route the approval back.

class BetaManagedAgentsAgentMessageEvent:

An agent response event in the session conversation.

id: str

Unique identifier for this event.

content: List[Content]

Array of text blocks comprising the agent response.

One of the following:
class BetaManagedAgentsTextBlock:

Regular text content.

text: str

The text content.

minLength1
type: Literal["text"]
class BetaManagedAgentsRedactedBlock:

Placeholder for content withheld by Anthropic model policy.

type: Literal["redacted"]
processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.message"]
class BetaManagedAgentsAgentThinkingEvent:

Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.thinking"]
class BetaManagedAgentsAgentThreadContextCompactedEvent:

Indicates that context compaction (summarization) occurred during the session.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.thread_context_compacted"]
class BetaManagedAgentsAgentThreadMessageReceivedEvent:

Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

class BetaManagedAgentsAgentThreadMessageSentEvent:

Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

class BetaManagedAgentsAgentToolResultEvent:

Event representing the result of an agent tool execution.

class BetaManagedAgentsAgentToolUseEvent:

Event emitted when the agent invokes a built-in agent tool.

id: str

Unique identifier for this event.

input: Dict[str, object]

Input parameters for the tool call.

name: str

Name of the agent tool being used.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["agent.tool_use"]
evaluated_permission: Optional[Literal["allow", "ask", "deny"]]

AgentEvaluatedPermission enum

One of the following:
"allow"
"ask"
"deny"
session_thread_id: Optional[str]

When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Echo this on a user.tool_confirmation event to route the approval back.

class BetaManagedAgentsBase64DocumentSource:

Base64-encoded document data.

data: str

Base64-encoded document data.

minLength1
media_type: str

MIME type of the document (e.g., "application/pdf").

minLength1
type: Literal["base64"]
class BetaManagedAgentsBase64ImageSource:

Base64-encoded image data.

data: str

Base64-encoded image data.

minLength1
media_type: str

MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

minLength1
type: Literal["base64"]
class BetaManagedAgentsBillingError:

The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["billing_error"]
class BetaManagedAgentsCredentialHostUnreachableError:

An environment_variable credential's auth.networking.allowed_hosts includes a host the environment's network policy does not permit.

class BetaManagedAgentsDocumentBlock:

Document content, either specified directly as base64 data, as text, or as a reference via a URL.

Union type for event parameters that can be sent to a session.

One of the following:
class BetaManagedAgentsFileDocumentSource:

Document referenced by file ID.

file_id: str

ID of a previously uploaded file.

minLength1
type: Literal["file"]
class BetaManagedAgentsFileImageSource:

Image referenced by file ID.

file_id: str

ID of a previously uploaded file.

minLength1
type: Literal["file"]
class BetaManagedAgentsFileRubric:

Rubric referenced by a file uploaded via the Files API.

file_id: str

ID of the rubric file.

type: Literal["file"]
class BetaManagedAgentsFileRubricParams:

Rubric referenced by a file uploaded via the Files API.

file_id: str

ID of the rubric file.

type: Literal["file"]
class BetaManagedAgentsImageBlock:

Image content specified directly as base64 data or as a reference via a URL.

class BetaManagedAgentsMCPAuthenticationFailedError:

Authentication to an MCP server failed.

mcp_server_name: str

Name of the MCP server that failed authentication.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["mcp_authentication_failed_error"]
class BetaManagedAgentsMCPConnectionFailedError:

Failed to connect to an MCP server.

mcp_server_name: str

Name of the MCP server that failed to connect.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["mcp_connection_failed_error"]
class BetaManagedAgentsModelOverloadedError:

The model is currently overloaded. Emitted after automatic retries are exhausted.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["model_overloaded_error"]
class BetaManagedAgentsModelRateLimitedError:

The model request was rate-limited.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["model_rate_limited_error"]
class BetaManagedAgentsModelRequestFailedError:

A model request failed for a reason other than overload or rate-limiting.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["model_request_failed_error"]
class BetaManagedAgentsPlainTextDocumentSource:

Plain text document content.

data: str

The plain text content.

minLength1
media_type: Literal["text/plain"]

MIME type of the text content. Must be "text/plain".

type: Literal["text"]
class BetaManagedAgentsRedactedBlock:

Placeholder for content withheld by Anthropic model policy.

type: Literal["redacted"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
class BetaManagedAgentsSearchResultBlock:

A block containing a web search result.

Citation settings for a search result.

enabled: bool

Whether citations are enabled for this search result.

Array of text content blocks from the search result.

text: str

The text content.

minLength1
type: Literal["text"]
source: str

The URL source of the search result.

minLength1
title: str

The title of the search result.

minLength1
type: Literal["search_result"]
class BetaManagedAgentsSearchResultCitations:

Citation settings for a search result.

enabled: bool

Whether citations are enabled for this search result.

class BetaManagedAgentsSearchResultContent:

Text content within a search result.

text: str

The text content.

minLength1
type: Literal["text"]
class BetaManagedAgentsSendSessionEvents:

Events that were successfully sent to the session.

class BetaManagedAgentsSessionBudgetReached:

The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

type: Literal["budget_reached"]
class BetaManagedAgentsSessionDeletedEvent:

Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["session.deleted"]
class BetaManagedAgentsSessionEndTurn:

The agent completed its turn naturally and is ready for the next user message.

type: Literal["end_turn"]
class BetaManagedAgentsSessionErrorEvent:

An error event indicating a problem occurred during session execution.

Union type for all event types in a session.

One of the following:
class BetaManagedAgentsSessionRequiresAction:

The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

event_ids: List[str]

The ids of events the agent is blocked on. Resolving fewer than all re-emits session.status_idle with the remainder.

type: Literal["requires_action"]
class BetaManagedAgentsSessionRetriesExhausted:

The turn ended because repeated errors exhausted the retry budget or an error escalated to retry_status: 'exhausted'.

type: Literal["retries_exhausted"]
class BetaManagedAgentsSessionStatusIdleEvent:

Indicates the agent has paused and is awaiting user input.

class BetaManagedAgentsSessionStatusRescheduledEvent:

Indicates the session is recovering from an error state and is rescheduled for execution.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["session.status_rescheduled"]
class BetaManagedAgentsSessionStatusRunningEvent:

Indicates the session is actively running and the agent is working.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["session.status_running"]
class BetaManagedAgentsSessionStatusTerminatedEvent:

Indicates the session has terminated, either due to an error or completion.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["session.status_terminated"]
class BetaManagedAgentsSessionThreadCreatedEvent:

Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.

id: str

Unique identifier for this event.

agent_name: str

Name of the callable agent the thread runs.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: str

Public sthr_ ID of the newly created thread.

type: Literal["session.thread_created"]
class BetaManagedAgentsSessionThreadStatusIdleEvent:

A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

class BetaManagedAgentsSessionThreadStatusRescheduledEvent:

A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

id: str

Unique identifier for this event.

agent_name: str

Name of the agent the thread runs.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: str

Public sthr_ ID of the thread that is retrying.

type: Literal["session.thread_status_rescheduled"]
class BetaManagedAgentsSessionThreadStatusRunningEvent:

A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

id: str

Unique identifier for this event.

agent_name: str

Name of the agent the thread runs.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: str

Public sthr_ ID of the thread that started running.

type: Literal["session.thread_status_running"]
class BetaManagedAgentsSessionThreadStatusTerminatedEvent:

A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

id: str

Unique identifier for this event.

agent_name: str

Name of the agent the thread runs.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: str

Public sthr_ ID of the thread that terminated.

type: Literal["session.thread_status_terminated"]
class BetaManagedAgentsSessionUsageSnapshot:

Point-in-time snapshot of a session's cumulative usage.

class BetaManagedAgentsSpanModelRequestEndEvent:

Emitted when a model request completes.

class BetaManagedAgentsSpanModelRequestStartEvent:

Emitted when a model request is initiated by the agent.

id: str

Unique identifier for this event.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["span.model_request_start"]
class BetaManagedAgentsSpanModelUsage:

Token usage for a single model request.

cache_creation_input_tokens: int

Tokens used to create prompt cache in this request.

formatint32
cache_read_input_tokens: int

Tokens read from prompt cache in this request.

formatint32
input_tokens: int

Input tokens consumed by this request.

formatint32
output_tokens: int

Output tokens generated by this request.

formatint32
speed: Optional[Literal["standard", "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.

One of the following:
"standard"
"fast"
class BetaManagedAgentsSpanOutcomeEvaluationEndEvent:

Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of needs_revision means another evaluation cycle follows; satisfied, max_iterations_reached, failed, or interrupted are terminal — no further evaluation cycles follow.

class BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent:

Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding span.outcome_evaluation_start and span.outcome_evaluation_end events.

id: str

Unique identifier for this event.

iteration: int

0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.

formatint32
outcome_id: str

The outc_ ID of the outcome being evaluated.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["span.outcome_evaluation_ongoing"]
class BetaManagedAgentsSpanOutcomeEvaluationStartEvent:

Emitted when an outcome evaluation cycle begins.

id: str

Unique identifier for this event.

iteration: int

0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

formatint32
outcome_id: str

The outc_ ID of the outcome being evaluated.

processed_at: datetime

A timestamp in RFC 3339 format

formatdate-time
type: Literal["span.outcome_evaluation_start"]

Server-sent event in the session stream.

One of the following:
class BetaManagedAgentsSystemMessageEventParams:

Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a role: "system" turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the user.message, user.tool_result, or user.custom_tool_result it accompanies. Only supported on models that accept mid-conversation system messages.

System content blocks to append. Text-only.

text: str

The text content.

minLength1
type: Literal["text"]
type: Literal["system.message"]
class BetaManagedAgentsTextBlock:

Regular text content.

text: str

The text content.

minLength1
type: Literal["text"]
class BetaManagedAgentsTextRubric:

Rubric content provided inline as text.

content: str

Rubric content. Plain text or markdown — the grader treats it as freeform text.

type: Literal["text"]
class BetaManagedAgentsTextRubricParams:

Rubric content provided inline as text.

content: str

Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

maxLength262144
type: Literal["text"]
class BetaManagedAgentsUnknownError:

An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on retry_status and message alone.

message: str

Human-readable error description.

retry_status: RetryStatus

What the client should do next in response to this error.

One of the following:
class BetaManagedAgentsRetryStatusRetrying:

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

type: Literal["retrying"]
class BetaManagedAgentsRetryStatusExhausted:

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

type: Literal["exhausted"]
class BetaManagedAgentsRetryStatusTerminal:

The session encountered a terminal error and will transition to terminated state.

type: Literal["terminal"]
type: Literal["unknown_error"]
class BetaManagedAgentsURLDocumentSource:

Document referenced by URL.

type: Literal["url"]
url: str

URL of the document to fetch.

minLength1
class BetaManagedAgentsURLImageSource:

Image referenced by URL.

type: Literal["url"]
url: str

URL of the image to fetch.

minLength1
class BetaManagedAgentsUserCustomToolResultEvent:

Event sent by the client providing the result of a custom tool execution.

class BetaManagedAgentsUserCustomToolResultEventParams:

Parameters for providing the result of a custom tool execution.

class BetaManagedAgentsUserDefineOutcomeEvent:

Echo of a user.define_outcome input event. Carries the server-generated outcome_id that subsequent span.outcome_evaluation_* events reference.

class BetaManagedAgentsUserDefineOutcomeEventParams:

Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

description: str

What the agent should produce. This is the task specification.

rubric: Rubric

Rubric for grading the quality of an outcome.

One of the following:
class BetaManagedAgentsFileRubricParams:

Rubric referenced by a file uploaded via the Files API.

file_id: str

ID of the rubric file.

type: Literal["file"]
class BetaManagedAgentsTextRubricParams:

Rubric content provided inline as text.

content: str

Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

maxLength262144
type: Literal["text"]
type: Literal["user.define_outcome"]
max_iterations: Optional[int]

Eval→revision cycles before giving up. Default 3, max 20.

formatint32
class BetaManagedAgentsUserInterruptEvent:

An interrupt event that pauses agent execution and returns control to the user.

id: str

Unique identifier for this event.

type: Literal["user.interrupt"]
processed_at: Optional[datetime]

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: Optional[str]

If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

class BetaManagedAgentsUserInterruptEventParams:

Parameters for sending an interrupt to pause the agent.

type: Literal["user.interrupt"]
session_thread_id: Optional[str]

If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

class BetaManagedAgentsUserMessageEvent:

A user message event in the session conversation.

class BetaManagedAgentsUserMessageEventParams:

Parameters for sending a user message to the session.

content: Iterable[Content]

Array of content blocks for the user message.

One of the following:
class BetaManagedAgentsTextBlock:

Regular text content.

text: str

The text content.

minLength1
type: Literal["text"]
class BetaManagedAgentsImageBlock:

Image content specified directly as base64 data or as a reference via a URL.

class BetaManagedAgentsDocumentBlock:

Document content, either specified directly as base64 data, as text, or as a reference via a URL.

class BetaManagedAgentsRedactedBlock:

Placeholder for content withheld by Anthropic model policy.

type: Literal["redacted"]
type: Literal["user.message"]
class BetaManagedAgentsUserToolConfirmationEvent:

A tool confirmation event that approves or denies a pending tool execution.

id: str

Unique identifier for this event.

result: Literal["allow", "deny"]

UserToolConfirmationResult enum

One of the following:
"allow"
"deny"
tool_use_id: str

The id of the agent.tool_use or agent.mcp_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.

type: Literal["user.tool_confirmation"]
deny_message: Optional[str]

Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

maxLength10000
processed_at: Optional[datetime]

A timestamp in RFC 3339 format

formatdate-time
session_thread_id: Optional[str]

When set, the confirmation routes to this subagent's thread rather than the primary. Echo this from the session_thread_id on the agent.tool_use or agent.mcp_tool_use event that prompted the approval.

class BetaManagedAgentsUserToolConfirmationEventParams:

Parameters for confirming or denying a tool execution request.

result: Literal["allow", "deny"]

UserToolConfirmationResult enum

One of the following:
"allow"
"deny"
tool_use_id: str

The id of the agent.tool_use or agent.mcp_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.

minLength1
maxLength128
type: Literal["user.tool_confirmation"]
deny_message: Optional[str]

Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

maxLength10000
class BetaManagedAgentsUserToolResultEventParams:

Parameters for providing the result of an agent-toolset tool execution. Only valid on self_hosted environments, where sandbox-routed tools are executed by the client rather than the server.