> ## 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.

# run • AI Agent SDK

> run: Execute agent silently and return structured result.

# run

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

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

Execute agent silently and return structured result.

Production-friendly execution. Always uses silent mode with no streaming
or verbose display, regardless of TTY status. Use this for programmatic,
scripted, or automated usage where you want just the result.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def run(prompt: str) -> Any
```

## Parameters

<ParamField query="prompt" type="str" required={true}>
  The input prompt to process \*\*kwargs: Additional arguments: - stream (bool): Force streaming if True. Default: False - output (str): Output preset override (rarely needed)
</ParamField>

### Returns

<ResponseField name="Returns" type="Any">
  The agent's response as a string
</ResponseField>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
agent = Agent(instructions="You are helpful")
    result = agent.run("What is 2+2?")  # Silent, returns "4"
    print(result)
```

## Uses

* `substitute_variables`
* `chat`

## Notes

Unlike .start() which enables verbose output in TTY for interactive
use, .run() is always silent. This makes it suitable for:

* Production pipelines
* Automated scripts
* Background processing
* API endpoints

## Used By

* [`Agent.run_until`](../functions/Agent-run_until)
* [`require_approval`](../functions/require_approval)
* [`HookRunner.execute_sync`](../functions/HookRunner-execute_sync)
* [`MCPToolRunner.run`](../functions/MCPToolRunner-run)
* [`Task.execute_callback_sync`](../functions/Task-execute_callback_sync)

## Source

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