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

# Safe Run • AI Agent SDK

> safe_run: Execute tool with error handling, returning ToolResult.

# safe\_run

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**BaseTool**](../classes/BaseTool) class in the [**base**](../modules/base) module.

Execute tool with error handling, returning ToolResult.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def safe_run() -> ToolResult
```

### Returns

<ResponseField name="Returns" type="ToolResult">
  The result of the operation.
</ResponseField>

## Uses

* `run`
* `ToolResult`
* `logging.error`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/tools/base.py#L296">
  `praisonaiagents/tools/base.py` at line 296
</Card>
