> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orxhestra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Confirmation

> Gate dangerous tool executions with CallContext.request_confirmation(). Pause and require approval before delete, drop, or other risky operations.

Gate dangerous tool executions with `CallContext.request_confirmation()`:

```python theme={null}
from orxhestra.tools import CallContext

async def confirm_dangerous(ctx, tool_name: str, tool_args: dict) -> None:
    if tool_name in ("delete_file", "drop_table"):
        call_ctx = CallContext(ctx)
        call_ctx.request_confirmation()
```

When `request_confirmation()` is called from a `before_tool_callback`, the tool execution is paused and a confirmation request event is yielded. The caller must approve or reject before execution continues.

```python theme={null}
agent = LlmAgent(
    name="SafeAgent",
    model=model,
    tools=[delete_file, drop_table, search],
    before_tool_callback=confirm_dangerous,
)
```
