You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 719aa76
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ the server only ships `easy_sandbox/server/`) and are **released in lockstep** w
36
36
-**Declarative decorator** — `@sandbox` turns a plain function into a remote sandbox execution with automatic serialisation.
37
37
-**Session persistence** — save and restore sandbox state across runs.
38
38
-**E2B compatibility layer** — drop-in replacement for projects already using the E2B SDK.
39
-
-**Agents API** — in-sandbox HTTP sessions for Codex and Qwen Code only. Install a CLI when you call it; the base image does not carry both. Guide and complete case: [Agents API](docs/en/guide/agents-api.md).
39
+
-**Agents API** — in-sandbox HTTP sessions. Codex and Qwen Code are supported today. Install a CLI when you call it; the base image does not carry both. Guide and complete case: [Agents API](docs/en/guide/agents-api.md).
Copy file name to clipboardExpand all lines: docs/en/design/built-in-agents.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# Built-in Agent High-Level API Design
2
2
3
-
> Easy Sandbox built-in agents adopt a minimalist architecture: AI CLI tools (Codex, etc.) are pre-installed in sandbox templates, and the SDK Agent API is simply syntactic sugar wrapping `commands.run()`. The SDK has zero LLM dependencies, keeping it lightweight.
3
+
> This is the design for `sb.agent.*`, which is sugar over `commands.run()`. It is not the HTTP Agents API.
4
+
> The Agents API (`/v1/agents/sessions`; Codex and Qwen Code are supported today) is [Agents API](../guide/agents-api.md). The base image does not preinstall those CLIs. Install the one you call. See the [`agents-cli`](../../examples/templates/agents-cli/README.md) template.
5
+
6
+
> The rest of this page still describes an earlier idea that baked Codex into a template. The product does not put Codex and Qwen Code into the base image together.
Copy file name to clipboardExpand all lines: docs/en/guide/agents-api.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Agents API
2
2
3
-
HTTP sessions inside the sandbox. This slice hosts **Codex** and **Qwen Code** only. The base image does not install either CLI. Install the one you are about to call.
3
+
HTTP sessions inside the sandbox. Codex and Qwen Code are supported today. The base image does not install either CLI. Install the one you are about to call.
4
4
5
5
This is not the [built-in agent design](../design/built-in-agents.md). That page is `sb.agent.*`, sugar over `commands.run()`. The Agents API is a different set of routes: `/v1/agents/sessions`.
Codex reads `OPENAI_API_KEY` or `CODEX_API_KEY` when it actually calls a model. Qwen Code reads `OPENAI_API_KEY`. Inject the key when the sandbox is created. Do not bake it into the image, and do not put it in the case below.
19
19
20
-
The [agents-cli](https://github.com/Easy-Sandbox/awesome-templates/tree/main/agents-cli) template only turns the `agents`group on. Its Dockerfile leaves the one `npm install` line for you to add.
20
+
The [agents-cli](https://github.com/Easy-Sandbox/awesome-templates/tree/main/agents-cli) template does not turn on `file_ops` or `process`. `groups.agents: true` is only the gate. `endpoints` sets `*` to `enabled: false`, then turns on `agents_sessions_create`, `agents_sessions_events_create`, `agents_sessions_items_list`, and `agents_runtimes_list` one by one. `POST /shell` and `POST /v1/agents`(definitions) stay 404. The Dockerfile leaves the one `npm install` line for the CLI you call.
21
21
22
22
## Not the built-in agent API
23
23
@@ -30,13 +30,13 @@ The [agents-cli](https://github.com/Easy-Sandbox/awesome-templates/tree/main/age
30
30
31
31
## Complete case
32
32
33
-
The case starts a local server and puts two stand-in programs named `codex` and `qwen` on `PATH`. It does not read a model key. The stand-ins prove the HTTP session. After the `npm install` lines above, the same requests run the real CLIs.
33
+
The case starts a local server and places programs named `codex` and `qwen` on `PATH` so the requests and responses can be shown without a model key. After the `npm install` lines above, the same requests run the real CLIs.
34
34
35
35
```bash
36
36
python examples/agents/complete_case.py
37
37
```
38
38
39
-
Ran locally on 2026-10-13, exit code 0. The transcript below keeps the stable parts. Session ids change every run.
39
+
The shapes below are what the server returns. The server assigns the session id.
40
40
41
41
A model id such as `gpt-5` does not select a CLI:
42
42
@@ -46,7 +46,7 @@ X-Easy-Sandbox-Local: 1
46
46
code: agents.adapter_required
47
47
```
48
48
49
-
`claude-code`is outside this slice:
49
+
An adapter name that is not supported today, for example `claude-code`:
message: adapter 'claude-code' is not available in this slice (codex, qwen-code)
57
57
```
58
58
59
-
`GET /v1/agents/runtimes`lists only`codex` and `qwen-code`, each with `install_steps` (`npm install -g ...`). `installed` is whether that binary is on this process's `PATH` right now.
59
+
`GET /v1/agents/runtimes`currently returns`codex` and `qwen-code`, each with `install_steps` (`npm install -g ...`). `installed` is whether that binary is on this process's `PATH`.
> **⚠️ Experimental Feature**: The AK/SK → API Key token exchange framework is implemented in the SDK (`transport/auth.py`), but the token exchange endpoint’s action name (`CreateApiKey`) and response field parsing **are still pending FC platform team confirmation**. TTL (3600s) and early refresh time (300s) are assumed values, not validated against a real endpoint. This feature can be used for local debugging; **API Key authentication is still recommended for production environments**.
80
+
> **⚠️ Experimental Feature**: The AK/SK → API Key token exchange framework is implemented in the SDK (`transport/auth.py`), but the token exchange endpoint’s action name (`CreateApiKey`) and response field parsing **are still pending FC platform team confirmation**. TTL (3600s) and the 300s early refresh are placeholders until the platform confirms the endpoint. Use it for local debugging; **API Key authentication is still recommended for production**.
81
81
82
82
AK/SK mode uses an Alibaba Cloud AccessKey pair to obtain a temporary API Key via token exchange (designed TTL 3600 seconds, auto-refreshed 300 seconds before expiry).
Copy file name to clipboardExpand all lines: docs/en/guide/best-practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Or set `server.groups` in the template policy (`process: false`, and so on). `co
26
26
27
27
The Agents routes stay off until the process is started with `EBX_SERVER_ENABLED_GROUPS=agents` (or `enable_group(CapabilityGroup.AGENTS)` before `serve()`). With the group off, those paths answer 404 and the body says the route is disabled.
28
28
29
-
This slice hosts Codex and Qwen Code only. Checklist, the local header, and the 404s: [Hosted agents — Best practices](hosted-agents.md#best-practices).
29
+
Codex and Qwen Code are supported today. Checklist, the local header, and the 404s: [Hosted agents — Best practices](hosted-agents.md#best-practices).
Copy file name to clipboardExpand all lines: docs/en/guide/getting-started.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,7 +171,7 @@ asyncio.run(main())
171
171
172
172
---
173
173
174
-
The sandbox server can also host coding-agent CLIs. This slice is Codex (`codex`, npm package `@openai/codex`) and Qwen Code (`qwen`, npm package `@qwen-code/qwen-code`) only, on `/v1/agents/sessions`, and only after `EBX_SERVER_ENABLED_GROUPS` includes `agents`. See [Hosted agents](hosted-agents.md).
174
+
The sandbox server can also host coding-agent CLIs. Codex (`codex`, npm package `@openai/codex`) and Qwen Code (`qwen`, npm package `@qwen-code/qwen-code`) are supported today, on `/v1/agents/sessions`, after `EBX_SERVER_ENABLED_GROUPS` includes `agents`. See [Hosted agents](hosted-agents.md).
Copy file name to clipboardExpand all lines: docs/en/guide/hosted-agents.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The user guide and the runnable case are in [Agents API](agents-api.md). This page is the route reference.
4
4
5
-
This slice hosts **Codex** and **Qwen Code** only. Claude Code, Cursor, Qoder and the generic command adapter are not served here. Naming any other adapter returns HTTP 404 `not_found_error` with `x-should-retry: false`.
5
+
Codex and Qwen Code are supported today. Adapter names that are not supported yet, including Claude Code, Cursor, Qoder, and the generic command adapter, return HTTP 404 `not_found_error` with `x-should-retry: false`.
6
6
7
7
The routes live on the sandbox server (`easy_sandbox.server`), in the opt-in `agents` capability group. They stay **off** until `EBX_SERVER_ENABLED_GROUPS` includes `agents`. With the group disabled, the same paths answer 404 and the body says the route is disabled.
8
8
@@ -15,7 +15,7 @@ The template server listens on **port 9000**. Point an OpenAI-shaped client at `
15
15
16
16
## Best practices
17
17
18
-
*Host **Codex** and **Qwen Code** only. A body that names Claude Code, Cursor, Qoder, or any other adapter is HTTP 404 `not_found_error` with `x-should-retry: false`.
18
+
* Codex and Qwen Code are supported today. A body that names an adapter that is not supported yet is HTTP 404 `not_found_error` with `x-should-retry: false`.
19
19
* Treat every response as local. Read the header `X-Easy-Sandbox-Local: 1` (errors included). `x_easy_sandbox.compute` is `local_process`, `local_state`, or `none`.
20
20
* Do not call `POST /v1/responses/input_tokens`. It is 404 `agents.not_implemented_locally` with `x-should-retry: false`. No tokenizer matches the model the CLI will call.
21
21
* Leave the group off until a session needs it. Start the process with `EBX_SERVER_ENABLED_GROUPS=agents`.
Clients that only demonstrate the calls, against a server you already started: [hosted_codex.py](../../../examples/agents/hosted_codex.py) and [hosted_qwen.py](../../../examples/agents/hosted_qwen.py). [local_files_and_session.py](../../../examples/agents/local_files_and_session.py) uploads one file and runs one session against a local server, using the fake CLI (no model API key). See [examples/agents/README.md](../../../examples/agents/README.md).
158
+
Clients that only demonstrate the calls, against a server you already started: [hosted_codex.py](../../../examples/agents/hosted_codex.py) and [hosted_qwen.py](../../../examples/agents/hosted_qwen.py). [local_files_and_session.py](../../../examples/agents/local_files_and_session.py) uploads one file and opens one session against a local server. It places a local program named `codex` on `PATH` and does not read a model API key. See [examples/agents/README.md](../../../examples/agents/README.md).
0 commit comments