Skip to main content

write_confirmation_required

Function write_confirmation_required 

Source
pub fn write_confirmation_required(
    request_id: &str,
    tool_id: &str,
    action_description: &str,
) -> Value
Expand description

write_confirmation_required — emitted mid-turn when the agent calls a state-mutating tool that requires explicit human approval before it runs. The turn is parked (the agent loop blocks inside the core ConfirmationHook::pre_call, corresponding to AgentEvent::HumanInputRequired { Confirm }) until the client replies with a confirm_tool_action action carrying the same requestId and an approved boolean.

Wire shape matches spec/events/write-confirmation-required.schema.json exactly (the generated TS/Go/.NET/Python clients deserialize it unmodified): the requestId echoes the originating send_message, and the prompt detail is double-nested under data.data.{ toolId, actionDescription }. tool_id is an opaque correlation handle (the runner uses the tool name — a turn parks one tool at a time); action_description is the human-readable prompt the client renders in its confirmation dialog.