session_maker.
Connect the SDK abstractions through a simple, extensible sandbox interface.
ConTree’s stateless execution model differs from a classic stateful sandbox:
filesystem state passes between executions through images and snapshots. This
module assembles clients, sessions, stores, and policies to provide a
familiar sandbox workflow without requiring users to connect each component.
The default lazy session reuses a VM between commands. Snapshots preserve files,
but do not preserve running processes or memory. Advanced users can select or
extend session classes, supply components, and configure policies while keeping
control over execution, state, and resource ownership.
class SandboxConfig
Attributes
str | None
str | None
str | None
str | None
Literal['iam', 'jwt'] | None
Profile | str | None
str | Path | None
type[SyncExecutor | AsyncExecutor] | None
type[
SyncExecutor | AsyncExecutor] | Nonestr | None
str | None
SyncStore | AsyncStore | None
SyncStore | AsyncStore | Nonefloat
str | None
dict[str, str] | None
AbstractCommitPolicy | None
AbstractCommitPolicy | NoneSyncFileTransfer | AsyncFileTransfer | None
SyncFileTransfer | AsyncFileTransfer | Nonedict[str, Any]
ContreeSyncClient | ContreeAsyncClient | None
type[ContreeSyncClient | ContreeAsyncClient] | None
dict[str, Any]
Methods
connection()
ConnectionConfig
resolve_profile()
Profile
validate()
required
None
session_arguments()
required
required
tuple[dict[str, Any], dict[str, Any]]
class SyncSandboxSessionContext
Methods
__enter__()
TypeVar(SyncSessionT, bound= SyncExecutor)
TypeVar(SyncSessionT, bound=
SyncExecutor)class AsyncSandboxSessionContext
Methods
__aenter__()
TypeVar(AsyncSessionT, bound= AsyncExecutor)
TypeVar(AsyncSessionT, bound=
AsyncExecutor)class SandboxSessionContext
Methods
__enter__()
TypeVar(SyncSessionT, bound= SyncExecutor)
TypeVar(SyncSessionT, bound=
SyncExecutor)__aenter__()
TypeVar(AsyncSessionT, bound= AsyncExecutor)
TypeVar(AsyncSessionT, bound=
AsyncExecutor)create_sandbox_session()
default:"None"
SandboxSessionContext[Any, Any]
SandboxSessionContext[Any, Any]A composed context. See session_maker for all configuration parameters.create_sync_sandbox_session()
default:"None"
SyncSandboxSessionContext[Any]
SyncSandboxSessionContext[Any]A synchronous context with the configuration accepted by session_maker.create_async_sandbox_session()
default:"None"
AsyncSandboxSessionContext[Any]
AsyncSandboxSessionContext[Any]An asynchronous context with the configuration accepted by session_maker.session_maker()
required
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"60"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
default:"None"
TypeVar(ContextT)
A single-use context owning its created client, memory store, and session.
Supplied clients, stores, and file transfers remain caller-owned.
profile_from_args()
required
default:"None"
default:"None"
default:"'iam'"
Profile
A regular contree-client Profile.
ValueError – Credentials, URL, or authentication type are invalid.