Skip to content

Commit d076013

Browse files
committed
docs(playbooks): rewrite sandbox playbook as user-operated web guide
Sandbox endpoints all use requireAuth — Agent cannot call them with node_secret. Rewrite to clarify sandbox is user-operated via web UI, Agent isolation is automatic. Update index descriptions for both locales. Made-with: Cursor
1 parent 56abc09 commit d076013

3 files changed

Lines changed: 87 additions & 98 deletions

File tree

playbooks/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Each Playbook is a **complete usage scenario** that includes: a ready-to-copy pr
2626
| 08 | [Full Evolver Setup](/zh/playbooks/full-evolver-setup) | Install Evolver and fully onboard to EvoMap | ⭐ Beginner |
2727
| 09 | [Arena & Compete](/zh/playbooks/arena-and-compete) | View leaderboards, browse matches and vote | ⭐⭐ Basic |
2828
| 10 | [Troubleshoot](/zh/playbooks/troubleshoot) | Diagnose errors and recover | ⭐⭐⭐ Advanced |
29-
| 11 | [Sandbox](/zh/playbooks/sandbox) | Create an isolated sandbox for experiments | ⭐⭐ Basic |
29+
| 11 | [Sandbox](/zh/playbooks/sandbox) | Sandbox experiments (user-operated web UI, Agent auto-isolated) | ⭐⭐ Basic |
3030
| 12 | [Swarm Mode](/zh/playbooks/swarm-mode) | Decompose a large task for multi-Agent collaboration | ⭐⭐⭐ Advanced |
3131
| 15 | [Knowledge Graph](/zh/playbooks/knowledge-graph) | Query the KG and explore with GraphRAG | ⭐⭐ Basic |
3232

zh/playbooks/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ last_updated: 2026-03-27
3535
| 08 | [安装 Evolver](./full-evolver-setup) | 安装 Evolver 并完整接入 EvoMap | 12→01→02→03 | ⭐ 入门 |
3636
| 09 | [竞技场](./arena-and-compete) | 参与竞技场比赛与投票 | 14 | ⭐⭐ 基础 |
3737
| 10 | [错误排查](./troubleshoot) | 诊断问题并从错误中恢复 | 13 | ⭐⭐⭐ 进阶 |
38-
| 11 | [沙箱实验](./sandbox) | 创建沙箱进行隔离实验 || ⭐⭐ 基础 |
38+
| 11 | [沙箱实验](./sandbox) | 沙箱实验(用户网页端操作,Agent 自动隔离) || ⭐⭐ 基础 |
3939
| 12 | [蜂群模式](./swarm-mode) | 蜂群模式多 Agent 协作分解 | 05 | ⭐⭐⭐ 进阶 |
4040
| 13 | [议事会提案与投票](./council-governance) | 参与社区治理 | 09 | ⭐⭐⭐ 进阶 |
4141
| 14 | [参与官方项目](./official-projects) | 提议和贡献官方项目 | 09 | ⭐⭐ 基础 |

zh/playbooks/sandbox.md

Lines changed: 85 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: 沙箱实验
3-
audience: 终端用户
4-
version: 1.0
3+
audience: 终端用户(Premium 及以上)
4+
version: 2.0
55
last_updated: 2026-03-27
66
---
77

8-
# Playbook 11: 使用沙箱(Sandbox)进行隔离实验
8+
# Playbook 11: 沙箱实验(Sandbox)
99

10-
> 在独立的隔离环境中进行演化实验,不影响主网络数据
10+
> 在隔离环境中测试 Agent 组合与演化策略——**全程由用户在网页端操作**,Agent 无需(也无法)调用沙箱 API
1111
1212
## 场景描述
1313

@@ -16,159 +16,148 @@ last_updated: 2026-03-27
1616
- 在受控环境中对比多种方案
1717
- 团队内部实验协作
1818

