Class: ClaudeAgentSDK::SandboxSettings
- Inherits:
-
Object
- Object
- ClaudeAgentSDK::SandboxSettings
- Defined in:
- lib/claude_agent_sdk/types.rb
Overview
Sandbox settings for isolated command execution
Instance Attribute Summary collapse
-
#allow_unsandboxed_commands ⇒ Object
Returns the value of attribute allow_unsandboxed_commands.
-
#auto_allow_bash_if_sandboxed ⇒ Object
Returns the value of attribute auto_allow_bash_if_sandboxed.
-
#enable_weaker_nested_sandbox ⇒ Object
Returns the value of attribute enable_weaker_nested_sandbox.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#excluded_commands ⇒ Object
Returns the value of attribute excluded_commands.
-
#ignore_violations ⇒ Object
Returns the value of attribute ignore_violations.
-
#network ⇒ Object
Returns the value of attribute network.
Instance Method Summary collapse
-
#initialize(enabled: nil, auto_allow_bash_if_sandboxed: nil, excluded_commands: nil, allow_unsandboxed_commands: nil, network: nil, ignore_violations: nil, enable_weaker_nested_sandbox: nil) ⇒ SandboxSettings
constructor
A new instance of SandboxSettings.
- #to_h ⇒ Object
Constructor Details
#initialize(enabled: nil, auto_allow_bash_if_sandboxed: nil, excluded_commands: nil, allow_unsandboxed_commands: nil, network: nil, ignore_violations: nil, enable_weaker_nested_sandbox: nil) ⇒ SandboxSettings
Returns a new instance of SandboxSettings.
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 |
# File 'lib/claude_agent_sdk/types.rb', line 709 def initialize( enabled: nil, auto_allow_bash_if_sandboxed: nil, excluded_commands: nil, allow_unsandboxed_commands: nil, network: nil, ignore_violations: nil, enable_weaker_nested_sandbox: nil ) @enabled = enabled @auto_allow_bash_if_sandboxed = auto_allow_bash_if_sandboxed @excluded_commands = excluded_commands # Array of commands to exclude @allow_unsandboxed_commands = allow_unsandboxed_commands @network = network # SandboxNetworkConfig instance @ignore_violations = ignore_violations # SandboxIgnoreViolations instance @enable_weaker_nested_sandbox = enable_weaker_nested_sandbox end |
Instance Attribute Details
#allow_unsandboxed_commands ⇒ Object
Returns the value of attribute allow_unsandboxed_commands.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def allow_unsandboxed_commands @allow_unsandboxed_commands end |
#auto_allow_bash_if_sandboxed ⇒ Object
Returns the value of attribute auto_allow_bash_if_sandboxed.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def auto_allow_bash_if_sandboxed @auto_allow_bash_if_sandboxed end |
#enable_weaker_nested_sandbox ⇒ Object
Returns the value of attribute enable_weaker_nested_sandbox.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def enable_weaker_nested_sandbox @enable_weaker_nested_sandbox end |
#enabled ⇒ Object
Returns the value of attribute enabled.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def enabled @enabled end |
#excluded_commands ⇒ Object
Returns the value of attribute excluded_commands.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def excluded_commands @excluded_commands end |
#ignore_violations ⇒ Object
Returns the value of attribute ignore_violations.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def ignore_violations @ignore_violations end |
#network ⇒ Object
Returns the value of attribute network.
705 706 707 |
# File 'lib/claude_agent_sdk/types.rb', line 705 def network @network end |
Instance Method Details
#to_h ⇒ Object
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 |
# File 'lib/claude_agent_sdk/types.rb', line 727 def to_h result = {} result[:enabled] = @enabled unless @enabled.nil? result[:autoAllowBashIfSandboxed] = @auto_allow_bash_if_sandboxed unless @auto_allow_bash_if_sandboxed.nil? result[:excludedCommands] = @excluded_commands if @excluded_commands result[:allowUnsandboxedCommands] = @allow_unsandboxed_commands unless @allow_unsandboxed_commands.nil? if @network result[:network] = @network.is_a?(SandboxNetworkConfig) ? @network.to_h : @network end if @ignore_violations result[:ignoreViolations] = @ignore_violations.is_a?(SandboxIgnoreViolations) ? @ignore_violations.to_h : @ignore_violations end result[:enableWeakerNestedSandbox] = @enable_weaker_nested_sandbox unless @enable_weaker_nested_sandbox.nil? result end |