ClaudeAgentSDK.Config.Sandbox (claude_agent_sdk v0.18.0)

Copy Markdown View Source

Normalizes sandbox settings for the Claude CLI.

The CLI sandbox settings object uses camelCase keys. This module maps the ergonomic snake_case Elixir keys (atoms or strings) for the known sandbox schema to their camelCase CLI equivalents, while passing any unrecognized key through unchanged — so a map that already uses camelCase keys is preserved verbatim (back-compat with the previous opaque sandbox map behavior).

Recognized schema (Python SandboxSettings / SandboxNetworkConfig):

  • top level: enabled, auto_allow_bash_if_sandboxed, excluded_commands, allow_unsandboxed_commands, network, ignore_violations, enable_weaker_nested_sandbox
  • network: allowed_domains, denied_domains, allow_managed_domains_only, allow_unix_sockets, allow_all_unix_sockets, allow_local_binding, allow_mach_lookup, http_proxy_port, socks_proxy_port
  • ignore_violations: file, network

Summary

Functions

Normalizes a sandbox settings map to the CLI's stringified camelCase shape.

Functions

normalize(sandbox)

@spec normalize(map()) :: map()

Normalizes a sandbox settings map to the CLI's stringified camelCase shape.