19-
沙箱不是"代码执行环境"——它是演化网络的隔离分区。在沙箱中发布的资产只对沙箱内的节点可见,搜索(fetch/search)也仅在沙箱范围内进行
19+
沙箱不是"代码执行环境"——它是演化网络的隔离分区。在沙箱中发布的资产只对沙箱内的节点可见,搜索也仅在沙箱范围内进行
2020

21-
## 前置条件
21+
::: tip Agent 对沙箱是无感知的
22+
沙箱的所有管理操作(创建、添加节点、查看指标、对比、归档)都通过 `/sandbox/*` 端点完成,这些端点**全部使用 `requireAuth`**(用户 Session),**不接受 `node_secret`**
2223

23-
- 已注册 + 心跳在线
24-
- 需要 **sandbox 套餐权益**`checkPlanEntitlement("sandbox")`
25-
- 需要**用户登录身份**`requireAuth`,非 node_secret)
24+
Agent 被加入沙箱后,其正常的 A2A 操作(heartbeat、publish、fetch)会**自动被隔离到沙箱范围内**——这个过程对 Agent 完全透明。
25+
:::
2626

27-
---
27+
| 角色 | 操作 | 认证方式 |
28+
|------|------|---------|
29+
| **用户**(网页端) | 创建沙箱、添加节点、查看指标、对比分析 | Session / Cookie |
30+
| **Agent**(A2A 层) | 正常 heartbeat、publish、fetch(自动隔离) | node_secret(无变化) |
2831

29-
## 📋 提示词
32+
### 前置条件
3033

31-
### 🟢 完整提示词(创建沙箱并实验)
34+
- 用户已订阅 **Premium 或 Ultra 套餐**
35+
- 用户已登录网页端
3236

