refactor(sandbox): unify scope + per-agent overrides
This commit is contained in:
@@ -340,6 +340,8 @@ Run multiple isolated agents (separate workspace, `agentDir`, sessions) inside o
|
||||
- `scope`: `"session"` | `"agent"` | `"shared"`
|
||||
- `workspaceRoot`: custom sandbox workspace root
|
||||
- `docker`: per-agent docker overrides (e.g. `image`, `network`, `env`, `setupCommand`, limits; ignored when `scope: "shared"`)
|
||||
- `browser`: per-agent sandboxed browser overrides (ignored when `scope: "shared"`)
|
||||
- `prune`: per-agent sandbox pruning overrides (ignored when `scope: "shared"`)
|
||||
- `tools`: per-agent sandbox tool policy (deny wins; overrides `agent.sandbox.tools`)
|
||||
- `tools`: per-agent tool restrictions (overrides `agent.tools`; applied before sandbox tool policy).
|
||||
- `allow`: array of allowed tool names
|
||||
|
||||
@@ -160,7 +160,7 @@ Hardening knobs live under `agent.sandbox.docker`:
|
||||
`network`, `user`, `pidsLimit`, `memory`, `memorySwap`, `cpus`, `ulimits`,
|
||||
`seccompProfile`, `apparmorProfile`, `dns`, `extraHosts`.
|
||||
|
||||
Multi-agent: override `agent.sandbox.docker.*` per agent via `routing.agents.<agentId>.sandbox.docker.*`
|
||||
Multi-agent: override `agent.sandbox.{docker,browser,prune}.*` per agent via `routing.agents.<agentId>.sandbox.{docker,browser,prune}.*`
|
||||
(ignored when `agent.sandbox.scope` / `routing.agents.<agentId>.sandbox.scope` is `"shared"`).
|
||||
|
||||
### Build the default sandbox image
|
||||
|
||||
@@ -150,11 +150,12 @@ routing.agents[id].sandbox.scope > agent.sandbox.scope
|
||||
routing.agents[id].sandbox.workspaceRoot > agent.sandbox.workspaceRoot
|
||||
routing.agents[id].sandbox.workspaceAccess > agent.sandbox.workspaceAccess
|
||||
routing.agents[id].sandbox.docker.* > agent.sandbox.docker.*
|
||||
routing.agents[id].sandbox.browser.* > agent.sandbox.browser.*
|
||||
routing.agents[id].sandbox.prune.* > agent.sandbox.prune.*
|
||||
```
|
||||
|
||||
**Notes:**
|
||||
- `routing.agents[id].sandbox.docker.*` overrides `agent.sandbox.docker.*` for that agent (ignored when sandbox scope resolves to `"shared"`).
|
||||
- `browser` and `prune` settings under `agent.sandbox` are still **global** and apply to all sandboxed agents.
|
||||
- `routing.agents[id].sandbox.{docker,browser,prune}.*` overrides `agent.sandbox.{docker,browser,prune}.*` for that agent (ignored when sandbox scope resolves to `"shared"`).
|
||||
|
||||
### Tool Restrictions
|
||||
The filtering order is:
|
||||
|
||||
Reference in New Issue
Block a user