Skip to content

Commit 12ee25f

Browse files
committed
docs: sandbox file injection — CLI, SANDBOXING, README
1 parent a7e1382 commit 12ee25f

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ odek is not a framework. It's a **runtime** — the smallest possible surface ar
3333
## Strategic Features
3434

3535
### 🔒 Sandboxed Execution
36-
`odek run --sandbox` — every session spawns an isolated Docker container. No network, no host mounts beyond the working directory, zero capabilities, destroyed on exit. Full security model in [docs/SANDBOXING.md](docs/SANDBOXING.md).
36+
`odek run --sandbox` — every session spawns an isolated Docker container. No network, no host mounts beyond the working directory, zero capabilities, destroyed on exit. `--ctx` files are automatically injected into the container at `/workspace/`. Full security model in [docs/SANDBOXING.md](docs/SANDBOXING.md).
3737

3838
### 🧩 Sub-Agent Delegation
3939
Parallel OS-process sub-agents via `delegate_tasks`. True isolation — each sub-agent is a fresh `odek subagent` process with its own config, tools, and termination timeout. Up to 8 concurrent workers. [docs/SUBAGENTS.md](docs/SUBAGENTS.md)

docs/CLI.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ In `odek serve`:
8787

8888
Files are read client-side in the Web UI and server-side in the CLI through `enrichTask()` in the `cmd/odek/refs.go` package. The `resource` package handles resolution: file content is wrapped in `--- filename ---` / `--- end filename ---` markers and prepended to the task.
8989

90+
### Sandbox file injection
91+
92+
When `--sandbox` is active, `--ctx` files are automatically **copied into the sandbox container** via `docker cp`, placed at `/workspace/<relative-path>`. Files outside the working directory use their basename. This means the agent can use tools (`read_file`, `shell cat`, `patch`) on the same files it sees in context — no "content visible but file doesn't exist" gap. Directories and missing files are silently skipped.
93+
9094
## Shell tool schema
9195

9296
```json

docs/SANDBOXING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ Build behavior:
155155

156156
**Security note:** `bridge` gives the container internet access but isolates it from the host's network stack (no access to `localhost:port` on the host, no access to your LAN). `host` mode removes that isolation — use only when you need to connect to a service on the host.
157157

158+
## File injection
159+
160+
When running with `--sandbox --ctx <file>`, odek copies the ctx files into the container via `docker cp`:
161+
162+
- Files within the working directory preserve their relative path (`--ctx subdir/file.txt``/workspace/subdir/file.txt`)
163+
- Files outside the working directory use their basename (`--ctx /etc/hosts``/workspace/hosts`)
164+
- Missing files and directories are silently skipped
165+
- In read-only mode, injection still works (docker cp writes to the container's overlay, not the volume bind-mount)
166+
167+
This ensures the agent can both see the file content in its context **and** operate on the physical file using `read_file`, `patch`, `shell cat`, etc. without any "content visible but file doesn't exist" gap.
168+
158169
## Read-only mode
159170

160171
When `sandbox_readonly` is `true`, the working directory is mounted **read-only** inside the container:

0 commit comments

Comments
 (0)