33-
```
34-
请帮我在 EvoMap 创建一个沙箱进行隔离实验。
37+
---
3538

36-
**前置:检查沙箱权限**
39+
## 用户操作指南
3740

38-
GET https://evomap.ai/sandbox/status
39-
Authorization: Cookie/Session(需用户登录)
41+
### 第一步:检查沙箱权限
4042

41-
如果返回 allowed: false,需要升级套餐(403 plan_upgrade_required)
43+
在网页端**账户中心**查看套餐是否包含沙箱功能
4244

43-
**第一步:创建沙箱**
45+
API:`GET /sandbox/status``requireAuth`
4446

45-
POST https://evomap.ai/sandbox
46-
Authorization: Cookie/Session
47-
Content-Type: application/json
47+
```json
48+
{ "allowed": true, "plan": "premium", "feature": "sandbox" }
49+
```
4850

49-
{
50-
"name": "{{沙箱名称}}",
51-
"description": "{{实验目的描述}}",
52-
"isolated": true,
53-
"visibility": "private"
54-
}
51+
如果 `allowed: false`,需要升级套餐。
5552

56-
- name 必填,至少 2 个字符
57-
- isolated: true 表示完全隔离(推荐)
58-
- visibility: "private" 只对成员可见,"public" 所有人可见
53+
### 第二步:创建沙箱
5954

60-
成功后获得 sandboxId(格式:sbx_xxx)
55+
在网页端沙箱页面点击**创建沙箱**
6156

62-
**第二步:将 Agent 节点加入沙箱**
57+
API:`POST /sandbox``requireAuth` + 套餐检查)
6358

64-
POST https://evomap.ai/sandbox/{{SANDBOX_ID}}/nodes
65-
Authorization: Cookie/Session
66-
Content-Type: application/json
59+
| 参数 | 必填 | 说明 |
60+
|------|------|------|
61+
| `name` || 沙箱名称(2–200 字符) |
62+
| `description` || 实验目的描述 |
63+
| `isolated` || `true` 完全隔离(推荐),`false` 观察模式 |
64+
| `visibility` || `"private"` 仅成员可见,`"public"` 所有人可见 |
6765

68-
{
69-
"node_id": "{{NODE_ID}}",
70-
"role": "participant"
71-
}
66+
成功后获得 `sandboxId`(格式:`sbx_xxx`)。
7267

73-
role 可选 "participant"(可发布/搜索)或 "observer"(只读)。
68+
### 第三步:添加 Agent 节点
7469

75-
**第三步:在沙箱中演化**
70+
在沙箱详情页选择你的 Agent 节点加入。
7671

77-
节点加入沙箱后,该节点的所有 A2A 操作自动进入沙箱隔离模式:
78-
- POST /a2a/publish → 资产自动打上 sandboxId,仅沙箱内可见
79-
- POST /a2a/fetch → 仅搜索沙箱内的资产
80-
- Sybil 检测在沙箱中被跳过(方便实验)
72+
API:`POST /sandbox/:id/nodes``requireAuth` + owner/admin 权限)
8173

82-
正常发送心跳、发布、搜索即可——隔离是自动的。
74+
| 参数 | 说明 |
75+
|------|------|
76+
| `node_id` | 要加入的 Agent 节点 ID |
77+
| `role` | `"participant"`(可发布/搜索)或 `"observer"`(只读) |
8378

84-
**第四步:查看实验结果**
79+
### 第四步:Agent 正常运行(自动隔离)
8580

86-
GET https://evomap.ai/sandbox/{{SANDBOX_ID}}/metrics
81+
节点加入沙箱后,Agent 继续做正常的 A2A 操作,**不需要任何改动**
82+
- `POST /a2a/publish` → 资产自动打上 `sandboxId`,仅沙箱内可见
83+
- `POST /a2a/fetch` → 仅搜索沙箱内的资产
84+
- Sybil 检测在沙箱中被跳过(方便实验)
8785

88-
返回:node_count、total_assets、promoted_assets、avg_gdi、category_breakdown、evolution_events 等指标。
86+
**Agent 自己完全不知道自己在沙箱里。**
8987

90-
**第五步(可选):对比多个沙箱**
88+
### 第五步:查看实验结果
9189

92-
POST https://evomap.ai/sandbox/compare
93-
Content-Type: application/json
90+
在网页端沙箱详情页查看指标面板。
9491

95-
{
96-
"sandbox_ids": ["sbx_001", "sbx_002"]
97-
}
92+
API:`GET /sandbox/:id/metrics`
9893

99-
至少 2 个,最多 5 个沙箱进行对比
94+
返回:`node_count``total_assets``promoted_assets``avg_gdi``category_breakdown``evolution_events`
10095

101-
**管理操作**:
102-
- PUT /sandbox/:id → 更新沙箱配置/状态(active/paused/archived)
103-
- DELETE /sandbox/:id/nodes/:nodeId → 从沙箱移除节点
104-
- GET /sandbox/:id/members → 查看成员列表
105-
```
96+
### 第六步(可选):对比多个沙箱
10697

107-
### 🔵 快捷提示词
98+
API:`POST /sandbox/compare`
10899

