Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/ref/extensions/sandbox/aliyun/sandbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `Sandbox`

::: agents.extensions.sandbox.aliyun.sandbox
3 changes: 3 additions & 0 deletions docs/sandbox/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ For provider-specific setup notes and links for the checked-in extension example

| Client | Install | Example |
| --- | --- | --- |
| `AliyunSandboxClient` | `openai-agents[aliyun]` | [Aliyun runner](https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/extensions/aliyun_runner.py) |
| `BlaxelSandboxClient` | `openai-agents[blaxel]` | [Blaxel runner](https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/extensions/blaxel_runner.py) |
| `CloudflareSandboxClient` | `openai-agents[cloudflare]` | [Cloudflare runner](https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/extensions/cloudflare_runner.py) |
| `DaytonaSandboxClient` | `openai-agents[daytona]` | [Daytona runner](https://github.com/openai/openai-agents-python/blob/main/examples/sandbox/extensions/daytona/daytona_runner.py) |
Expand All @@ -114,6 +115,7 @@ Hosted sandbox clients expose provider-specific mount strategies. Choose the bac
| `E2BSandboxClient` | Supports rclone-backed cloud storage mounts with `E2BCloudBucketMountStrategy`; use it with `S3Mount`, `GCSMount`, `R2Mount`, `AzureBlobMount`, and `BoxMount`. |
| `RunloopSandboxClient` | Supports rclone-backed cloud storage mounts with `RunloopCloudBucketMountStrategy`; use it with `S3Mount`, `GCSMount`, `R2Mount`, `AzureBlobMount`, and `BoxMount`. |
| `VercelSandboxClient` | No hosted-specific mount strategy is currently exposed. Use manifest files, repos, or other workspace inputs instead. |
| `AliyunSandboxClient` | No hosted-specific mount strategy is currently exposed. AgentRun also does not expose tunneled ports. Use manifest files or workspace inputs instead. |

</div>

Expand All @@ -131,6 +133,7 @@ The table below summarizes which remote storage entries each backend can mount d
| `E2BSandboxClient` | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| `RunloopSandboxClient` | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| `VercelSandboxClient` | - | - | - | - | - | - |
| `AliyunSandboxClient` | - | - | - | - | - | - |

</div>

Expand Down
49 changes: 48 additions & 1 deletion examples/sandbox/extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ They intentionally keep the flow simple:

1. Build a tiny manifest in memory.
2. Create a `SandboxAgent` that inspects that workspace through one shell tool.
3. Run the agent against E2B, Modal, Daytona, Cloudflare, Runloop, Blaxel, or Vercel.
3. Run the agent against E2B, Modal, Daytona, Cloudflare, Runloop, Blaxel, Vercel, or Aliyun.

All of these examples require `OPENAI_API_KEY`, because they call the model through the normal
`Runner` path. Each cloud backend also needs its own provider credentials.
Expand Down Expand Up @@ -376,3 +376,50 @@ Blaxel sandboxes support cloud bucket mounts (S3, R2, GCS) through
`BlaxelCloudBucketMountStrategy` and persistent drive mounts through
`BlaxelDriveMountStrategy`. See the
[Blaxel Drive docs](https://docs.blaxel.ai/Agent-drive/Overview) for details.

## Aliyun

### Setup

Install the repo extra:

```bash
uv sync --extra aliyun
```

Create an Alibaba Cloud account, enable AgentRun, and obtain access credentials.
The official references are:

- <https://www.alibabacloud.com/help/en/agentrun>
- <https://help.aliyun.com/document_detail/2839106.html>

Export the required environment variables:

```bash
export OPENAI_API_KEY=...
export ALIBABA_CLOUD_ACCESS_KEY_ID=...
export ALIBABA_CLOUD_ACCESS_KEY_SECRET=...
```

`agentrun-sdk` resolves credentials through the standard Alibaba Cloud
credential providers, so any of the supported credential sources (env vars,
config file, RAM role) will work. You can also pass credentials explicitly via
CLI flags below.

### Run

```bash
uv run python examples/sandbox/extensions/aliyun_runner.py --stream
```

Useful flags:

- `--region cn-hangzhou` -- AgentRun region. Default `cn-hangzhou`.
- `--template-name code-interpreter` -- AgentRun template to launch.
- `--sandbox-idle-timeout-seconds 3600` -- Idle timeout before the remote sandbox is reclaimed.
- `--access-key-id` / `--access-key-secret` / `--account-id` / `--api-key` -- override credentials per run.
- `--stream` -- stream model output to the terminal.

The Aliyun example stays on the non-PTY path. It covers command execution,
workspace materialization, and stop/resume persistence. AgentRun does not
currently expose tunneled ports or hosted-specific mount strategies.
Loading