Repository navigation
Description
Framing
This is an observation, not a proven mechanism. We could not isolate the exact code path, so we are reporting the reproducible outward behavior and what we ruled out, in case it is a known creation/runtime-state regression or something a maintainer can spot quickly.
Observation
On a single 2026.7.1 gateway (rootless Docker, Codex runtime, openai gpt-5.x), two agents with byte-identical effective sandbox config behave differently for exec/native shell:
- An agent created on 2026.6.11 →
execruns inside the sandbox container (correct). - An agent created fresh on 2026.7.1 (standard
agents add, no manual tuning) →execruns on the gateway host (not sandboxed).
The divergence correlates with the OpenClaw version at agent creation time, not with config.
Environment
- Rootless Docker, sandbox
scope: agent, custom sandbox image. agents.defaults.sandbox = { "mode": "all", "scope": "agent" }.- Codex plugin config is just
{ "enabled": true }—appServer.experimental.sandboxExecServeris NOT set (default off).
Reproduction (observational)
- On a 2026.7.1 gateway with the config above, create agent B via standard
agents add(no--agent-dir, no manual sandbox block — it inheritsagents.defaults.sandbox). - Trigger a real turn (via a bound channel), asking it to run:
pwd; command -v gh; ls /workspace.- Observed for B (created on 7.1):
pwd=/home/node/.openclaw/workspace-<B>(host path),/workspaceabsent,ghabsent → exec on host.
- Observed for B (created on 7.1):
- Agent A, created earlier on 2026.6.11, same effective config, same gateway → same trigger →
pwd=/workspace,ghpresent → exec in the sandbox. openclaw sandbox explain --agent <A|B>is identical for both (runtime: sandboxed,mode: all,scope: agent, same mounts/tool policy). Agent B's sandbox container starts healthy (no mount error).
What we ruled out
- Config.
sandbox explainis identical A vs B; the codexconfig.tomlis identical except the project path; both resolvemode=all. - The sandbox-exec-server PathUri path ([Bug]: Codex app-server file-URI cwd is forwarded unchanged to Docker workdir #107579). That repro requires
appServer.experimental.sandboxExecServer: true, which we do not set;isCodexSandboxExecServerEnabledgates on=== true, so it is off for us. The fix PR fix(codex): decode sandbox exec PathUri inputs #107644 is scoped entirely toextensions/codex/src/app-server/sandbox-exec-server/*, a module we do not exercise. So this looks distinct from [Bug]: Codex app-server file-URI cwd is forwarded unchanged to Docker workdir #107579, though possibly the same broad codex-sandbox-exec family.
Question for maintainers
Is there a version-tied creation/runtime state that gates whether a Codex agent's exec routes into the sandbox (with sandbox.mode=all and sandboxExecServer off), which would differ between an agent created on 2026.6.11 vs one created on 2026.7.1 with identical effective config? Agents created before 7.1 keep working across the 6.11→7.1 upgrade; only agents newly created on 7.1 exhibit host-exec.
No secrets included; reproduction is self-contained.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 16, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 31, 2026, 1:56 AM ET / 05:56 UTC.
Summary
Keep this issue open for security-focused maintainer investigation. The reported host execution contradicts the documented fail-closed Codex behavior for an active OpenClaw sandbox, and the Linux and Windows observations cover different triggers; however, the creation-time state difference has not been isolated or reproduced against current main.
Reproducibility: no. high-confidence current-main reproduction was established in this read-only review. The report contains detailed, independently matching Linux and Windows observations, but the exact current-main routing and persisted-state inputs still need owner-run instrumentation.
Ways to help us reproduce this
Maintainer decision needed
Why: The available evidence establishes a potentially severe boundary violation but does not identify whether the owner is agent creation, persisted Codex state, thread resume, or tool-surface assembly; choosing a permanent fix without that attribution risks preserving a host-execution path.
Next step
Security-sensitive routing is not yet attributed to a narrow source boundary, and the item already carries
clawsweeper:no-new-fix-prplus security-review routing; do not dispatch an autonomous repair.Security
Needs attention: The issue reports a plausible sandbox-boundary bypass that can run agent commands on the gateway host, requiring owner-led security investigation before any automated repair.
Review details
Best possible solution:
Record the resolved execution environment when a Codex thread is created or resumed, then enforce one canonical fail-closed decision: native host execution is unavailable during an active OpenClaw sandbox unless the explicit sandbox exec-server path is successfully registered; add regression coverage for both newly created and pre-existing agents.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction was established in this read-only review. The report contains detailed, independently matching Linux and Windows observations, but the exact current-main routing and persisted-state inputs still need owner-run instrumentation.
Is this the best way to solve the issue?
Unclear. The documented contract already calls for fail-closed behavior, but the evidence does not yet identify whether the repair belongs in fresh-agent initialization, persisted thread/session state, or Codex tool-surface selection.
AGENTS.md: unclear because the file could not be read completely.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against bc63c6698877.
Label changes
Label justifications:
P0: A confirmed execution escape from an active agent sandbox to the gateway host is an emergency security-boundary failure.impact:security: The report concerns command execution outside an operator-configured sandbox and potential exposure of gateway-host data or credentials.Evidence reviewed
Security concerns:
Two independent reports say an agent with active
sandbox.mode: allexecuted shell commands on the gateway host. If confirmed, this defeats the operator-selected sandbox boundary and can expose host-visible data or credentials.Confidence: 0.78
What I checked:
docs/plugins/codex-harness-reference.md. (docs/plugins/codex-harness-reference.md, bc63c6698877)2026.6.10package documentation, before the reported affectedv2026.7.1release, so the reported behavior is not an intentional creation-time policy described by the supported path. (app.unpkg.com) (docs/plugins/codex-harness-reference.md)openclaw agent; both state that the agent sandbox container was healthy and thatsandboxExecServerwas unset. (github.com)extensions/codex/src/app-server/sandbox-exec-server/processes.ts, e481ed422966)v2026.7.1, the version named by both reports, while current main isbc63c66988777a8eece7c019e9f6d520b665c9c3; this is not safe to close as implemented. (bc63c6698877)extensions/codex/src/app-server, e481ed422966)Likely related people:
extensions/codex/src/app-server,docs/plugins/codex-harness-reference.md)extensions/codex/src/app-server/sandbox-exec-server/processes.ts)extensions/codex/src/app-server/sandbox-exec-server)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.Sarts-eng commentedon Jul 20, 2026
We can add an independent reproduction of this on Windows, same creation-time cohort, different platform and turn-trigger — which may help narrow the persisted-state theory.
Environment
mode: "all",scope: "agent",backend: "docker", custom bookworm-slim image, container on an--internalnetwork with egress only via an allowlisting proxy./run/secrets/github-token.{ enabled: true };appServer.experimental.sandboxExecServeris NOT set (same as OP). Agent model:openai/gpt-5.6.openclaw agent --agent <id> -m "...") — not a bound channel — so the symptom is not channel-specific.Key facts matching the creation-time observation
The affected agent was created 2026-07-16 on 2026.7.1 (fresh
agents addduring a rebuild; no manual sandbox block — inherits the configured sandbox).sandboxconfig validates and resolvesmode=all; the agent-scoped sandbox container is created and healthy at turn time — verified from the host:docker inspectshows all binds;docker exec <container> ls -la /run/secrets/shows the expected single-file token. The mount is fine.Yet an agent-turn exec of
ls -l /run/secrets/executes on the gateway host as Windows PowerShell:Tool-action audit timeline (UTC): sandbox container created 07:19:47; the agent run's
bashtool actions at 07:21–07:25 still executed on the host — i.e. after the container was up, so not a startup race.What we ruled out (beyond OP's list)
tools.profile: "minimal"interaction. Our agent originally carried a per-agentminimalprofile (withexecintools.allow). We unsettools.profile,openclaw config validateclean, supervised gateway restart clean — behavior unchanged: exec still on host. So the profile/registry interaction is not the mechanism.sandboxblock (mode/scope/backend/binds/proxy env) was read back and matches the intended config exactly.Signal for the maintainers
Our data point strengthens the creation-on-2026.7.1 correlation across: platform (Windows/Docker Desktop vs rootless Linux Docker), trigger path (CLI
openclaw agentvs bound channel), and sandbox image. Happy to provide a redacted diagnostic bundle or run instrumented builds against this setup on request.(Mitigation we applied meanwhile, for anyone else affected: deny
execon the affected agent —tools.deny— until this is fixed; deny wins over allow.)essentiaMarco commentedon Aug 5, 2026
Localization note for #108236
Scope: Analysis only at PIN
fa13cf4f…. No fix PR (no-new-fix-pr).What we can support
With
sandbox.mode=allandsandboxExecServeroff, Codex fail-closes native Code Mode and exposessandbox_execas a rename of OpenClawexec. Unlikenode_exec(which pinshost: "node"),sandbox_execdoes not pinhost: "sandbox". Args are forwarded; if effective host resolves togateway(config / session / elevated), the runtime ignores the attached sandbox backend even while the Docker sandbox remains healthy and the tool is still namedsandbox_exec.This is source-localized and harness-validated against PIN (no Docker required for the mechanism checks):
sandbox_execforwardshost:"gateway";node_execrewrites tonode;resolveExecTargetgateway/elevated drops sandbox backend.What does not explain the “created on 6.11 vs 7.1” half
Comparing tags
v2026.6.11vsv2026.7.1, the focusedsandbox_execalias body is byte-identical. The no-host-pin hole already existed on 6.11. A 6.11→7.1 code change to this alias is not a supported explanation for creation-time divergence.Creation-time (still open)
agents add/applyAgentConfigdo not stamptools.exec.hostor sandbox overrides. Strongest remaining candidate (source only, not live-proven): durable per-agent Codex thread binding / session state — resume can prefer stickybinding.sandbox, while a newly created agent has an empty binding and takes firstthread/startunder current runtime. We did not run live old-vs-new agent A/B here.Ask for owners / reporters
One turn each on old vs new agent, same config, log:
sessionEntry.execHost/execNodethreadId,binding.sandbox, approval/network fingerprintsenabled,backendId, sessionKeynativeToolSurfaceEnabled+ advertised toolsdefaults.sandboxwas attacheduname/pwd(container vs host)Suggested fix direction (not implemented)
Pin
host: "sandbox"onsandbox_exec(mirrornode_exec); fail-closed when sandbox enabled if host would be gateway; no silent elevated→gateway under active sandbox. Defer creation-time policy until the log tuple above attributes the sticky-state hypothesis.LMK if you like to see the full Bug Report. Happy to share.
openclaw-barnacle commentedon Aug 19, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Aug 26, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.