Skip to content

agents.defaults.sandbox.mode is binary (all/none) — full bot outage when Docker briefly stops, including chat-only turns #80296

Closed as not planned

Description

@jpazvd

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 inside tools.fs.workspaceOnly, and replies that don't trigger any tool route entirely on host — Docker is not pre-flight checked.
  • If a turn requests exec while 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 polling docker 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 — socialcraft could be "none" since it never execs, but main and datalab still hit the issue.

"needed" is the smallest schema change that gets us out of the binary trap.

Reproduction

  1. Set agents.defaults.sandbox.mode: "all" (production default).
  2. osascript -e 'quit app "Docker Desktop"' (or just close Docker).
  3. Send any chat message via Telegram, including one that never invokes a tool.
  4. Bot turn fails with sandbox-unavailable; no reply received.
  5. 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

What I'd expect

  1. agents.defaults.sandbox.mode: "needed" lands as a third schema-validated value.
  2. Default for new installs stays "all" (no behavior change).
  3. Documentation explicitly recommends "needed" for deployments where chat is a primary surface and Docker isn't 100% uptime.

Activity

  1. clawsweeper commented on May 10, 2026

    @clawsweeper
    Contributor

    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 all session 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: all selects 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: canonical
    Canonical: #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:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Maintainer decision needed

    Question Recommendation
    Should OpenClaw add an opt-in lazy sandbox activation mode that permits chat-only turns without Docker while withholding every sandbox-bound execution surface until activation succeeds? Sponsor lazy activation: Adopt the linked approach after conflict resolution, with explicit proof that every execution-capable surface remains unavailable rather than falling back to the host.

    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: all selects 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:

    • A lazy mode changes the persistent sandbox and fail-closed security contract across embedded, Codex, filesystem, browser, MCP, and execution paths.
    • The existing implementation candidate needs conflict resolution and exact-head cross-runtime upgrade and security proof before merge.

    Codex review notes: model internal, reasoning high; reviewed against cbde3c1945fb.

    Label changes

    Label changes:

    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • remove clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.
    • remove 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:

    • [high] Preserve fail-closed execution during lazy activation — src/agents/sandbox/context.ts:330
      Any 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:

    Likely related people:

    • steipete: Authored the recent sandbox change that preserves provisioning failures instead of consuming model fallbacks. (role: recent sandbox provisioning contributor; confidence: high; commits: dcffb9c9c2fe; files: src/agents/sandbox/context.ts)
    • vincentkoc: Authored recent sandbox-provisioning serialization and runtime-identity work adjacent to the activation boundary. (role: recent sandbox runtime contributor; confidence: high; commits: 9daa60961c8a, 30346f97883c; files: src/agents/sandbox)
    • Shakker: Current setup and schema lines trace to this shallow-history boundary commit; earlier provenance is unavailable locally. (role: recent area contributor; confidence: low; commits: e82f190d1bd2; files: src/agents/embedded-agent-runner/run/attempt-setup.ts, src/config/zod-schema.agent-runtime.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. openclaw-barnacle commented on Jun 1, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  3. added
    stale
    on Jun 1, 2026
  4. added
    P2
    impact:security
    impact:crash-loop
    impact:message-loss
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:no-new-fix-pr
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    clawsweeper:needs-security-review
    on Jun 14, 2026
  5. added
    clawsweeper:linked-pr-open
    on Jun 29, 2026
  6. 1 remaining item

  7. added
    issue-rating: 🐚 platinum hermit
    clawsweeper:needs-live-repro
    and removed
    clawsweeper:fix-shape-clear
    clawsweeper:source-repro
    issue-rating: 🦞 diamond lobster
    on Jul 30, 2026
  8. removed
    stale
    on Jul 31, 2026
  9. added
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    and removed
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-live-repro
    issue-rating: 🐚 platinum hermit
    on Aug 3, 2026
  10. steipete commented on Oct 24, 2026

    @steipete
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:linked-pr-openclawsweeper:needs-product-decisionclawsweeper:needs-security-reviewclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:message-lossimpact:securityissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions