Sandbox
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| ClaudeCodeBaseModel clawd_code_sdk.models.base Base model for all Claude Code Pydantic models. |
â‹” Inheritance diagram¶
graph TD
1564171539["settings.Sandbox"]
2604142835["base.ClaudeCodeBaseModel"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2604142835 --> 1564171539
3879467795 --> 2604142835
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: ClaudeCodeBaseModel
Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing.
Source code in src/clawd_code_sdk/models/settings.py
2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 | |
allow_apple_events
class-attribute
instance-attribute
¶
Allow sandboxed commands to send Apple Events on macOS (v2.1.181+). Honored only from user, managed, or CLI settings; project settings cannot enable it. See https://code.claude.com/docs/en/sandboxing#limitations
allow_unsandboxed_commands
class-attribute
instance-attribute
¶
Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true. See https://code.claude.com/docs/en/sandboxing#limitations
auto_allow_bash_if_sandboxed
class-attribute
instance-attribute
¶
Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed. See https://code.claude.com/docs/en/sandboxing#sandbox-modes
bwrap_path
class-attribute
instance-attribute
¶
(Managed setting only) Path to custom bubblewrap (bwrap) binary for Linux/WSL sandbox. Overrides default. See https://code.claude.com/docs/en/server-managed-settings
credentials
class-attribute
instance-attribute
¶
credentials: Credentials | None = None
Block sandboxed commands from reading credential files and secret environment variables (v2.1.187+). Entries merge across settings scopes. See https://code.claude.com/docs/en/sandboxing#protect-credentials
enable_weaker_nested_sandbox
class-attribute
instance-attribute
¶
Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable. Default: false (secure). See https://code.claude.com/docs/en/sandboxing#limitations
enable_weaker_network_isolation
class-attribute
instance-attribute
¶
macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/sandboxing
enabled
class-attribute
instance-attribute
¶
Enable sandboxed bash. See https://code.claude.com/docs/en/sandboxing#enable-sandboxing
enabled_platforms
class-attribute
instance-attribute
¶
enabled_platforms: list[Literal["macos", "linux", "wsl", "windows"]] | None = Field(
None, alias="enabledPlatforms"
)
Limit the entire sandbox configuration to the listed platforms. On platforms not in the list the sandbox config is inert: no sandbox, no auto-allow, no startup warning, and no failIfUnavailable exit. When omitted, all supported platforms are included. Only honored from managed (policy) settings.
excluded_commands
class-attribute
instance-attribute
¶
Commands that should never run in the sandbox (e.g., ["git", "docker"]). See https://code.claude.com/docs/en/sandboxing#configure-sandboxing
fail_if_unavailable
class-attribute
instance-attribute
¶
When true, make sandbox startup a hard failure if required sandbox dependencies are missing. Default: false (sandbox is skipped with a warning). See https://code.claude.com/docs/en/sandboxing#enable-sandboxing
filesystem
class-attribute
instance-attribute
¶
filesystem: Filesystem | None = None
Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation
ignore_violations
class-attribute
instance-attribute
¶
Map of command patterns to filesystem paths to ignore violations for. Use "*" to match all commands
network
class-attribute
instance-attribute
¶
network: Network | None = None
Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.
ripgrep
class-attribute
instance-attribute
¶
ripgrep: Ripgrep | None = None
Custom ripgrep configuration for Claude Code's bundled ripgrep support. Overrides the bundled binary and arguments.
socat_path
class-attribute
instance-attribute
¶
(Managed setting only) Path to custom socat binary for Linux/WSL network proxying. Overrides default. See https://code.claude.com/docs/en/server-managed-settings