Browse the documentation
CAP-17: Sandbox scopes
- ID:
CAP-17 - Title: Sandbox scopes
- Lead:
seed - Touches:
bloom - Horizon:
later - Milestone:
M9 - CLI phase: none
- Status:
proposed - Claim:
planned - Depends on:
CAP-04,CAP-12
Why
seed roadmap Stage 6 identifies sandbox scopes for specialist effects (docs/roadmap.md), and docs/contracts/run-model.md requires every intent (recordIntent) to name its target scope. Without a formal sandbox scope contract, scope strings remain unparsed labels, shell execution lacks a default-off policy check, and specialists lack a verifiable mapping between logical tool paths and declared per-run workspace roots.
What it does
CAP-17 specifies the per-run sandbox scope policy contract in seed and runtime root containment enforcement in bloom:
- Per-run workspace roots:
- Each run declares an explicit list of admitted root scopes (
{ rootId, access }whereaccessis"read"or"read-write"). - Ambient host access outside declared roots is refused by default; an attempt with an empty root set admits no filesystem scopes.
- Each run declares an explicit list of admitted root scopes (
- Virtual path map:
- Tool calls and recorded intents address paths through logical root references (for example
rootId+ relative subpath such asprimary/src/index.mjs) rather than embedding concrete host paths. seeddefines pure normalized scope/path containment helpers over caller-provided virtual path maps, rejecting parent traversal (..), empty segments, unknownrootIdvalues, and writes against"read"roots.
- Tool calls and recorded intents address paths through logical root references (for example
- Shell off by default:
- Shell execution tools (such as
workspace.shell.executefromCAP-04) are disabled by default on every run even if present in a registry. - Enabling shell execution requires explicit opt-in on the run’s sandbox scope policy (
allowShell: true) in addition to objectiveallowedToolsadmission andCAP-06owner-gate controls.
- Shell execution tools (such as
- Effects confined to declared scopes:
- Before any non-read or read effect executes, the target scope and virtual path are validated against the run’s declared sandbox scopes; any out-of-scope target fails closed with
policy-denied(run-model.mdfailure class) before reaching an executor. seedkeeps all checks pure and filesystem-free;bloombinds logicalrootIdentries to concrete workspace directories on disk, enforces symlink-resolution confinement, and gates runtime effects.
- Before any non-read or read effect executes, the target scope and virtual path are validated against the run’s declared sandbox scopes; any out-of-scope target fails closed with
Contract touchpoints
seed:docs/contracts/run-model.md(bindsrecordIntentscope strings to declared per-run sandbox scopes andpolicy-deniedcontainment failures);docs/contracts/tool-id.md(alignsrealmand effect admission with per-run sandbox scope policies and default-off shell rules).bloom:docs/architecture.md(maps virtual workspace roots to real directories, resolves symlinks fail-closed, and enforces scope checks aroundCAP-04andCAP-12execution).
Tool IDs and events
Tool IDs
None defined by this capability. Sandbox rules govern existing tools (such as CAP-04 workspace and shell tools).
| Tool ID | Effect | Third-party egress | Owner gate | Summary |
|---|
Events
None defined by this capability. Policy denials emit typed events on bloom’s CAP-10 event stream.
| Event | Emitter | Payload summary |
|---|
Acceptance tests
shell-disabled-by-default: A run whose sandbox scope omitsallowShell: truerefuses any shell execution intent withpolicy-deniedeven when a shell tool is in the registry.virtual-path-traversal-refused: Logical paths containing.., unknownrootIdprefixes, or malformed segments are rejected before execution withpolicy-denied.read-only-root-blocks-write-intent: Awriteordestructiveintent targeting a root declared withaccess: "read"is refused before execution.effects-confined-to-declared-roots: Only effects whose resolved logical target falls within the run’s declared root scopes pass admission; unmapped targets fail closed.bloom-symlink-escape-blocked: Inbloom, a symlink inside an admitted workspace root pointing outside the bound directory is refused rather than followed for writes or unauthorized reads.
Slices
CAP-17.1(seed, milestoneM9, statusproposed): Define per-run sandbox scope contract, pure virtual path map containment checks, and default-off shell policy inseed.CAP-17.2(bloom, milestoneM9, statusproposed): Bind concrete workspace roots, enforce symlink-safe confinement, and check sandbox scopes on every tool dispatch inbloom.
Non-goals
- Shipping OS-level containerization, kernel namespace setup, or host filesystem operations inside
seed. - Allowing raw host absolute paths inside public capability contracts, tool IDs, or portable intent records.
Family rules and conflicts
- Public safety: Virtual path mapping keeps host directories out of public logs, trace records, and capability specs.
- No silent widening: An agent or tool call cannot add workspace roots or flip
allowShellmid-attempt; objective scope boundaries stay immutable onceready. - Zero runtime dependencies: Scope and virtual path validation in
seeduses pure JavaScript string normalization with no filesystem or process spawns.
Open owner decisions
- Multi-root syntax and read-only symlink exception rules: Exact separator convention for
virtualPathMap(rootIdprefix vs structured{ rootId, relativePath }object) and whether read-only symlinks inside a single workspace root ever allow explicit opt-in or stay universally blocked alongside default non-following of symlinks underD10(settled whenM9begins).
Evidence
None yet. Capability is proposed with claim planned.
Changes
2026-11-23: AddedM9slice milestones acrossCAP-17.1..CAP-17.2and referencedD10symlink default.2026-11-23: Initial capability specification created (CAP-01.2scaffold).