Provider data contracts
Execution statuses
Exports
Sandbox
Declare one lazy sandbox usable by managed ADK and LangGraph agents. A sandbox is a code-execution boundary, not a policy label. The backend returned byfactory implements SandboxBackend.execute and owns the
actual isolation guarantees. Legacy ADK executors remain ADK-only providers.
Compilation never connects to provider infrastructure.
Obtain this object from the owning Harnest API; its constructor includes runtime bindings.
Fields (— means no declared default):
Example
Example
Sandbox.provider
adapter_options
configures only the native framework adapter, while JSON metadata and an
optional network policy are forwarded to each request. A policy requires
provider capability declarations.
Parameters and example
Parameters and example
Sandbox.to_adk_executor
Example
Example
Sandbox.to_langchain_tool
Example
Example
Sandbox.build
Example
Example
SandboxBackend
Execute in an isolated provider, never by evaluating code on the host. Implementations own isolation, deadlines, file handling, concurrency, resource cleanup, and user/session separation. Compilation never invokes this method.Example
Example
SandboxBackend.execute
Parameters and example
Parameters and example
SandboxBudget
Request finite compute, memory, process, and scratch-space limits.— means no declared default):
Parameters and example
Parameters and example
SandboxCancelledError
An execution lost its caller or its managed invocation authority.Example
Example
SandboxContext
Supply optional invocation identity without exposing a native runtime. Providers may use this identity for tenant isolation. Direct adapter calls outside a runtime have no identity; providers requiring it must reject them.— means no declared default):
Parameters and example
Parameters and example
SandboxExecutionError
A provider failed without exposing its private exception payload.Example
Example
SandboxFile
Carry a file across an executor boundary without granting host access. String content is base64-encoded; bytes are the original file content. Providers own path validation and must never interpret names as host paths.— means no declared default):
Parameters and example
Parameters and example
SandboxInputFilesUnsupportedError
A provider explicitly cannot materialize the requested input files.Example
Example
SandboxNetworkMode
Describe the outbound network authority granted to one sandbox.Example
Example
SandboxNetworkPolicy
Declare provider-enforced outbound access without assuming its mechanism. Allowlist entries are exact DNS names or IP literals. Providers must apply the policy to every connection and resolution, not only to the initial URL.— means no declared default):
Parameters and example
Parameters and example
SandboxNetworkPolicy.none
Example
Example
SandboxNetworkPolicy.unrestricted
Parameters and example
Parameters and example
SandboxNetworkPolicy.allowlist
Parameters and example
Parameters and example
SandboxPolicyUnsupportedError
A provider cannot enforce an explicitly requested sandbox policy.Example
Example
SandboxProvider
A portable backend that declares its enforceable sandbox policy.— means no declared default):
Example
Example
SandboxProvider.execute
Parameters and example
Parameters and example
SandboxProviderCapabilities
Advertise network controls a provider enforces below agent code.— means no declared default):
Parameters and example
Parameters and example
SandboxProviderCapabilities.require
Parameters and example
Parameters and example
SandboxRequest
Describe one Python execution; the provider enforces its timeout.— means no declared default):
Parameters and example
Parameters and example
SandboxResult
Return execution output without coupling providers to ADK or LangChain.— means no declared default):
Parameters and example
Parameters and example
SandboxStatus
Provider-reported outcome; stderr alone does not mean execution failed.Example
Example
cleanup_control
Admit resource release under a fresh finite deadline, never execution. Provider I/O must use remaining() as its transport timeout and check() before each side effect. This cooperative scope cannot interrupt arbitrary Python. Nested cleanup inherits the original cleanup deadline and cannot renew it.Parameters and example
Parameters and example
control
Public provider controls, exported through harnest.sandbox.control.Example
Example
control.execute
Parameters and example
Parameters and example
control.cleanup
Parameters and example
Parameters and example
control.current
Example
Example