Skip to main content

Module sandboxing

Module sandboxing 

Source
Expand description

Sandboxing module for VT Code

Re-exported from vtcode-safety for backward compatibility.

Modules§

network_proxy
Local HTTP CONNECT / SOCKS5 proxy used to enforce hostname allowlists.

Structs§

AdditionalPermissions
Additional per-command filesystem permissions.
CommandSpec
Specification for a command to be executed.
DomainPolicy
Ordered domain rules; deny wins, then allow, then default deny.
DomainRule
One hostname rule. Domains are case-insensitive; *.example.com also matches the bare example.com, matching the existing allowlist semantics.
ExecEnv
The prepared execution environment after sandbox transformation.
LinuxSandboxLauncher
How the Linux sandbox helper binary is invoked.
NetworkAllowlistEntry
Network allowlist entry for domain-based egress control.
NetworkProxy
Running proxy. Dropping it stops both accept loops.
ProxyEndpoints
Loopback addresses the sandbox must allow outbound to.
ResourceLimits
Resource limits for sandboxed execution.
SandboxDebugResult
Result of a sandbox debug test.
SandboxManager
Manager for sandbox transformation.
SeccompProfile
Seccomp profile configuration for Linux sandboxing.
SensitivePath
Sensitive path entry for blocking access to credential locations.
ValidatedSandboxRequest
A sandbox request proven valid by SandboxPermissions::resolve_request.
WritableRoot
A root directory that may be written to under the sandbox policy.

Enums§

DebugSubcommand
Debug subcommand types for CLI integration.
DomainRuleAction
Effect of a domain rule.
ExecExpiration
Mechanism to terminate an exec invocation before it finishes naturally.
ProxyDecision
Decision for a proxy request. Unknown destinations are denied.
SandboxPermissions
Fine-grained permissions for sandbox operations.
SandboxPolicy
Sandbox policy determining what operations are permitted during execution.
SandboxTransformError
Error type for sandbox transformation failures.
SandboxType
Type of sandbox being used.

Constants§

BLOCKED_SYSCALLS
Syscalls that should be blocked in seccomp-bpf profiles.
DEFAULT_SENSITIVE_PATHS
Default sensitive paths that should be blocked from sandboxed processes.
FILTERED_ENV_VARS
Environment variables that should be filtered from sandboxed processes.
FILTERED_SYSCALLS
Syscalls that require argument filtering (not fully blocked).
PRESERVED_ENV_VARS
Environment variables that should always be preserved.
SECCOMP_PROFILE_VERSION
Version of the seccomp blocklist schema compiled into this binary.
VTCODE_SANDBOX_ACTIVE
Sandbox environment markers set for child processes.
VTCODE_SANDBOX_NETWORK_DISABLED
VTCODE_SANDBOX_TYPE
VTCODE_SANDBOX_WRITABLE_ROOTS

Functions§

apply_sandbox_restrictions
Apply every kernel-level restriction of the sandbox policy to the current process: resource limits, then Landlock filesystem rules, then seccomp.
build_sanitized_env
Build a sanitized environment for sandboxed child processes.
debug_sandbox
Debug sandbox configuration by running a test command.
default_sensitive_paths
Get the default sensitive paths as SensitivePath entries.
filter_sensitive_env
Filter sensitive environment variables from an existing map.
landlock_supported
Probe whether the running kernel enforces Landlock (ABI >= 1, Linux 5.13+).
proxy_enforcement_available
Whether this platform can restrict a child to the proxy exactly.
sandbox_capabilities_summary
Get a human-readable summary of sandbox capabilities for the current platform.
setup_parent_death_signal
Set up parent death signal on Linux.
should_filter_env_var
Check if an environment variable should be filtered.
start_proxy
Start HTTP and SOCKS5 listeners on ephemeral loopback ports.
test_network_blocked
Test if network access is blocked under the given sandbox policy.
test_path_writable
Test if a specific path is writable under the given sandbox policy.