Running Agents
Therun_agent function executes agents in isolated Docker containers.
Basic Usage
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
image | str | Yes | Docker image URI |
config | dict | Yes | Agent configuration |
secrets | dict[str, str] | Yes | Secrets as env vars |
instruction | str | Yes | Task instruction |
workspace | str | Yes | Mounted workspace path |
logs_dir | str | None | No | Logs directory |
pull | bool | No | Pull image first (default: True) |
Volume Mounts
| Container Path | Host Path | Description |
|---|---|---|
/workspace | workspace param | Agent working directory |
/logs | logs_dir param | Logs and trajectory output |
/config.json | (temp file) | Agent configuration |
Secret Injection
Secrets become environment variables:Example: From a World
Example: Standalone
Error Handling
Trajectory Output
Agents write trajectories to/logs/agent/trajectory.json: