Models¶
The payloads of the daemon API, as Pydantic models: field names are those of
docker-sandbox, unknown fields of a newer daemon are kept (extra="allow"),
and request models have the constructors of the library as class methods. A
few models keep only their own fields: the items of a creation stream
(CreateProgress, CreateResult, CreateFailure, CreateUnknown, which
holds an unknown line whole), the output of an interactive session
(OutputChunk, AttachOutput) and the images of a kit package
(PackageImage). Every model is imported from fastsandbox.models; the most
used are also exported by fastsandbox itself.
Sandboxes¶
Creation requests, their progress and result, the state of a sandbox, mounts and ports.
fastsandbox.models.Created
¶
Bases: Model
Outcome of a successful creation.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Identifier assigned by the daemon. |
name |
str
|
Sandbox name. |
agent |
str
|
Agent of the base kit. |
status |
str
|
Runtime state right after creation. |
workspace |
str
|
Workspace directory, empty when there is none. |
mcp |
McpGateway | None
|
MCP gateway of the sandbox. |
withheld |
list[str]
|
Services whose credential, declared by a kit of the sandbox, the daemon does not authorize: the proxy injects nothing for them. Empty when the kits declare no credential or every one is authorized. |
fastsandbox.models.CreateEvent
module-attribute
¶
CreateEvent = Annotated[CreateProgress | CreateResult | CreateFailure | CreateUnknown, Field(discriminator='type')]
An item of the progress stream of a creation.
fastsandbox.models.CreateFailure
¶
fastsandbox.models.parse_create_event
¶
parse_create_event(line: str) -> CreateEvent | None
The creation event of one line of the stream of a creation, or None for a blank line.
The daemon streams a creation as JSON lines: progress, then the result or the failure. A
program that relays the stream of the daemon itself reads its lines with this function, as
Sandboxes.create_stream does; a failure is a line, the daemon answering HTTP 200.
Example
event = parse_create_event('{"error": "image is not cached locally"}') (event.type, event.message) ('error', 'image is not cached locally')
Raises:
| Type | Description |
|---|---|
ProtocolError
|
For a line that is not JSON, or a |
fastsandbox.models.CreateProgress
¶
fastsandbox.models.CreateRequest
¶
Bases: Model
The creation request of a sandbox.
A kit package gives the request of its kit (KitPackage.request); adjust
it with model_copy(update=…) or the with_* methods.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Sandbox name. |
agent |
str
|
Agent of the base kit, e.g. |
kits |
list[str]
|
Kit references, base kit first. |
kit_artifacts |
list[Any]
|
Resolved kit artifacts, one per kit; opaque. |
pull_policy |
PullPolicy | None
|
When to pull kit images. |
template |
str | None
|
Image the sandbox starts from instead of the image of its
agent, such as one saved with |
cpus |
int | None
|
Number of virtual CPUs. |
memory |
str | None
|
Memory limit in |
workspace |
str | None
|
Host directory bind-mounted as workspace, at the same path inside the sandbox. |
additional_workspaces |
list[Workspace]
|
Further host directories or files to mount. |
clone |
bool
|
Whether the agent works on a private clone of the Git repository of the workspace. |
environment |
dict[str, str]
|
Environment variables of the sandbox. |
ports |
list[PortBinding]
|
Ports published from the start. |
skills |
SkillsMode | None
|
How the shared skills store reaches the sandbox. |
profile |
str | None
|
Governance profile of the sandbox. |
mcp |
Any
|
MCP gateway configuration, e.g. |
bindings_path |
str | None
|
Host file recording the credentials the user approved. |
ssh_agent_socket_path |
str | None
|
Host SSH agent socket to forward. |
enable_virtiofs_cache |
bool | None
|
Enables the virtio-fs cache for workspace mounts. |
for_agent
classmethod
¶
for_agent(name: str, agent: str) -> CreateRequest
The creation request of the sandbox name for the agent agent, as a forger makes it.
It names no kit yet, and the images are pulled when missing: the forger sets kits
and kit_artifacts, one artifact per kit, base kit first. The name {{name}} makes it
the request of every sandbox of a kit package (KitPackage.in_memory).
with_workspace
¶
with_workspace(dir: str) -> CreateRequest
The request, with dir of the host mounted as workspace.
with_cloned_workspace
¶
with_cloned_workspace(repository: str) -> CreateRequest
The request, with the agent working on a private Git clone.
The clone is of the repository repository of the host.
with_additional_workspace
¶
with_additional_workspace(workspace: Workspace) -> CreateRequest
The request, with one more mounted directory or file.
with_port
¶
with_port(port: PortBinding) -> CreateRequest
The request, with one more port published from the start.
with_env
¶
with_env(**variables: str) -> CreateRequest
The request, with more environment variables.
with_proxied_key
¶
with_proxied_key(key: ProxiedKey) -> CreateRequest
The request, with the placeholder of key in the variable it names.
The key itself goes with Sandbox.push_proxied_keys, once the sandbox exists.
with_static_mcp_servers
¶
with_static_mcp_servers(*servers: str) -> CreateRequest
The request, with an MCP gateway fixed to servers.
fastsandbox.models.CreateResult
¶
fastsandbox.models.CreateUnknown
¶
fastsandbox.models.HostMount
¶
fastsandbox.models.PortBinding
¶
Bases: Model
A port published from a sandbox to the host.
Attributes:
| Name | Type | Description |
|---|---|---|
sandbox_port |
int
|
Port inside the sandbox. |
host_port |
int
|
Port on the host. |
host_ip |
str | None
|
Address bound on the host; the daemon defaults to |
protocol |
str | None
|
Protocol, e.g. |
tcp
classmethod
¶
tcp(sandbox_port: int, host_port: int, host_ip: str | None = None) -> PortBinding
A TCP port.
udp
classmethod
¶
udp(sandbox_port: int, host_port: int, host_ip: str | None = None) -> PortBinding
A UDP port.
fastsandbox.models.RuntimeMount
¶
fastsandbox.models.SandboxInfo
¶
Bases: Model
A sandbox, as the daemon describes it.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Identifier assigned by the daemon; it guards deletion against a sandbox that took the same name. |
name |
str
|
Sandbox name. |
agent |
str
|
Agent of the base kit, e.g. |
status |
str
|
Runtime state, e.g. |
created_at |
str | None
|
Creation time (RFC 3339). |
last_used_at |
str | None
|
Time of last use (RFC 3339). |
workspace |
str
|
Host directory bind-mounted as workspace, empty when none. |
working_dir |
str | None
|
Working directory recorded for the sandbox. |
effective_working_dir |
str | None
|
Working directory actually used inside it. |
cpus |
int | None
|
Number of virtual CPUs, when set explicitly. |
memory |
str | None
|
Memory limit, when set explicitly ( |
host_mounts |
list[HostMount]
|
Host directories mounted into the sandbox. |
runtime_mounts |
list[RuntimeMount]
|
Host paths granted at run time. |
ports |
list[PortBinding]
|
Published ports, in single-sandbox answers only. |
labels |
dict[str, str]
|
Container labels set by |
credential_sources |
dict[str, Any]
|
Service credentials configured, by service. |
fastsandbox.models.SandboxState
¶
Bases: StrEnum
The runtime states of a sandbox the library names.
The daemon may report others, kept as plain strings.
fastsandbox.models.SavedImage
¶
fastsandbox.models.SkillsMode
¶
fastsandbox.models.SwapOutcome
¶
fastsandbox.models.SwapRequest
¶
Bases: Model
A container swap: the complete kit list of the new container.
Attributes:
| Name | Type | Description |
|---|---|---|
docker_name_override |
str
|
Name of the replacement container. |
kit_artifacts |
list[Any]
|
Resolved artifacts of the complete kit list; opaque. |
kit_refs |
list[str]
|
References of the complete kit list, base kit first. |
fastsandbox.models.Workspace
¶
Bases: Model
A further host directory or file bind-mounted into a sandbox.
Attributes:
| Name | Type | Description |
|---|---|---|
dir |
str
|
Directory or file on the host, by its real absolute path. |
read_only |
bool
|
Whether the sandbox can only read it. |
target |
str | None
|
Absolute path inside the sandbox; the path of |
Commands¶
Command specifications, their outputs and states, interactive sessions.
fastsandbox.models.AgentSessionSpec
¶
Bases: Model
A session with the agent of the sandbox kit.
Attributes:
| Name | Type | Description |
|---|---|---|
args |
list[str]
|
Arguments of the agent, as |
tty |
bool
|
Allocates a pseudo-terminal; agents generally expect one. |
terminal_size |
TerminalSize | None
|
Initial terminal size, when |
working_dir |
str | None
|
Working directory; the sandbox's by default. |
env |
dict[str, str]
|
Additional environment variables. |
ssh_agent_socket_path |
str | None
|
Host SSH agent socket to forward. |
fastsandbox.models.AttachOutput
¶
fastsandbox.models.AttachSpec
¶
Bases: Model
An interactive command.
Attributes:
| Name | Type | Description |
|---|---|---|
cmd |
list[str]
|
Program and arguments, not interpreted by a shell. |
user |
str | None
|
User name or UID ( |
working_dir |
str | None
|
Working directory. |
env |
dict[str, str]
|
Additional environment variables. |
tty |
bool
|
Allocates a pseudo-terminal; the output is then a single stream. |
terminal_size |
TerminalSize | None
|
Initial terminal size, when |
fastsandbox.models.ExecInspect
¶
fastsandbox.models.ExecOutput
¶
fastsandbox.models.ExecSpec
¶
Bases: Model
A command to run to completion inside a sandbox.
Attributes:
| Name | Type | Description |
|---|---|---|
cmd |
list[str]
|
Program and arguments, not interpreted by a shell. |
user |
str | None
|
User name or UID ( |
working_dir |
str | None
|
Working directory; the kit's by default. |
env |
dict[str, str]
|
Additional environment variables. |
fastsandbox.models.OutputChunk
¶
fastsandbox.models.TerminalSize
¶
Credentials¶
Credentials pushed to a sandbox and the secrets of the daemon.
fastsandbox.models.CredentialSource
¶
fastsandbox.models.CredentialsOutcome
¶
Bases: Model
Outcome of a credentials update pushed to a sandbox.
The daemon accepts an update even when it withholds what it carries: read
withheld to know which services get nothing.
Attributes:
| Name | Type | Description |
|---|---|---|
message |
str | None
|
Human-readable message, e.g. |
withheld |
list[str]
|
Services whose credential, declared by a kit of the sandbox, the daemon does not authorize: the proxy injects nothing for them, a value just pushed included. |
credential_source_updates_applied |
bool | None
|
Whether the credential sources of the update
were applied; |
fastsandbox.models.CredentialsUpdate
¶
Bases: Model
An update of the credentials of a sandbox.
Attributes:
| Name | Type | Description |
|---|---|---|
custom_secrets |
list[CustomSecret] | None
|
Proxy-injected secrets: |
credential_values |
list[ServiceCredential]
|
Credentials for services known to |
credential_sources |
dict[str, CredentialSource]
|
How each service credential is resolved. |
removed_credential_sources |
list[str]
|
Services whose source is removed. |
with_custom_secret
¶
with_custom_secret(secret: CustomSecret) -> CredentialsUpdate
The update, with one more custom secret.
without_custom_secrets
¶
without_custom_secrets() -> CredentialsUpdate
The update, removing every custom secret of the sandbox.
with_service_credential
¶
with_service_credential(service: str, value: str | SecretStr) -> CredentialsUpdate
The update, with the credential of service, given as text or as a SecretStr.
with_credential_source
¶
with_credential_source(service: str, source: CredentialSource) -> CredentialsUpdate
The update, resolving the credential of service from source.
without_credential_source
¶
without_credential_source(service: str) -> CredentialsUpdate
The update, removing the source of service.
with_sandbox_secret
¶
with_sandbox_secret(sandbox: str, service: str, value: str) -> CredentialsUpdate
The update, storing value as the sandbox secret of service.
As sbx secret set does, for the sandbox sandbox.
without_sandbox_secret
¶
without_sandbox_secret(service: str) -> CredentialsUpdate
The update, removing the stored secret of service.
fastsandbox.models.CustomSecret
¶
Bases: Model
A secret the sandbox proxy injects into requests to targets.
The sandbox only sees the placeholder sentinel.
Attributes:
| Name | Type | Description |
|---|---|---|
env_name |
str | None
|
Environment variable the placeholder is meant for, recorded with the
secret; the daemon sets no such variable in the sandbox, its creation request
does ( |
sentinel |
str
|
Placeholder visible inside the sandbox. |
target |
str
|
Primary target host. |
targets |
list[str]
|
Every host or pattern the real value is sent to. |
value |
SecretStr
|
The real value, never printed. |
fastsandbox.models.ServiceCredential
¶
Network policy¶
Rules, checks and the activity log of the network policy.
fastsandbox.models.CheckResult
¶
Bases: Model
Decision of the policy for a network check.
Attributes:
| Name | Type | Description |
|---|---|---|
allowed |
bool
|
Whether the target is allowed. |
rule |
str | None
|
Rule that decided. |
action |
str | None
|
Action checked, e.g. |
resource_type |
str | None
|
Kind of resource matched, e.g. |
resource_value |
str | None
|
Resource matched, e.g. |
target |
str | None
|
Normalized target. |
context |
str | None
|
Scope of the decision, e.g. |
governance |
Any
|
Organization governance state. |
fastsandbox.models.CreatedRule
¶
fastsandbox.models.Decision
¶
fastsandbox.models.HostActivity
¶
Bases: Model
Traffic of one sandbox to one host.
Attributes:
| Name | Type | Description |
|---|---|---|
host |
str
|
Host and port, e.g. |
vm_name |
str | None
|
Sandbox the traffic came from. |
count_since |
int
|
Number of connections since |
since |
str | None
|
Start of the count (RFC 3339). |
last_seen |
str | None
|
Last connection (RFC 3339). |
proxy_type |
str | None
|
How the proxy handled the traffic, e.g. |
rule |
str | None
|
Rule that decided, when one did. |
reason |
str | None
|
Why the traffic was blocked, for a blocked host. |
fastsandbox.models.HttpTarget
¶
fastsandbox.models.NetworkCheck
¶
fastsandbox.models.NetworkLog
¶
Bases: Model
Hosts the sandboxes reached or were refused.
Attributes:
| Name | Type | Description |
|---|---|---|
allowed_hosts |
list[HostActivity]
|
Hosts that were allowed. |
blocked_hosts |
list[HostActivity]
|
Hosts that were blocked. |
fastsandbox.models.NetworkRule
¶
Bases: Model
A rule of the policy: network, HTTP or file system access.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Rule identifier. |
name |
str
|
Rule name, the identifier for added rules. |
decision |
str
|
|
actions |
list[str]
|
Actions the rule governs, e.g. |
resources |
list[str]
|
Hosts or patterns it applies to; |
resource_type |
str | None
|
Kind of resource: |
scope |
str | None
|
|
applies_to |
str | None
|
What the rule applies to: |
sandbox_id |
str | None
|
Sandbox of a sandbox-scoped rule. |
methods |
list[str]
|
HTTP methods of an HTTP rule. |
http_targets |
list[HttpTarget]
|
Hosts and paths of an HTTP rule. |
editable |
bool
|
Whether the rule can be changed or removed. |
origin |
str | None
|
Where the rule comes from: |
layer |
str | None
|
Policy layer of the rule. |
policy_id |
str | None
|
Policy the rule belongs to. |
status |
str | None
|
Rule state, e.g. |
provenance |
Any
|
How the rule was created. |
fastsandbox.models.NetworkRules
¶
Bases: Model
The rules in force.
Attributes:
| Name | Type | Description |
|---|---|---|
governance_active |
bool
|
Whether an organization policy governs the rules. |
rules |
list[NetworkRule]
|
Every rule, global and sandbox-scoped. |
fastsandbox.models.RuleChange
¶
Bases: Model
A change to the network rules.
Build one with the class methods, then scope it with for_sandbox.
Attributes:
| Name | Type | Description |
|---|---|---|
action |
RuleAction
|
What the change does. |
resources |
list[str]
|
Hosts or patterns it applies to. |
id |
str | None
|
Rule removed by |
protocols |
list[Protocol]
|
Protocols of an allow or deny rule. |
methods |
list[str]
|
HTTP methods of an HTTP rule. |
path |
str | None
|
Path pattern of an HTTP rule. |
sandbox_id |
str | None
|
Sandbox the change is scoped to; global when unset. |
allow
classmethod
¶
allow(*resources: str) -> RuleChange
Allows TCP connections to the hosts or patterns.
deny
classmethod
¶
deny(*resources: str) -> RuleChange
Denies TCP and UDP connections to the hosts or patterns.
allow_http
classmethod
¶
allow_http(*resources: str) -> RuleChange
Allows HTTP requests to the hosts or patterns, on every path (/**).
with_path narrows the path, with_methods names the methods.
deny_http
classmethod
¶
deny_http(*resources: str) -> RuleChange
Denies HTTP requests to the hosts or patterns, on every path (/**).
with_path narrows the path, with_methods names the methods.
remove
classmethod
¶
remove(*resources: str) -> RuleChange
Removes the rules added for the resources.
with_protocols
¶
with_protocols(*protocols: Protocol | str) -> RuleChange
The change, for the given protocols.
fastsandbox.models.HostPattern
¶
Bases: str
A host a network rule names, checked as the CLI checks it: the text itself, as a str.
The forms the CLI accepts:
- an exact domain,
example.com, with globs inside its labels:?for one character,[12]or[!1]for a class; - leading wildcard labels:
*.example.comfor one label,**.example.comfor any number; - an IPv4 address, or a CIDR prefix,
10.0.0.0/8or2001:db8::1/128; - any of those with a port,
example.com:443; an IPv6 address takes its port in brackets,[2001:db8::1]:443; **, every host.
HostPattern(text), or HostPattern.parse(text), checks the text without the daemon, as a
program checks the hosts it is given before it writes a rule.
Example
HostPattern(".githubusercontent.com") '.githubusercontent.com' HostPattern("https://api.github.com") Traceback (most recent call last): ... InvalidHostPatternError: invalid host pattern "https://api.github.com": a host, not a URL...
Raises:
| Type | Description |
|---|---|
InvalidHostPatternError
|
For a text in none of those forms: empty, with spaces, a URL, a
path, a bare |
fastsandbox.models.RuleChangeResult
¶
Bases: Model
Outcome of one rule change.
Attributes:
| Name | Type | Description |
|---|---|---|
action |
str
|
Action that was applied, as the daemon names it. |
error |
str | None
|
Why the change failed, e.g. an unknown rule identifier. |
id |
str | None
|
Rule identifier of a removal by identifier. |
resources |
list[str]
|
Resources it was applied to. |
sandbox_id |
str | None
|
Sandbox it was scoped to. |
created |
list[CreatedRule]
|
Rules created by the change. |
check
¶
check() -> RuleChangeResult
The result itself, or OperationFailedError when it did not apply.
Images¶
Images of the daemon and the progress of a pull.
fastsandbox.models.ImageInspect
¶
Bases: Model
Details of an image.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Image identifier ( |
agent |
str | None
|
Agent of the kit the image belongs to, when known. |
cmd |
list[str]
|
Default command. |
entrypoint |
list[str]
|
Entrypoint. |
user |
str | None
|
Default user. |
created_at |
str | None
|
Creation time (RFC 3339). |
fastsandbox.models.ImageSummary
¶
Bases: Model
An image of the daemon.
Attributes:
| Name | Type | Description |
|---|---|---|
repository |
str
|
Repository, e.g. |
tag |
str | None
|
Tag, absent for images only referenced by digest. |
id |
str
|
Image identifier ( |
digest |
str | None
|
Content digest ( |
size |
int | None
|
Size in bytes. |
created_at |
str | None
|
Creation time (RFC 3339). |
agent |
str | None
|
Agent of the kit the image belongs to, when known. |
fastsandbox.models.LocalImageMetadata
¶
fastsandbox.models.ProgressDetail
¶
fastsandbox.models.PullProgress
¶
Bases: Model
One line of the progress of an image pull.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str | None
|
Layer the line refers to, when it refers to one. |
status |
str | None
|
What happens, e.g. |
progress_detail |
ProgressDetail | None
|
Byte counts of the layer. |
error |
str | None
|
Failure of the pull, always the last line of a failed stream. |
MCP¶
The MCP gateway and the servers registered with it.
fastsandbox.models.GatewayMode
¶
fastsandbox.models.LoadedServer
¶
fastsandbox.models.McpGateway
¶
Bases: Model
MCP gateway of a sandbox.
Attributes:
| Name | Type | Description |
|---|---|---|
state |
str | None
|
Gateway state, e.g. |
url |
str | None
|
Gateway URL as seen from inside the sandbox. |
port |
int | None
|
Port of the gateway on the host. |
static_servers |
bool
|
Whether the set of servers was fixed at creation. |
servers |
list[str]
|
Servers loaded into the gateway. |
fastsandbox.models.McpServerCheck
¶
Bases: Model
An MCP server to check against the MCP policy.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Server name. |
kind |
McpServerKind
|
Where the server runs. |
command |
list[str]
|
Program and arguments of a local server. |
url |
str | None
|
URL of a remote server. |
local
classmethod
¶
local(name: str, command: list[str]) -> McpServerCheck
A server started on the host by command.
fastsandbox.models.RegistrationCheck
¶
Daemon¶
Health, information, settings and disk usage of the daemon.
fastsandbox.models.DaemonInfo
¶
fastsandbox.models.DiskUsage
¶
fastsandbox.models.DiskUsageSummary
¶
Bases: Model
Disk usage totals for one resource type.
Attributes:
| Name | Type | Description |
|---|---|---|
resource_type |
str
|
Resource type, e.g. |
total_count |
int
|
Number of resources. |
active |
int
|
Number of resources in use. |
size |
int
|
Total size in bytes. |
reclaimable |
int
|
Size that could be reclaimed, in bytes. |
fastsandbox.models.Health
¶
Bases: Model
Health of the daemon.
Attributes:
| Name | Type | Description |
|---|---|---|
status |
str
|
Overall status, |
version |
str
|
Release version, e.g. |
api_version |
str
|
Version of the daemon API, e.g. |
revision |
str | None
|
Source revision of the release. |
release |
bool | None
|
Whether this is a release build. |
fastsandbox.models.Setting
¶
Bases: Model
A daemon setting.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
Setting key, e.g. |
value |
Any
|
Effective value. |
default |
Any
|
Default value. |
source |
str | None
|
Where the effective value comes from: |
value_type |
str | None
|
Value type: |
description |
str | None
|
Human-readable description. |
Events¶
The events of the daemon.
fastsandbox.models.DaemonEvent
¶
Bases: Model
An event published by the daemon.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique event identifier. |
event_type |
str
|
Event family, e.g. |
action |
str
|
What happened, e.g. |
timestamp |
str | None
|
Emission time (RFC 3339). |
sandbox_name |
str | None
|
Sandbox the event refers to, if any. |
sandbox_id |
str | None
|
Identifier of that sandbox, if any. |
seq |
int | None
|
Per-sandbox sequence number, if any. |
data |
Any
|
Event-specific payload. |
Prompts¶
The approval prompts of the daemon.
fastsandbox.models.PromptEvent
¶
Kits¶
What a kit package records.
fastsandbox.models.PackageImage
¶
Bases: BaseModel
An image archive of a kit package.
The images a package lists (KitPackage.images) name their archive without holding it:
KitPackage.image_archive(index) reads it. An image made with PackageImage.in_memory
holds its archive, for a package assembled by hand (KitPackage.in_memory).
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str | None
|
Path of the archive, |
reference |
str | None
|
Reference the archive loads as, when known. |
size |
int | None
|
Size of the archive in bytes, of the file or of the bytes held in memory, when known. |
archive
property
¶
archive: bytes | None
The archive this image holds, made with in_memory; None for a listed image.
in_memory
classmethod
¶
in_memory(reference: str, archive: bytes) -> PackageImage
An image whose archive archive is held in memory, loaded under reference.
The daemon loads it under reference when it does not hold an image of that reference
yet: an image it holds is not loaded again.
Sandbox specs¶
What a launch from a sandbox spec did.
fastsandbox.models.Report
¶
Bases: Model
What a launch did. It never holds the value of a key or of a token.
Attributes:
| Name | Type | Description |
|---|---|---|
kits |
list[str]
|
The kits of the sandbox, by reference: its base kit, then its mixins, the
generated ones included ( |
network |
NetworkReport
|
The network rules of the spec. |
keys |
list[KeyReport]
|
Where each key goes. |
keys_left_out |
list[LeftOutKey]
|
The optional keys left out, and why. |
mcp |
list[ServerReport]
|
The MCP servers registered in the agent. |
withheld |
list[str]
|
The services whose credential, declared by a kit, the daemon withholds: the proxy injects nothing for them, the subscription of the agent included. |
fastsandbox.models.NetworkReport
¶
Bases: Model
The network rules of a launch.
Attributes:
| Name | Type | Description |
|---|---|---|
allow |
list[str]
|
The hosts the spec allows. |
deny |
list[str]
|
The hosts the spec refuses. |
http_allow |
list[HttpRuleReport]
|
The HTTP requests the spec allows. |
http_deny |
list[HttpRuleReport]
|
The HTTP requests the spec refuses. |
warning |
str | None
|
Why the allowances restrict nothing, when the global policy of the daemon
allows every host, as it does under the Open preset of |
fastsandbox.models.HttpRuleReport
¶
fastsandbox.models.KeyReport
¶
fastsandbox.models.LeftOutKey
¶
Bases: Model
An optional key a launch left out, never its value.
Attributes:
| Name | Type | Description |
|---|---|---|
env |
str
|
The variable of the key. |
service |
str | None
|
The service of the key, if it names one. |
reason |
LeftOutReason | str
|
Why it was left out. |
fastsandbox.models.ServerReport
¶
Base¶
The base of every model and the helpers that give their wire shape.
fastsandbox.models.Model
¶
Bases: BaseModel
Base of the payload models of the daemon.
Unknown fields are kept, and fields are settable by their name or their alias. The events of a creation, the chunks of an output and the images of a package are plain models, which drop unknown fields.
fastsandbox.models.expose_secret
¶
expose_secret(value: SecretStr, info: SerializationInfo) -> str
A secret, exposed only for the native extension.