native • AI Agent SDK

native: Create an OS-native sandbox configuration.

native

Method

</div>

This is a method of the SandboxConfig class in the config module.

Create an OS-native sandbox configuration.

Uses platform-specific sandboxing:

  • macOS: Seatbelt (sandbox-exec)
  • Linux: Landlock + bubblewrap
  • Fallback: subprocess with restricted security policy

Signature

python
def native(writable_paths: List[str], network: bool) -> 'SandboxConfig'

Parameters

ParamField List[str]

Directories the agent may write to. Defaults to current directory only.

ParamField bool

Whether to allow network access. Defaults to False.

Returns

ResponseField 'SandboxConfig'

:

sandbox = SandboxConfig.native( writable_paths=[“./src”, “./tests”], network=False, )

Uses

  • os.getcwd
  • abspath
  • cls
  • SecurityPolicy

Source

View on GitHub

praisonaiagents/sandbox/config.py at line 181