PassthroughSandbox#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- class zett_agent.sandbox.passthrough.PassthroughSandbox(policy=None, *, memory_strategy=MemoryStrategy.AUTO)[source]#
Run commands with no isolation, behind the same interface as a real sandbox.
The policy is not enforced: the process can read and write whatever the user can and can use the network. What it still gives is everything the
Sandboxinterface promises around the process: the filtered environment, the time limit, the output cap, and stopping the whole process tree. That keeps a host’s code identical on every platform, withisolatedtelling the truth about the boundary.It is what
create_sandbox()returns on a platform that is neither macOS, Linux nor Windows, and it warns when it does.WindowsSandboxis this class under the name of the platform that needs it most. It is never chosen in place of a backend that exists but cannot run.Examples
Run with no isolation, deliberately:
sandbox = PassthroughSandbox() result = await sandbox.run("echo hello") assert not result.isolated
Warning
This is not a sandbox. A command run through it has the full authority of the host process.
- Parameters:
policy (SandboxPolicy | None)
memory_strategy (MemoryStrategy | str)
- name: ClassVar[str] = 'passthrough'#
Short stable name of the backend, reported in results.
- isolated: ClassVar[bool] = False#
Whether this backend enforces a boundary. False only for the backend that runs commands as they are.