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.
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 |
# File 'lib/claude_agent_sdk/types.rb', line 756 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.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def allow_unsandboxed_commands @allow_unsandboxed_commands end |
#auto_allow_bash_if_sandboxed ⇒ Object
Returns the value of attribute auto_allow_bash_if_sandboxed.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 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.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def enable_weaker_nested_sandbox @enable_weaker_nested_sandbox end |
#enabled ⇒ Object
Returns the value of attribute enabled.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def enabled @enabled end |
#excluded_commands ⇒ Object
Returns the value of attribute excluded_commands.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def excluded_commands @excluded_commands end |
#ignore_violations ⇒ Object
Returns the value of attribute ignore_violations.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def ignore_violations @ignore_violations end |
#network ⇒ Object
Returns the value of attribute network.
752 753 754 |
# File 'lib/claude_agent_sdk/types.rb', line 752 def network @network end |
Instance Method Details
#to_h ⇒ Object
774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 |
# File 'lib/claude_agent_sdk/types.rb', line 774 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 |