OS sandbox configuration
Omnibox is Omnigent's secure OS sandbox for any agent. On Linux and macOS, it restricts filesystem and network access at the OS level, and it hides credentials from the agent and brokers access to them. Run agents with minimal permissions, or lock them down for unattended YOLO-mode execution.
The OS sandbox restricts what commands and file operations your agent can perform. It controls which files the agent can read and write, whether it can access the network, and which environment variables it sees.
This is different from the cloud sandbox host, which controls where the runner executes. The OS sandbox controls what the agent can access, regardless of where it runs.
The OS sandbox applies to the built-in OS tools (sys_os_read, sys_os_write,
sys_os_edit, sys_os_shell) and any terminals you declare in the agent config.
Requirements: Linux: install bubblewrap (apt install bubblewrap or
dnf install bubblewrap). macOS: sandbox-exec ships with stock macOS. If you ask for a
sandbox and the backend isn't available, Omnigent errors rather than running unsandboxed.
Windows: job objects provide process-tree cleanup for OS-tool helpers; they don't
restrict filesystem or network access, so harness workers reject them (see
Harness worker containment). For full sandboxing on
Windows, run Omnigent under WSL or use a cloud sandbox host.
Minimal config
The smallest useful OS sandbox. Make the working directory writable and let Omnigent pick the backend for your platform:
os_env:
type: caller_process
cwd: .
sandbox:
write_paths: [.] # cwd is read-only by default; opt it back in
allow_network: true
On Linux, Omnigent uses bubblewrap (bwrap). On macOS, it uses Seatbelt
(sandbox-exec). Omit type — or set type: auto — to pick the platform
default; the two resolve identically.
| Platform | Backend | Mechanism |
|---|---|---|
| Linux | linux_bwrap | Bubblewrap namespaces + seccomp |
| macOS | darwin_seatbelt | sandbox-exec SBPL profiles |
| Windows | windows_jobobject | Job objects (process cleanup) |
| Other | none | No sandboxing (explicit opt-out) |
Choosing or disabling the backend
You usually don't set type at all — Omnigent picks the platform default. Two
explicit values are available when you want to be deliberate:
type: autorequests the platform default explicitly. It is identical to omittingtype, so the same YAML stays portable across platforms.type: noneandtype: nullboth explicitly disable the sandbox. Setting thesandbox:block tofalseis equivalent.
Asking for a named backend (for example type: linux_bwrap) still routes to that
backend and errors loudly on a platform that can't provide it — the author asked
for it by name.
What you can restrict
Filesystem
By default, cwd is read-only on hardened backends. You opt in to writes explicitly.
sandbox:
read_paths: [~/.gitconfig, ~/.ssh] # read-only access outside cwd
write_paths: [.] # writable directories
write_files: [~/.ssh/known_hosts] # individual writable files
cwd_allow_hidden: [.venv, .git, .env] # dotfiles to allow (rest are masked)
mask_paths: [config/production.key] # hide specific paths by name/depth
Dotfiles under cwd and read_paths are hidden by default unless
listed in cwd_allow_hidden. This makes broad read grants safe: granting
~ doesn't expose ~/.aws/credentials or ~/.ssh/id_rsa. On macOS, ~/Library is also
denied by default.
By default the dotfile mask is non-recursive — it scans only the top level of
cwd and each read_paths root. Top-level secrets (.env, .git/, .aws/,
.ssh/) are still hidden, but a dotfile nested below the first level (for example
services/api/.env) stays visible. This is the scalable default: a recursive walk of
a medium or large tree visits enormous numbers of entries and routinely trips
cwd_hidden_scan_max_entries.
For untrusted source trees where a deeply nested credential file would be an
unacceptable leak, set cwd_hidden_scan_recursive: true to walk the whole tree. The
cwd_hidden_scan_max_entries and cwd_hidden_scan_overflow knobs then bound the cost
of the full walk.
sandbox:
cwd_hidden_scan_recursive: true # mask dotfiles at any depth
To hide a specific file or directory the name-based masker won't catch — a named
secret like config/production.key, or a single deeply nested dotfile without turning
on full recursion — list it under mask_paths. Entries are resolved like read_paths
(~ is expanded, relative paths are taken against cwd, $VAR is not expanded) and
are hidden regardless of name or depth, on top of the dotfile mask. A directory is
masked as an empty view, a file as an empty file.
sandbox:
mask_paths:
- config/production.key
- ~/.config/private
Disposable copy-on-write writes (Linux)
A write_paths entry can also be an object with copy_on_write: true. On the
linux_bwrap backend, that directory is mounted as a disposable overlay: the agent
sees it at its original path and can create, edit, rename, and delete files there,
but the host's original files never change. A plain string entry is shorthand for
{path: ..., copy_on_write: false}.
executor:
harness: openai-agents
os_env:
type: caller_process
cwd: .
sandbox:
type: linux_bwrap
write_paths:
- ./artifacts # persistent: writes land on the host
- path: ./dependencies
copy_on_write: true # disposable: writes stay in the overlay
terminals:
bash:
command: bash
os_env: inherit
Create artifacts and dependencies before starting the session. The sys_os_*
tools, shell commands, and inherited terminals all share the same overlay, including
across turns and terminal reopen. Writes to artifacts persist normally.
The disposable view belongs to the session's OS environment:
- Its changes are discarded when that environment closes, and they are not restored after a runner restart. Separate sessions get separate views. Export anything you want to keep into a persistent write path before the session ends.
- Overlay data lives in temporary memory-backed storage and consumes memory/swap as files are copied up.
- The original directory should stay unchanged on the host while its overlay is active; OverlayFS does not snapshot concurrent host edits.
Copy-on-write is currently restricted, and Omnigent rejects configs that break these rules rather than falling back to writing the original directory:
- Requires
sandbox.type: linux_bwrapandexecutor.harness: openai-agents. Other harnesses are rejected because their native tools do not yet share the session's mount namespace. - Each copy-on-write path must name an existing directory.
- Nested copy-on-write roots, persistent
write_pathsinside a copy-on-write root, andwrite_filesinside one are rejected. A persistent parent with a copy-on-write child is supported. os_env.forkand sandbox overrides are not supported with copy-on-write paths.- In a copy-on-write session, file uploads, agent bundle downloads
(
sys_agent_download), local agent config discovery (sys_agent_list), skill loading/reading, andsys_session_createwithconfig_pathreturn an explicit unsupported-operation error. Usesys_os_*tools and an inherited terminal for filesystem work, and export results to a persistent write path.
Host requirements
These apply only to paths with copy_on_write: true; ordinary read_paths and
persistent write_paths keep their existing requirements. They are checked on the
machine running the sandbox, not the UI:
- Bubblewrap 0.11+, providing
--overlay-srcand--tmp-overlay. - Unprivileged OverlayFS mounts with
userxattrsupport — upstream Linux 5.11+; some distributions backport them to older kernels. - tmpfs
user.*extended attributes (upstream Linux 6.6) for Bubblewrap's temporary upper layer. The upstream baseline is therefore 6.6+, or distro backports of both features. Older tmpfs can allow the mount but fail later directory operations. - Kernel facilities: user/mount namespaces (
CONFIG_NAMESPACES,CONFIG_USER_NS), OverlayFS (CONFIG_OVERLAY_FS, built in or as a module), and tmpfs with extended attributes (CONFIG_TMPFS,CONFIG_TMPFS_XATTR). - Permission to use them: sufficient
user.max_user_namespacesanduser.max_mnt_namespacesquotas,kernel.unprivileged_userns_clone=1where that switch exists, and AppArmor/SELinux/seccomp/container policy that allows namespace creation and OverlayFS mounts. Ubuntu 24.04's AppArmor restrictions, for example, can block unprivileged user namespaces even on a recent kernel. Omnigent does not change host security settings.
Omnigent attempts the real mounts and tests tmpfs user extended attributes when it
initializes a copy-on-write environment — it neither rejects a working distro
backport based on uname nor accepts a host solely for having a new kernel. On
failure the error reports the running kernel, these prerequisites, and Bubblewrap's
original message; the session fails before running tools in that environment. A
missing or unlaunchable bwrap binary and a mount startup timeout also produce
copy-on-write-specific errors.
To check support, run this as the same user and inside the same container/VM as the
runner, from a directory containing an existing dependencies folder:
uname -r
bwrap --version
cow_probe_dir=$(mktemp -d)
bwrap --unshare-user --ro-bind / / \
--overlay-src "$PWD/dependencies" --tmp-overlay "$PWD/dependencies" \
--tmpfs "$cow_probe_dir" \
-- python3 -c 'import os,sys,tempfile; f=tempfile.TemporaryFile(dir=sys.argv[1]); os.setxattr(f.fileno(), "user.cow_probe", b"1")' "$cow_probe_dir"
cow_probe_status=$?
rmdir "$cow_probe_dir"
test "$cow_probe_status" -eq 0
The probe should exit successfully without changing dependencies. An unknown
overlay option indicates an old Bubblewrap build; a namespace or mount permission
error points at host policy; an unsupported filesystem/option points at missing
kernel support. See the
Bubblewrap manual,
the kernel OverlayFS documentation,
and the Linux 6.6 tmpfs extended-attribute handlers.
Network
sandbox:
allow_network: true # basic on/off
egress_rules: # optional HTTP(S) allow-list
- "GET api.github.com/repos/myorg/**" # GET only, one org
- "* pypi.org/**" # any method
- "* *.github.com/**" # wildcard subdomain
When egress_rules is set, all HTTP(S) traffic goes through a MITM proxy with
default-deny. Only requests matching a rule are allowed. Requires a hardened backend
(linux_bwrap or darwin_seatbelt).
Each rule is "METHODS host/path-glob": comma-separated HTTP verbs (or
* for any), a hostname (or *.domain for subdomains), and a path
glob where ** matches any depth.
By default, the proxy also blocks connections to private IPs (RFC1918, loopback, cloud
metadata like 169.254.169.254). Set
egress_allow_private_destinations: true if your agent needs to reach internal services.
egress_rules covers HTTP(S) only. To let a sandboxed git reach a repository over
SSH without handing it the private key, use git_ssh — it isolates
the sandbox network the same way egress_rules does, and the two can be combined.
Environment
sandbox:
env_passthrough: [GH_TOKEN, AWS_PROFILE] # only these vars reach the agent
Agent CLIs are spawned with a deny-by-default environment. Only two things are
inherited automatically: the shared base (HOME, PATH, proxy/TLS settings, locale,
TMPDIR, and the Omnigent session marker) and the running harness's own variable
family. Everything else — including a host secret that belongs to some other
provider — is stripped, and only reaches the agent if you name it in
env_passthrough.
An ambient key that used to reach the CLI implicitly now has to be declared. Two cases are worth knowing:
- A generic ACP agent (
type: acp) gets no vendor family at all, because Omnigent cannot know which vendor an arbitrary agent belongs to. Gemini via ACP needsenv_passthrough: ["GEMINI_API_KEY"]. - Goose owns
GOOSE_*only. Goose configured through Omnigent's provider/gateway routing is unaffected, but a goose set up against an ambient provider key (OPENAI_API_KEY,ANTHROPIC_API_KEY, …) needs that name declared here.
If an agent fails during its initialize handshake for no obvious reason, check this
field first — the ACP executor logs a hint pointing back at it.
Credentials (secretless proxy)
credential_proxy lets sandboxed tools authenticate to external hosts without the
real secret ever entering the sandbox: the mandatory L7 egress proxy attaches the
credential on the way out, swapping a synthetic placeholder for the real value. It
requires egress_rules and a hardened, network-isolating backend (linux_bwrap or
darwin_seatbelt).
These entries apply to sandboxed framework tools. A harness worker accepts
credential_proxy only with Codex's brokered gateway configuration
or Claude SDK's owned worker environment and credential broker; other harness
adapters, nonbrokered Codex, and direct Claude CLI preparation without an owned
worker environment reject it. See
Harness worker containment.
Each entry has a type. The host-keyed types — https_bearer, https_basic,
git_https, and gh_basic — bind a credential to a target/targets host and
resolve the secret from a source.
sandbox:
egress_rules:
- "* api.github.com/**"
credential_proxy:
- type: https_bearer
target: api.github.com
source: { env: GH_TOKEN }
Databricks CLI
The databricks_cli type is for framework tools, not harness workers. It proxies the Databricks CLI.
Unlike the host-keyed types, it is profile-keyed: list the profiles to proxy
(and an optional default). Only the listed profiles are materialized into the
sandbox — as a placeholder .databrickscfg whose tokens are synthetic oa_cred_*
values — and swapped by the proxy; every other profile is invisible to the agent.
Omnigent points DATABRICKS_CONFIG_FILE at the placeholder file, and sets
DATABRICKS_CONFIG_PROFILE when default is given.
os_env:
type: caller_process
cwd: .
sandbox:
type: linux_bwrap
egress_rules:
- "* pypi.org/**" # your other egress needs
- "* dbc-adb7b1a3-9097.cloud.databricks.com/**" # the proxied workspace
credential_proxy:
- type: databricks_cli
profiles: [dbc-adb7b1a3-9097, oss]
default: dbc-adb7b1a3-9097 # optional; sets DATABRICKS_CONFIG_PROFILE
Inside the sandbox, databricks --profile dbc-adb7b1a3-9097 current-user me works;
the sandbox holds only oa_cred_* placeholders, never a live token.
As with every credential-proxy type, you must list each workspace host in
egress_rules yourself — the proxy never widens egress on its own. OAuth profiles
(auth_type = databricks-cli) are refreshed for the life of the session, so long
sessions survive the ~1h token expiry. databricks_cli requires the databricks
extra (pip install omnigent[databricks]) and only works on linux_bwrap — the Go
CLI ignores SSL_CERT_FILE on macOS, so darwin_seatbelt is rejected.
Codex model gateway
A sandboxed codex executor can reach an HTTPS model gateway through the same
proxy, so Codex never holds the gateway token. To set this up, set
executor.config.broker_gateway: true. Then bind the gateway host with an
https_bearer entry whose env is OMNIGENT_CODEX_GATEWAY_TOKEN, and allow the
gateway's exact Responses route in egress_rules. The runner swaps the provider's
auth command for a fixed command that prints only the placeholder. The trusted
parent reads the protected source and renews the token. Codex gets a private
home with no host auth or provider configuration, and only the agent bundle's
skills.
executor:
model: gpt-daybreak-blue-latest
auth:
type: provider
name: locked-model
config:
harness: codex
broker_gateway: true
web_search: false
disable_native_tools: true
os_env:
type: caller_process
sandbox:
type: darwin_seatbelt # or linux_bwrap
egress_rules:
- "POST model.example.com/cyber/v1/responses"
credential_proxy:
- type: https_bearer
target: model.example.com
env: OMNIGENT_CODEX_GATEWAY_TOKEN
source:
unix_socket: /private/model-token.sock
refresh_interval_seconds: 300
Configure the provider in the host's ~/.omnigent/config.yaml:
providers:
locked-model:
kind: gateway
openai:
base_url: https://model.example.com/cyber/v1
wire_api: responses
auth_command: "false" # required by the provider schema; locked mode replaces it
models:
default: gpt-daybreak-blue-latest
The profile won't launch unless all of the following hold:
broker_gatewayis the booleantrue. Acredential_proxyentry that injectsOMNIGENT_CODEX_GATEWAY_TOKENwithout it is rejected.web_search: falseanddisable_native_tools: trueare set, so Codex's shell and file operations go through Omnigent tools and policies.- The provider's
base_urlishttps://on port 443, with no credentials, query, or fragment. - There is exactly one matching
https_bearerentry for the gateway host, withenv: OMNIGENT_CODEX_GATEWAY_TOKENand a renewablefileorunix_socketsource (refresh_interval_secondsset). - There is exactly one egress rule for the gateway host:
POSTon<base_url path>/responses. - The sandbox
typeislinux_bwrapordarwin_seatbelt.
Gateway profiles without broker_gateway keep their existing authentication only
when credential_proxy is absent; configuring credential_proxy on a
nonbrokered Codex worker prevents launch.
Omnigent doesn't start the token issuer. A separate trusted issuer must serve
GET /token and refresh the bearer. The socket path must be absolute and outside
the sandbox's read/write grants. Keep the issuer's code, dependencies,
configuration, and credential storage outside sandbox write grants as well. The
bearer is attached only to placeholder-bearing HTTPS requests on port 443, in both
the Codex relay and the OS-tool proxy. Bare or plaintext HTTP requests get no
bearer.
Older runners ignore broker_gateway and fall back to legacy authentication.
Upgrade every runner that can launch the profile before you enable it. Keep
auth_command: "false" exactly as shown: an older runner, or any other use of
this provider, then fails authentication instead of running a real token
command. That setting doesn't protect an older runner by itself, so test a real
turn and a resumed turn on an upgraded runner before you roll out.
Git over SSH
git_ssh grants a sandboxed git access to one repository and one SSH operation
at a time without exposing the SSH private key. The trusted parent process runs
OpenSSH with the key; the sandbox only receives a Git transport helper
(GIT_SSH_COMMAND) and a private Unix socket. It cannot read the key or connect to
the SSH host directly. Use a read-only deploy key for fetch when the server supports
one.
os_env:
type: caller_process
cwd: .
sandbox:
type: auto # resolves to linux_bwrap or darwin_seatbelt
git_ssh:
- host: github.com
port: 22
username: git
repository: my-org/my-repo.git
operations: [fetch]
identity_file: /home/runner/.ssh/my-repo-deploy-key
known_hosts_file: /home/runner/.ssh/github-pinned-host-key
Inside the sandbox, git clone git@github.com:my-org/my-repo.git and git fetch work
as usual, from sys_os_shell and from sandboxed terminals alike. The binding only
matches an exact username@host, port, and repository path, so add a separate
binding for each submodule or additional repository. Add push to operations only
for a write-capable key.
known_hosts_filemust contain one exact host key entry forhost, for examplegithub.com ssh-ed25519 <public-key>. Record the expected key through a trusted channel; don't accept an unverifiedssh-keyscanresult.identity_fileandknown_hosts_filetake literal absolute paths —~is not expanded. Keep both files outside the sandbox's read and write paths; Omnigent protects them from the sandbox like other credential sources.- The parent resolves DNS for each connection and every returned address must be
allowed. Public addresses need no extra setting. For a private SSH server, set
allowed_cidrson that binding to the narrow range containing its addresses. The parent pins the chosen address for the SSH connection and verifies the host key against the configuredhost. - Loopback stays blocked unless a local-development binding uses a loopback IP literal
as
host, its exact/32CIDR inallowed_cidrs, andallow_loopback: truetogether. Don't use that for a shared or production SSH server. - The grant covers Git's
git-upload-pack(fetch) and, when explicitly allowed,git-receive-pack(push). It does not grant a shell, arbitrary SSH commands, or Git LFS HTTP authentication.
git_ssh requires linux_bwrap or darwin_seatbelt; other backends reject the
setting. The host running the sandbox needs the OpenSSH client at /usr/bin/ssh.
Like egress_rules, git_ssh isolates the sandbox network — only the broker socket
(and the egress proxy, if egress_rules is also set) is reachable — and it is
incompatible with allow_sandbox_override: true on a terminal, since an override to
none would drop the enforcement.
Sharing a policy
Declare the sandbox once and reuse it with a YAML anchor:
os_env:
type: caller_process
cwd: .
sandbox: &shared
write_paths: [.]
read_paths: [~/.gitconfig, ~/.ssh]
allow_network: true
terminals:
zsh:
command: zsh
os_env:
type: caller_process
cwd: .
sandbox: *shared # same policy as sys_os_* tools
Or use os_env: inherit on a terminal or sub-agent to inherit the parent's
full environment including its sandbox.
In a multi-harness setup, each sub-agent defines its own sandbox in its own
config.yaml file in the agents/ subdirectory. Agent entries
in tools.agents are just names (strings), not inline config blocks.
# Parent config.yaml
tools:
agents:
- researcher
- coder
# agents/researcher/config.yaml
os_env:
sandbox:
write_paths: [./research]
allow_network: true
# agents/coder/config.yaml
os_env:
sandbox:
write_paths: [./src]
allow_network: false
Harness worker containment
When a custom agent sets os_env, the harness adapter that runs its worker either
enforces the policy or refuses to start. It never runs the worker unconfined. An
os_env block without sandbox.type requests the platform default, so it
requests confinement too.
| Harness adapters | Worker confinement |
|---|---|
| ACP, Claude SDK, Codex, Goose, Kimi, Pi, Qwen | Supported on linux_bwrap and darwin_seatbelt |
| Copilot, Cursor, Hermes, Antigravity | Not supported. Requests for confinement are refused. |
- Linux or macOS only. Harness adapters reject
windows_jobobject, including when it's the Windows default, because it can't enforce filesystem and network boundaries. - Adapters without confinement. Copilot, Cursor, Hermes, and Antigravity
reject any
os_envthat doesn't setsandbox.type: none. Pick a sandbox-capable harness when you need confinement, and use an explicitsandbox.type: noneonly when you intend unrestricted execution. web_fetchresearcher. The framework-createdweb_fetchresearcher uses its parent's harness. When the parent has noos_env, the researcher requests the platform-default sandbox. On Copilot, Cursor, Hermes, and Antigravity it therefore refuses to start.sandbox.type: nonewith network limits.nonecan't enforceallow_network: false,egress_rules, orcredential_proxy, so those combinations are rejected.- No unsandboxed fallback. If the sandbox can't be prepared on the host, the worker doesn't start.
Supported options
On the sandbox-capable adapters:
os_env.typemust becaller_process.os_env.fork,os_env.start_in_scratch, andsandbox.git_sshare rejected.- Worker
egress_rulesare supported by Codex and Claude SDK only. - Worker
credential_proxyrequires Codex's brokered gateway configuration (broker_gateway: trueand its gateway binding) or Claude SDK's owned worker environment and credential broker. allow_network: falsedenies direct external connections from the worker. Supported brokered inference, such as Claude SDK's model broker, stays available without direct provider connections.- Workers can't enforce worker-wide
tcp_egress, and there is no supported workaround yet. If the restriction has to cover the worker itself, treat the configuration as unsupported.
sys_os_shell shares the agent's primary os_env, so it doesn't replace worker
containment. For HTTP or TCP egress that only a terminal needs, and that doesn't
need credentials, put egress_rules or tcp_egress in that terminal's own
os_env. Terminal launches ignore credential_proxy and don't inject its
credentials. Terminal-local rules don't replace the primary worker's egress
boundary, so keep the worker's required confinement.
Working directory
- A relative
os_env.cwddoesn't override the workspace the runner selected for the session. - Claude SDK also resolves a named relative directory such as
./projectagainst the runner base when that base is still the selected workspace..keeps using the selected workspace. Other adapters always keep the selected workspace. - An absolute
os_env.cwdmust contain the selected session workspace. A conflicting absolute path refuses launch.
Policy changes and refusals
If a later turn supplies a changed OS policy, the runtime replaces the retained
worker before that turn runs, so the new policy reaches a fresh process.
Launch-policy overrides such as enforce_sandbox are reapplied before the spawn
environment is derived, including after an agent revision changes.
A refused policy is reported in the session. Fix the unsupported option, for
example by removing os_env.fork: true, and retry in the same session. Don't
remove confinement just to get past a refusal.
Sandbox launchers grant read access to the installed omnigent Python package.
For an editable install, that includes the package's source directory even when
it's outside the interpreter's installation roots.
Claude Code (claude-sdk) containment
With harness: claude-sdk and an active sandbox, the sandbox contains the
entire Claude CLI and everything it spawns: native Bash, inline skill shell
expansion (!`command` ), hooks, and plugin subprocesses such as plugin stdio
MCP servers. System-installed and SDK-bundled Claude CLIs use the same launcher.
This outer boundary is separate from Claude's own Bash sandbox.
executor:
harness: claude-sdk
os_env:
type: caller_process
cwd: .
sandbox:
type: auto
write_paths: ["."]
allow_network: false
- Backends. Containment requires
linux_bwrapordarwin_seatbelt.windows_jobobjectdoesn't isolate the filesystem or network, so sandboxed Claude SDK launches reject it. - Fails closed. If the sandbox can't be resolved or launched, the session
doesn't start. Setting
OMNIGENT_CLAUDE_SDK_NO_SANDBOXwhile a sandbox is requested is a startup error. Usesandbox.type: noneto opt out. - No sandbox requested. If you omit
os_envor setsandbox.type: none, skills, hooks, and local MCP commands run uncontained. - Bash policy gate. Bash is available inside the contained CLI so skills can
run their shell commands. Every native Bash call passes an Omnigent
PreToolUsepolicy gate, even when Claude's permission mode approves tools automatically. Claude's own permission rules still apply.
Automatic model access
You don't need an egress_rules entry for the model. The trusted parent works
out the model host and gateway prefix from the selected provider, and it relays
inference for the CLI, sandboxed session terminals, and sys_os_* shells. This
works even with allow_network: false. The sandbox only ever sees a
session placeholder. Real model tokens and auth commands stay in the parent.
- The relay attaches the credential only to HTTPS
POSTrequests to the provider's/v1/messagesand/v1/messages/count_tokensroutes (optionally with exactly?beta=true).egress_rulescan't widen this. Redirects, account APIs, and other model-host paths don't get the credential. - Anything running in the sandbox can make inference requests through the placeholder, so skills get the session's inference capability.
- In a sandboxed Claude SDK session, you can run the Claude CLI from a terminal
(one you open or one launched by
sys_terminal_launch) without entering a credential. - Supported credentials are API-key providers, explicit Anthropic bearer/OAuth tokens, and host Claude OAuth credentials. Host OAuth credentials are reread from the credentials file or the macOS Keychain; if they expire, sign in again. Databricks profile credentials are refreshed in the parent.
- Databricks profile authentication needs the trusted Python profile-token
helper on the parent's
PATH. A profile configured only through the Databricks CLI can't start a sandboxed Claude worker. - These fail closed: arbitrary shell auth helpers, HTTP or nonstandard-port model endpoints, and Bedrock/Vertex/Foundry transports.
This integration only applies to claude-sdk. It doesn't change claude-native
launches or how other harnesses authenticate to models.
Network and filesystem
- No direct networking. Contained launches never get direct network
access, even if the policy sets
allow_network: true. For other HTTP(S) access, addegress_rules. Those requests don't get the model credential. - Private home. The CLI, sandboxed session terminals, and
sys_os_*shells each use private HOME, config, and scratch directories. That means home-relative Git, package-manager, and shell configuration may be missing. Host Claude state, credential files, and plugins aren't imported, and on macOS Keychain access is denied. If a filesystem grant conflicts with this, startup fails. - Skills. Bundled skills stay available. Only the skills and their
supporting files are copied into a separate plugin directory. Keep the
original agent bundle, including its
config.yamland MCP configuration, outside the sandbox workspace and its read/write grants. Startup rejects layouts that conflict with this. - Trusted runtime. Omnigent's Python interpreter, runtime libraries, and
framework installation must stay outside sandbox-writable paths. An editable
install inside a writable workspace can be rejected. Startup also fails on
user-owned hard links to trusted runtime files and on unsupported executable
.pthstartup lines (for exampleimport _virtualenv). Install dependencies as copies, in a standard virtual environment. - Managed Claude policy. Managed Claude policy still applies. Managed
configuration that contains model credentials or
apiKeyHelperis rejected before the CLI can read it, so keep model credentials in the parent's provider configuration. The check covers settings-only directories, settings drop-ins, and macOS device and per-user MDM preference plists.
On Linux, the default Claude CLI wrapper checks the installed Python runtime
for mutable hard-link aliases even when os_env is omitted, and a failure can
stop startup. If an older uv tool install fails with a mutable hard-link alias error, reinstall its dependencies as copies:
uv tool upgrade --reinstall --link-mode copy omnigent
Host sandbox grants
Uploaded agent bundles can't declare
absolute, ~, or .. entries in read_paths, write_paths, or write_files.
If agents on a host need to reach paths outside the workspace, the host operator
lists those paths in the host's own config.yaml instead
($OMNIGENT_CONFIG_HOME/config.yaml, default ~/.omnigent/config.yaml):
runner:
sandbox_grants:
read_paths: [/srv/example/repo/.git]
write_paths: [/srv/example/cache]
When the runner loads an agent bundle, it appends these paths to every
os_env.sandbox block the bundle declares: the agent's own, its terminals', and
those of nested agents. Environments without a sandbox block stay
unsandboxed. Paths a sandbox already grants are not added again.
read_pathsandwrite_pathsare the only supported keys. Each must be a list of absolute path strings.~and relative paths are rejected. On Windows, a path must start with a drive letter (C:\...) or a UNC share (\\host\share\...).- Host
write_pathsare persistent grants. Object entries such as{path: ..., copy_on_write: true}are rejected. - If the agent's config already grants the same directory, the agent's grant and its
mode (for example
copy_on_write: true) take precedence. A host write grant inside a copy-on-write root is rejected as an overlap, like any persistent write path there. - An invalid
runner.sandbox_grantsvalue makes the runner raise an error that names the offending field when it loads the agent.
What is and isn't sandboxed
The OS sandbox applies to sys_os_* tool calls and terminals that reference the
policy. With claude-sdk, it also contains the Claude CLI and its descendants
(see Claude Code containment), and other
sandbox-capable harness workers are confined as described in
Harness worker containment. It does
not apply to:
- MCP servers. The runner spawns MCP subprocesses outside the sandbox. Constrain an MCP server at its own configuration site. (Plugin stdio MCP servers launched by a contained
claude-sdkCLI are the exception; remote MCP servers run elsewhere.) - In-process Python tools. Registered in-process tools run in the parent process.
- The Omnigent supervisor process. It runs the model loop and dispatches tools. Only the commands it issues through OS tools run inside the sandbox.
If you ask for a sandbox (explicitly or via the default) and it can't be provided,
Omnigent errors instead of quietly running unsandboxed. The only opt-out is
sandbox.type: none (equivalently sandbox.type: null or sandbox: false).
Field reference
os_env
| Field | Type | Default | Description |
|---|---|---|---|
type | string | caller_process | OS environment backend |
cwd | string | . | Working directory |
sandbox | block | platform default | Sandbox policy (see below) |
start_in_scratch | bool | false | Start in a writable scratch tmpdir instead of cwd. Workspace bound read-only. Requires an active sandbox. |
os_env.sandbox
| Field | Type | Default | Description |
|---|---|---|---|
type | string | platform default | auto (or omitted) picks the platform default; linux_bwrap, darwin_seatbelt, windows_jobobject; none/null disables |
write_paths | (string or object)[] | [] | Writable directories. cwd is read-only by default. An object entry takes path and copy_on_write (bool, default false); see copy-on-write writes. |
write_files | string[] | [] | Individual writable files |
read_paths | string[] | none | Read-only grants outside cwd |
allow_network | bool | true | Network access on/off |
cwd_allow_hidden | string[] | [".venv"] | Dotfile basenames to allow |
cwd_hidden_scan_recursive | bool | false | Recurse subdirectories when masking dotfiles. false scans top level only. |
mask_paths | string[] | none | Explicit files/dirs to hide by any path/name, on top of the dotfile mask |
cwd_hidden_scan_max_entries | int | 50000 | Max entries for dotfile mask walk (recursive mode) |
cwd_hidden_scan_overflow | string | warn | error, warn, or unlimited |
env_passthrough | string[] | minimal set | Env vars the agent can see |
egress_rules | string[] | none | HTTP(S) allow-list. Default-deny when set. |
egress_allow_private_destinations | bool | false | Allow connections to private/metadata IPs |
credential_proxy | block[] | none | Secretless auth entries; requires egress_rules |
git_ssh | block[] | none | Repository-scoped Git-over-SSH bindings brokered by the parent; requires linux_bwrap or darwin_seatbelt |
os_env.sandbox.git_ssh[]
Each entry binds one SSH identity to one repository on one destination. Entries
with the same host, port, username, and repository are rejected as duplicates.
| Field | Type | Default | Description |
|---|---|---|---|
host | string | required | Exact ASCII DNS name or IPv4 address of the SSH server |
port | int | 22 | SSH port (1–65535) |
username | string | git | SSH user |
repository | string | required | Repository path as Git sends it, e.g. my-org/my-repo.git |
operations | string[] | [fetch] | fetch and/or push |
identity_file | string | required | Absolute path to the private key; ~ is not expanded |
known_hosts_file | string | required | Absolute path to a file with one exact host key entry for host; ~ is not expanded |
allowed_cidrs | string[] | [] | Address ranges the resolved host must fall in. Empty allows only public addresses. |
allow_loopback | bool | false | Permit a loopback destination. Requires a loopback IP literal host and exactly its /32 in allowed_cidrs. |