Expand description
Sandboxes: where tools run commands and code and read and write files.
Sandbox: the execution environment trait, withExecuteOptionsand theExecutionStreamofStreamChunks ending in anExecutionResult.PosixShellSandbox: a sandbox that only needs a POSIX shell; code execution and file operations run as shell commands.NotASandboxLocalEnvironment: the host itself, with no isolation, and the agent’s default.
Sandbox failures are the SandboxTimeoutError,
SandboxAbortError,
SandboxPathNotFoundError,
SandboxIsADirectoryError and
SandboxPermissionError variants of Error.
Structs§
- Execute
Options - Options for command and code execution (
ExecuteOptions). - Execution
Result - The result of a command or code execution (
ExecutionResult). - File
Info - Metadata about a file or directory in a sandbox (
FileInfo). - NotA
Sandbox Local Environment - Runs commands and file operations directly on the host, with no isolation
(
NotASandboxLocalEnvironment). The agent’s default when no sandbox is configured. - Output
File - A file produced by code execution, such as a chart or a PDF (
OutputFile). - Stream
Chunk - A chunk of output from a running command or code execution (
StreamChunk).
Enums§
- Execution
Stream Item - An item of an execution stream: a
StreamChunkor the finalExecutionResult. - Stream
Type - Which output stream a
StreamChunkcame from (StreamType).
Constants§
- ENV_
KEY_ PATTERN - The pattern an environment variable name must match (
ENV_KEY_PATTERN): a letter or underscore, then letters, digits or underscores (POSIX names). - LANGUAGE_
PATTERN - The pattern a language or interpreter name must match (
LANGUAGE_PATTERN): letters, digits, dots, hyphens and underscores. Path separators, spaces and shell metacharacters are rejected.
Traits§
- Into
Sandbox - What the builder’s
sandbox(..)setter takes: a sandbox by value, anArcof one, or anArc<dyn Sandbox>(kept as is, so the agent’ssandboxis the same instance). - Posix
Shell Sandbox - A sandbox where only a POSIX shell is available, such as a container, an SSH connection or a
cloud runtime (
PosixShellSandbox). - Sandbox
- An execution environment: where tools run commands and code and read and write files
(
Sandbox).
Functions§
- build_
shell_ env_ prefix - Builds the
export KEY='value' &&prefix that appliesenvto a shell command, or""when there is none. - shell_
quote - Shell-escapes a value for a POSIX shell command.
- validate_
env_ keys - Checks environment variable names against
ENV_KEY_PATTERN.
Type Aliases§
- Execution
Stream - The stream returned by
Sandbox::execute_streamingandSandbox::execute_code_streaming: output chunks followed by one finalExecutionResult, or an error.