Repository navigation
Description
Upstream issue draft — OpenClaw
Repo: https://github.com/openclaw/openclaw/issues/new
Title: agents.defaults.sandbox.mode is binary (all/none) — full bot outage when Docker briefly stops, including chat-only turns
Summary
agents.defaults.sandbox.mode: "all" is the documented production setting per ADR-0003-equivalent reasoning — the gateway routes every exec through Docker so allowlisted binaries can be enforced safely. The schema, however, only offers "all" (require Docker for every turn) or "none" (allow exec on host). Setting "all" makes Docker a hard dependency for every turn, including pure conversational turns that never invoke exec.
When Docker Desktop briefly stops — sleep wake, mid-day restart, OOM kill, version upgrade — every bot turn fails until Docker comes back, even chat-only ones. The user-perceived effect is "the bot is dead" for whatever recovery window Docker takes.
Symptom
2026-05-09T14:15:22-04:00 [agent/embedded] error: sandbox unavailable: cannot reach docker.sock
[bot] turn rejected; no reply sent for chat=8667951543
The user sent "hi" — a chat-only turn that needs zero exec. Reply was rejected because the gateway pre-flight checks Docker before routing to the model.
Empirically observed on openclaw 2026.5.2 (8b2a6e5) — Mac Mini M4 Pro, macOS 25.4.0, Docker Desktop 4.x. Triggers ~weekly when Docker Desktop's auto-update kicks in.
Proposed fix
Add a third value: agents.defaults.sandbox.mode: "needed".
Semantics:
- The gateway routes turns through Docker only when the turn invokes a sandbox-bound tool (
exec,apply_patch, anything in the sandbox allowlist). - Pure-chat turns, MCP calls that don't go through
exec, FS reads/writes insidetools.fs.workspaceOnly, and replies that don't trigger any tool route entirely on host — Docker is not pre-flight checked. - If a turn requests
execwhile Docker is down, the gateway returns a clear "sandbox temporarily unavailable" error to the model (which can decide to retry or surface to the user).
This matches the actual security threat model: the host needs Docker for exec isolation, but conversational turns don't have an exec attack surface.
Alternatives considered
- Keep
"all"and rely on local mitigation (Docker Desktop autostart, gateway wrapper pollingdocker info) — what we have today. The wrapper has a 60–180 s recovery window; turns sent during that window still fail. - Set
"none"everywhere — defeats the entire point of ADR-0003. Exec on host bypasses the allowlist enforcement. - Per-agent override —
socialcraftcould be"none"since it never execs, butmainanddatalabstill hit the issue.
"needed" is the smallest schema change that gets us out of the binary trap.
Reproduction
- Set
agents.defaults.sandbox.mode: "all"(production default). osascript -e 'quit app "Docker Desktop"'(or just close Docker).- Send any chat message via Telegram, including one that never invokes a tool.
- Bot turn fails with sandbox-unavailable; no reply received.
- Restart Docker; turns recover.
Expected with "needed": step 3 returns a normal model reply because the turn doesn't invoke exec.
Workaround in place
Local: Docker Desktop's autostart-on-boot is enabled, plus bin/openclaw-gateway.sh polls docker info every 5 s and only kickstarts the gateway after Docker reports healthy. Reduces but doesn't eliminate the race window.
Environment
openclaw 2026.5.2 (8b2a6e5)- macOS 25.4.0 / arm64 / Mac Mini M4 Pro 64 GB
- Docker Desktop 4.x
Related
- Plan RPC agent configuration not working #18 Tier 0 Clarification for clawd.md #6 in jpazvd/jpazvd.lab-config
- Pairs with Tool-call regression — agents return prose ('I will search…') instead of emitting tool calls #80150 (tool-call regression), answerCallbackQuery timeout cluster on Telegram bots — late ACK because callback handler awaits model response #80152 (callbackQuery timeout), Provider timeoutSeconds is theatre — embedded-runner (120s) and lane (210s) watchdogs fire above it #80153 (watchdog floor) — together these four issues account for the bulk of locally-tracked Tier 0 work.
- This is a schema change, so it's smaller scope than the other three (no resolver work, no watchdog work, no Telegram bot pattern work).
What I'd expect
agents.defaults.sandbox.mode: "needed"lands as a third schema-validated value.- Default for new installs stays
"all"(no behavior change). - Documentation explicitly recommends
"needed"for deployments where chat is a primary surface and Docker isn't 100% uptime.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 10, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 4, 2026, 8:26 PM ET / August 5, 2026, 00:26 UTC.
Summary
Keep open: current main still eagerly provisions a sandbox for every
allsession before model setup, and the requested lazy activation is not implemented. The linked candidate PR remains open, draft, and conflicted, so maintainers must first accept the new security/configuration contract before it can resolve this issue.Reproducibility: yes. from source:
allselects every session for sandboxing and setup provisions its backend before provider execution; this review did not run a live Docker-stop scenario.Root-cause cluster
Relationship:
canonicalCanonical: #80296
Summary: This issue is the canonical request for lazy sandbox activation; the linked PR is a pending candidate rather than a completed fix.
Members:
fixed_by_candidate: Add needed sandbox activation mode #95005 - Its body formally targets this issue with aneededactivation mode, but it remains an open draft with conflicts.adjacent_distinct: [Bug]: Docker engine wedged/unresponsive → docker exec hangs (no timeout) → gateway blocks at startup, all agents offline (fresh repro of #5135 on 2026.5.28) #90980 - It concerns unbounded Docker-engine hangs and gateway startup availability, not tool-time activation for chat-only turns.adjacent_distinct: [Feature]: Managed ephemeral sandbox lifecycle for session-owned work #98516 - It concerns session-owned sandbox lifecycle after activation, not whether a backend is activated before chat.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Maintainer decision needed
Why: This adds a public configuration mode and changes the boundary between conversation availability and fail-closed tool isolation; source proves the current eager behavior but cannot choose that product/security contract.
Next step
An open PR already owns the implementation attempt, while maintainers must decide the sandbox activation and fail-closed contract before any competing repair work.
Security
Needs attention: The requested capability is security-sensitive because it changes when execution isolation becomes active.
Review details
Best possible solution:
Define one opt-in lazy-activation contract that preserves no-host-fallback execution, then rebase and complete the linked implementation or replace it with a narrower owner-approved version.
Do we have a high-confidence way to reproduce the issue?
Yes, from source:
allselects every session for sandboxing and setup provisions its backend before provider execution; this review did not run a live Docker-stop scenario.Is this the best way to solve the issue?
Unclear: lazy activation is a plausible solution, but its public security and compatibility contract must be accepted before the linked implementation can be judged the best fix.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against cbde3c1945fb.
Label changes
Label changes:
issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.issue-rating: 🐚 platinum hermit: Current issue advisory state no longer selects this label.Label justifications:
P2: The requested opt-in mode affects chat availability during sandbox-backend outages but needs a deliberate security contract before implementation.impact:security: The proposal changes when sandbox isolation is activated and must prevent host execution fallback.impact:message-loss: The reported failure rejects a chat turn before a reply is delivered.Evidence reviewed
Security concerns:
src/agents/sandbox/context.ts:330Any accepted design must keep execution-capable tools unavailable until sandbox activation succeeds and must not redirect them to the gateway host.
Confidence: 0.93
What I checked:
off,non-main, andall; there is noneededvalue on main. (src/config/zod-schema.agent-runtime.ts:646, cbde3c1945fb)allmarks every session sandboxed and provisioning creates the backend. (src/agents/embedded-agent-runner/run/attempt-setup.ts:49, cbde3c1945fb)offand the main session undernon-mainbypass backend work, whileallinvokes backend setup. (src/agents/sandbox.resolveSandboxContext.test.ts:85, cbde3c1945fb)off,non-main, andall, withoffas the default; the supplied latest release is v2026.7.1-2 at 0790d9f, while current main still lacks the requested behavior. Public docs:docs/gateway/config-agents.md. (docs/gateway/config-agents.md:731, 0790d9f593ad)src/agents/embedded-agent-runner/run/attempt-setup.ts:49, e82f190d1bd2)Likely related people:
src/agents/sandbox/context.ts)src/agents/sandbox)src/agents/embedded-agent-runner/run/attempt-setup.ts,src/config/zod-schema.agent-runtime.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jun 1, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
1 remaining item
steipete commentedon Oct 24, 2026
Thanks for filing this. We're closing older issues that no longer look actionable on current
main.Lazy sandbox activation would be a new security/config contract with limited demand, and the candidate PR closed. Please open a fresh request if Docker-outage resilience is still a priority for you.