Summary
OpenClaude exposes a sandbox-disabling flag (dangerouslyDisableSandbox) directly in the BashTool input schema, allowing the LLM itself to toggle sandboxing behavior.
When combined with the default allowUnsandboxedCommands: true setting, a prompt-injected model can disable the sandbox and execute arbitrary commands on the host, resulting in full code execution risk.
Affected context
This vulnerability affects OpenClaude setups where:
- The BashTool is enabled and available to the LLM agent
- The
dangerouslyDisableSandboxflag is part of the tool input schema allowUnsandboxedCommandsis set totrue(the default in affected versions)- The LLM is treated as an untrusted or semi-trusted principal and can be influenced by user prompts or external content
In such contexts, the LLM can modify its own tool inputs to disable sandboxing at runtime, undermining the host protection model.
Exploit preconditions
- Attack surface: LLM tool-use interface exposed through OpenClaude's command line or integrated environments.
- Required access: Ability to provide prompts or content that the LLM processes; no direct shell access is required.
- Trigger point: Any BashTool invocation where the LLM controls or can influence the
dangerouslyDisableSandboxfield whileallowUnsandboxedCommandsremainstrue. - Why exploitation is possible: Sandbox controls are modeled as regular, writable tool inputs instead of being enforced as out-of-band policy or configuration, allowing an untrusted LLM to elevate its own execution capabilities.
Why this happens
The core issue is a misplacement of trust and control over security-critical configuration.
A parameter intended to guard execution safety (dangerouslyDisableSandbox) is exposed as part of the BashTool input schema, which is directly controlled by the LLM agent.
This maps to CWE-284: Improper Access Control, because an untrusted principal can change a high-privilege security setting, and is also related to CWE-306 where proper enforcement of operational restrictions is missing in practice.
Rather than enforcing sandbox boundaries as immutable, host-controlled policy, the design treats them as data-level fields that any tool_use response may set, enabling a prompt-injected or compromised model to disable isolation and run arbitrary commands on the host.
Potential impact
- Full remote code execution on the host machine running OpenClaude
- Execution of arbitrary shell commands with the privileges of the OpenClaude process
- Reading, modifying, or deleting local files accessible to the OpenClaude runtime
- Exfiltration of credentials, API keys, SSH keys, and other secrets present on the system
- Use of the compromised host as a pivot point for lateral movement within a network
- Manipulation or poisoning of local development environments, build artifacts, or source code
General mitigation guidance
Effective mitigation focuses on separating security policy from LLM-controlled inputs and enforcing sandboxing at a layer the model cannot directly modify.
Recommended defensive patterns include:
- Treat sandbox flags and execution policies as trusted configuration, not as tool parameters; they should be set by operators or configuration files, not by the model.
- Encapsulate command execution behind a strict policy engine that validates requested operations against allowlists or high-level capabilities instead of raw shell access.
- Apply a default-deny stance for unsandboxed commands; require explicit, out-of-band approval or configuration to allow them.
- Run the command execution subsystem under least-privilege OS accounts, with constrained file-system and network permissions to reduce impact if boundaries fail.
- Introduce explicit human-in-the-loop approval for high-risk actions where sandboxing would otherwise be bypassed or weakened.
- Clearly separate "dangerous" operations into distinct tools or workflows that are only available in hardened or interactive contexts, not in unattended agent runs.
How teams detect issues like this
Detection can rely on both code-centric and runtime-oriented approaches:
- Static analysis / configuration review:
- Search for security-critical flags (e.g., sandbox toggles, debug bypasses) appearing in tool schemas, model-facing APIs, or any data structures influenced by LLM output.
- Flag patterns where security controls are represented as ordinary, user- or model-writable fields rather than as configuration or environment-level settings.
- Review YAML/JSON schemas for tools to ensure that fields impacting isolation, authentication, or authorization are not model-controlled.
- Code review signals:
- Attention points where tool invocation structs are populated directly from LLM responses without a policy gate.
- Any code path where a boolean or enum governing sandbox/unsafe execution is assigned based solely on model output.
- Runtime monitoring:
- Log and monitor when sandbox-disabling flags are toggled or when unsandboxed execution paths are taken.
- Alert on unexpected spikes in shell command volume, file-system access, or network activity originating from the LLM agent process.
- Automated tooling:
- Use security linters or custom rules in CI pipelines to detect exposure of sensitive configuration in public tool schemas.
- Incorporate policy-as-code checks (e.g., Open Policy Agent or similar) to ensure sandbox rules are enforced independently of LLM behavior.

