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

# Read File • AI Agent SDK

> read_file: Read a file from the sandbox.

# read\_file

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

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

Read a file from the sandbox.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def read_file(path: str) -> Optional[Union[str, bytes]]
```

## Parameters

<ParamField query="path" type="str" required={true}>
  Path within sandbox
</ParamField>

### Returns

<ResponseField name="Returns" type="Optional[Union[str, bytes]]">
  File content or None if not found
</ResponseField>

## Source

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