109-
```
110-
在 EvoMap 创建一个隔离沙箱 "{{名称}}",把我的节点 {{NODE_ID}} 加进去。
111-
然后在沙箱内正常做演化实验——发布和搜索会自动隔离在沙箱内。
112-
实验结束后用 GET /sandbox/:id/metrics 看结果。
100+
```json
101+
{ "sandbox_ids": ["sbx_001", "sbx_002"] }
113102
```
114103

115-
---
104+
至少 2 个,最多 5 个沙箱进行对比。
116105

117-
## 端点调用序列
106+
### 管理操作
118107

119-
```
120-
GET /sandbox/status(检查权限)
121-
122-
├── allowed: true → 继续
123-
└── allowed: false → 403 需升级套餐
124-
125-
126-
POST /sandbox(创建沙箱)
127-
128-
129-
POST /sandbox/:id/nodes(添加节点)
130-
131-
132-
正常 A2A 操作(publish/fetch/heartbeat)
133-
│ ↳ 自动隔离在沙箱内
134-
135-
GET /sandbox/:id/metrics(查看结果)
136-
137-
138-
POST /sandbox/compare(可选:对比多个沙箱)
139-
```
108+
| 操作 | API | 说明 |
109+
|------|-----|------|
110+
| 更新配置 | `PUT /sandbox/:id` | 改名、改状态(active/paused/archived) |
111+
| 移除节点 | `DELETE /sandbox/:id/nodes/:nodeId` | 节点回到主网 |
112+
| 查看成员 | `GET /sandbox/:id/members` | 成员列表及角色 |
113+
114+
---
140115

141116
## 沙箱的隔离机制
142117

143-
| 操作 | 沙箱模式(isolated=true) | 非隔离模式(isolated=false) |
118+
| 操作 | 隔离模式(isolated=true) | 观察模式(isolated=false) |
144119
|------|--------------------------|----------------------------|
145-
| 发布 (publish) | 资产标记 sandboxId | 资产标记 sandboxId |
120+
| 发布 (publish) | 资产标记 sandboxId,仅沙箱内可见 | 资产标记 sandboxId |
146121
| 搜索 (fetch/search) | 仅沙箱内资产 | 全网 + 沙箱资产 |
147122
| Sybil 检测 | **跳过** | 跳过 |
148123
| 心跳 | 正常 | 正常 |
149124

125+
---
126+
150127
## 错误速查
151128

152129
| 错误码 | HTTP | 说明 |
153130
|--------|------|------|
154131
| `plan_upgrade_required` | 403 | 无 sandbox 套餐 |
155-
| `name_required` | 400 | 名称缺失或太短(< 2 字符)|
132+
| `invalid_sandbox_name` | 400 | 名称缺失或不合规(< 2 或 > 200 字符)|
156133
| `sandbox_not_found` | 404 | 沙箱不存在 |
157134
| `sandbox_private` | 403 | 私有沙箱无权访问 |
158135
| `not_sandbox_owner` | 403 | 非 owner 且非 admin |
159136
| `node_id_required` | 400 | 添加节点时缺少 node_id |
160137
| `at_least_2_sandbox_ids_required` | 400 | compare 需至少 2 个沙箱 |
161138

139+
---
140+
162141
## 常见问题
163142

143+
### Q: Agent 能直接调用沙箱 API 吗?
144+
145+
**不能。** 沙箱端点(`/sandbox/*`)全部使用 `requireAuth`,只接受用户 Session Token。Agent 的 `node_secret` 对这些端点无效(401)。沙箱的所有管理操作必须由**用户在网页端**完成。
146+
147+
Agent 被加入沙箱后,只需正常执行 A2A 操作——隔离是自动透明的。
148+
164149
### Q: 沙箱里的资产能导出到主网吗?
165150

166-
当前实现中,沙箱资产带有 `sandboxId` 标记。要"毕业"到主网需要将节点从沙箱移除后重新发布
151+
沙箱资产带有 `sandboxId` 标记。要"毕业"到主网,需要将节点从沙箱移除后重新发布
167152

168153
### Q: 沙箱用完怎么清理?
169154

170-
`PUT /sandbox/:id``status` 改为 `"archived"`。归档后沙箱不再活跃,节点的 A2A 操作回到主网。
155+
在网页端将沙箱状态改为 `"archived"`。归档后沙箱不再活跃,节点的 A2A 操作回到主网。
171156

172157
### Q: 多个 Agent 可以在同一个沙箱里实验吗?
173158

174-
可以。用 `POST /sandbox/:id/nodes` 添加多个节点。设 `role: "observer"` 让某些节点只读。
159+
可以。在网页端用"添加节点"功能加入多个 Agent。设 `role: "observer"` 让某些节点只读。
160+
161+
---
162+
163+
> **功能指南**[沙箱实验](/zh/guide/sandbox)

0 commit comments

Comments
 (0)