Skip to content

Approvals and sandboxing

CaberOS treats model output as a request, not as authority. A tool call must pass capability authorization, any required human decision, subject and credential checks, and the active filesystem or process restrictions before it can execute.

These controls answer different questions:

Control Question
Capability grant May this agent request this operation at all?
Schema visibility Does the model currently see the full parameters for the operation?
Subject binding On whose contact-scoped data will it operate?
Approval Must a human confirm this invocation?
Sandbox mode Which host resources can the allowed operation reach?
Audit What decision and result were recorded?

Passing one control does not bypass another.

Every registered capability call enters the mediator:

Model ToolCall
│
├─ capability exists?
├─ granted to this agent?
├─ granted to parent if called by sub-agent?
├─ valid session/contact subject?
├─ approval required?
├─ MCP server/binding/credential valid?
├─ execute with workspace + sandbox mode
└─ write allowed or denied audit record

Unknown, ungranted, unbound, unavailable, rejected, and failed calls produce denied results. The model may receive that denial and continue with an authorized alternative.

Read Permissions and authority for the grant data model.

Built-in capability definitions carry default egress and approval metadata.

Capability group Default behavior
Workspace file tools Local, no approval by default
Knowledge and memory tools Local, no approval by default
Skill and capability discovery Local, no approval by default
terminal Egress-marked and approval-required
web_search and web_fetch Egress-marked and approval-required
MCP tools Egress and approval metadata inherited from server registration

An explicit agent grant can set its approval requirement. Review the effective agent configuration rather than assuming capability-definition defaults always apply.

“Egress” is metadata indicating an operation can communicate or launch software that may communicate. It is not a network firewall.

When an interactive dashboard call requires approval:

  1. The mediator creates and persists an approval request.
  2. The run emits a pending_approval tool event.
  3. The run manager marks the run as awaiting approval and creates a notification.
  4. The model loop pauses on an in-process event.
  5. The operator reviews the capability and arguments.
  6. Approve persists the decision before waking the run.
  7. Reject returns a denied tool result to the model.
  8. No response before the configured timeout causes an automatic rejection.
  9. The final capability decision is recorded in audit.

The default human-in-the-loop timeout is five minutes. It can be configured with AGENTOS_HITL_TIMEOUT; setting it to zero waits indefinitely and is not recommended for unattended operation.

Rejecting one call does not necessarily cancel the entire run. The model can answer without the operation or request another permitted capability.

An operator can remember an approval within the current session.

Scope Match behavior Example risk
Exact Same capability and identical arguments Lowest expansion
Same verb Same capability and command verb All commands beginning with that verb may pass
Pattern Wildcard pattern selected by operator A broad wildcard can match more than intended
Capability Any arguments for the capability Broadest; all terminal calls would pass in that session

Remembered decisions live in the process-local approval registry. They do not modify the permanent agent capability configuration and do not survive a gateway restart.

Prefer exact matching. Review patterns character by character before accepting them.

A messaging-platform user cannot always respond to a desktop approval prompt. Each channel configuration therefore supplies a policy for approval-required calls:

  • deny returns a denied result;
  • operator creates a pending dashboard approval and waits;
  • auto_approve runs without a human response.

Unknown or missing policy fails closed in the mediator. Historical channel configurations may have been migrated to preserve earlier auto-approval behavior, so inspect existing channels rather than assuming they use the newest default.

Use deny while testing. auto_approve is appropriate only when the agent, capability set, upstream account, and expected message senders are all tightly constrained.

YOLO mode globally skips approval gates. It does not automatically:

  • grant an absent capability;
  • load an on-demand schema;
  • resolve a missing contact or MCP binding;
  • enable a disabled MCP server;
  • bypass a server tool filter;
  • change strict sandbox mode to open;
  • suppress audit records.

YOLO mode is process-wide rather than agent-specific. Enabling it for one test affects every agent handled by that gateway.

Keep it disabled outside an isolated trusted development environment.

In strict mode, read_file, write_file, edit_file, and search_files resolve requested paths against the workspace.

The path validator:

  1. resolves the workspace root;
  2. joins and resolves the requested path;
  3. checks containment using path semantics rather than string-prefix matching;
  4. rejects .., absolute escape, and symlink targets outside the root.

In open mode, absolute paths are allowed and relative paths still resolve from the workspace.

File-tool containment applies to CaberOS native file tools. It does not automatically constrain arbitrary third-party MCP server processes.

The terminal capability selects the local backend configured in Settings → Tools → Terminal. Strict confines filesystem writes, not networking: terminal calls allow package downloads and development servers. Commands can send workspace content externally and reach localhost or LAN services; the managed browser’s private-network allowlist does not constrain terminal commands. Use host firewall/container policies for network restrictions. Auto remains OS-native; an unavailable explicit backend does not fall back to open execution. Existing background terminals retain their admitted backend.

Open mode launches /bin/sh -c directly with the workspace as current directory. It does not use Seatbelt or Bubblewrap and therefore has the permissions of the CaberOS gateway process.

Open mode should be considered full local-user command authority. Approval can help review commands but cannot make arbitrary shell execution intrinsically safe.

MCP and local terminal calls default to automatic runtime selection: explicit binary overrides first, then a healthy existing CaberOS-managed install, then compatible installations in standard public locations such as /opt/homebrew/bin, /usr/local/bin, or OS runtime directories. A usable Homebrew installation does not require a duplicate managed download. Auto does not search arbitrary inherited PATH entries or private-home managers such as ~/.hermes/nvm; symlinks into private locations are rejected too. Node/npm/npx are checked as one complete group, not combined across directories. Managed installation remains an explicit-consent option in Settings → General → Optional Tools & Runtimes, not an automatic download. The selected verified runtime directories lead terminal PATH; empty and relative entries are excluded, and the workspace is not added automatically. Shell profiles are not loaded and the gateway environment is not changed. Open still inherits other OS commands: runtime selection is not an executable allowlist and does not restrict commands deliberately invoked by absolute path. To pin one source, set AGENTOS_RUNTIME_SOURCE=managed or system, or use AGENTOS_RUNTIME_BINARY_OVERRIDES (a JSON command-to-path mapping). Overrides take precedence; explicit source pins do not fall back to another source. An invalid managed pointer remains an error rather than being silently ignored. The default is AGENTOS_RUNTIME_SOURCE=auto. Changes apply to newly launched commands, not already-running background terminals.

Strict mode keeps its reduced environment and OS confinement. On macOS, verified managed version trees receive read/execute access despite private-home read denies; the rest of the data directory (DB, credentials, other versions) is not exposed by those grants. Shared runtimes remain non-writable to Strict. Linux mounts only selected managed version trees read-only; Windows MXC adds them to readonly paths and keeps system-directory precedence. Strict workspaces may not overlap the managed store, even through symlinks. System/override runtimes do not gain private-read exceptions automatically. Tools under denied or unmounted directories can still fail even when discovered. Linux networking additionally receives read-only public DNS/hosts/NSS and certificate-store configuration, not the host’s full /etc or private trees.

Discovery itself does not install packages. Strict terminal calls may use npm/npx/uvx to download packages; package lifecycle scripts run under the same sandbox. HOME, temp variables, npm cache/prefix, uv/pip cache and XDG_CACHE_HOME default inside the workspace. Global npm installs are therefore workspace-local, not system-wide. Installers that insist on writing to protected locations can still fail. Home-based version managers are not initialized by sourcing .zshrc or another shell profile. Configured MCP servers resolve their own environment and do not inherit the native terminal’s sandbox policy.

Strict terminal calls use /usr/bin/sandbox-exec with a generated profile.

Resource Current policy
File reads Runtime reads allowed, private trees denied, then the workspace and selected verified managed version trees re-allowed
File writes Denied outside the workspace, except /dev/null
Process execution Allowed so system and installed tools can run
Process fork Allowed
Network Allowed for strict terminal calls, including package downloads, local servers and external transmission of workspace content
Environment System PATH plus discovered runtime directories; HOME, TMPDIR, TMP, and TEMP point to the workspace; host secrets are not inherited

The profile preserves reads needed by system runtimes; it is not a claim that every readable byte is inside the workspace. Private-tree denies narrow host access, and availability includes a synthetic workspace/sibling confinement self-check. A failed self-check makes strict execution unavailable rather than enabling a permissive profile.

GUI applications and helpers are outside this profile’s scope. The generated profile does not allow Mach service lookup, so sandboxed processes cannot connect to WindowServer, the pasteboard, LaunchServices, or TCC. A command such as agent-desktop permissions --guide can report started and keep a helper alive while no window appears. Run GUI-dependent commands in Open mode or outside the CaberOS agent terminal; Open mode still needs the relevant macOS privacy grants for the responsible app.

The dedicated live Seatbelt test cases require an isolated macOS runner and CABEROS_TEST_SEATBELT_LIVE=1. Skipping those cases is not proof of enforcement on every host. Keep credentials out of the workspace and use a separate OS-account/container/VM boundary for higher-risk workloads.

Native read_file remains workspace-contained; the broader read behavior applies to commands executed by terminal.

Require approval for terminal calls and inspect commands for paths, redirections, interpreters, encoded scripts, and indirect execution.

Strict terminal calls use Bubblewrap with:

  • a cleared environment;
  • system/runtime PATH restricted to existing read-only runtime mounts and workspace HOME;
  • read-only /usr, /bin, /lib, and /lib64 bindings;
  • a writable workspace mounted at /workspace;
  • a temporary in-memory /tmp;
  • isolated process, IPC and mount namespaces; terminal calls share host networking via --share-net;
  • read-only public DNS/hosts/NSS and CA certificate configuration for networked calls;
  • parent-death and new-session controls;
  • no shared network unless explicitly requested by code.

Bubblewrap must be installed and usable by the host/container. CaberOS probes availability because a binary can exist while user namespaces or container policy prevent it from running.

Do not assume macOS and Linux strict mode expose identical readable files.

Terminal execution waits for a configured duration, 30 seconds by default, and reports a timeout result when that wait expires.

Do not rely on this timeout as the only process-lifecycle control. The current command wrapper does not provide a durable job supervisor or a cross-platform guarantee that every descendant process is terminated at the exact timeout boundary.

Avoid commands that daemonize, fork detached processes, or start persistent services. Use explicit process controls outside the agent runtime for long-lived workloads.

Strict and Open terminal calls both allow networking. Strict is a filesystem restriction, not an offline or data-loss-prevention mode. Package scripts can transmit workspace files; a dev server can expose them to its clients. Prefer loopback-bound development servers unless broader exposure is intended.

Other network pathways remain separate:

  • web_search or web_fetch, which intentionally use the gateway’s network;
  • hosted model requests;
  • MCP HTTP servers;
  • stdio MCP servers making their own network requests;
  • external channel adapters;
  • configured MCP server processes, whose sandbox policy is independent.

Capability approval and egress labels control model access to those pathways; host firewalls provide an additional independent layer.

MCP tools still pass through the syscall mediator, but the MCP server implementation is outside the native tool sandbox.

For a mediated call, CaberOS verifies grants, parent authority, subject binding, server status, tool filters, approval, and credential binding. It then forwards arguments to the server.

A malicious stdio server may act when launched or connected, before any model tool call. Review third-party package install scripts, executable paths, dependencies, and updates. Run high-risk servers under a separate OS account or container if stronger isolation is needed.

A sub-agent has a requested capability list and shares the parent’s workspace and sandbox mode. Every child call is also checked against the parent agent’s grants.

Effective authority can narrow but not widen through delegation. Sub-agent events and audit records retain a sub-agent identifier within the parent run.

This control does not create a separate OS process or separate filesystem sandbox for the sub-agent model loop.

Input guardrails:

  • redact recognized secret formats before typed text is stored or sent to the model;
  • warn on common instruction-override patterns;
  • continue processing the message.

Output guardrails:

  • redact recognized credential formats;
  • warn on common injected-instruction echoes;
  • detect some home paths, agent-home paths, prompt markers, and multiple internal UUIDs;
  • replace selected path leakage patterns.

These checks are regular-expression heuristics. They can produce false positives and false negatives. They do not inspect every binary attachment before storage, prove whether a document is malicious, or replace capability enforcement.

Allowed and denied syscalls store:

  • run and agent;
  • sub-agent when applicable;
  • capability;
  • resolved subject when applicable;
  • arguments;
  • bounded result;
  • decision and denial reason;
  • latency and capability cost fields.

Audit records can themselves contain sensitive filenames, commands, URLs, document data, or tool output. Protect the database and sanitize records before sharing them.

Sandbox: strict
Capabilities: doc_list, doc_search, read_file
Terminal: not permitted
Web: not permitted
MCP: not permitted
YOLO: off
Sandbox: strict
Capabilities: web_search and web_fetch on demand
Approval: enabled for both
Terminal: not permitted
YOLO: off
Sandbox: strict
Capabilities: read_file, write_file, edit_file, search_files, terminal
Terminal approval: enabled
Workspace: dedicated repository copy
Credentials in workspace: none
YOLO: off

On macOS, strict execution still permits runtime reads outside the workspace, but denies the configured private trees. Approval does not grant a read-isolation guarantee beyond the installed backend’s actual policy.

Open the run trace and inspect the denial reason. Check grant, loaded schema, parent authority, contact binding, approval outcome, MCP server status, and tool filter separately.

A terminal command can read a host file on macOS

Section titled “A terminal command can read a host file on macOS”

First distinguish public runtime files from protected private-tree files and confirm the run used strict mode. Unexpected access to a protected private path should be investigated, not dismissed as normal. Disable terminal while investigating, or use a stronger VM/container/OS-account boundary.

Strict terminal calls allow networking, so this is not a sandbox network block. Check DNS, proxy or firewall settings, the runtime doing the request, and host network policy. If the command still cannot connect, use an explicit web or MCP capability with appropriate approval for governed access rather than weakening filesystem isolation casually.

Stop the relevant process at the OS level and inspect descendants. Do not use the terminal tool as a service supervisor.

An external channel call never shows approval

Section titled “An external channel call never shows approval”

Check the channel’s effective approval policy and global YOLO mode. Existing migrated channels may use auto-approval.

Treat the content as untrusted, inspect the source, reject consequential calls, and narrow capabilities. The warning itself does not establish malicious intent.

  • Keep strict mode unless broad host access is essential.
  • Keep terminal disabled for agents that only need documents, memory, or APIs.
  • Require terminal and web approvals.
  • Use exact remembered approvals.
  • Review existing channel policy after upgrades.
  • Keep YOLO mode off.
  • Remove credentials from workspaces and attachments.
  • Run untrusted MCP software in an external isolation boundary.
  • Review syscall audit records and model context.
  • Use host firewall, OS permissions, and disk encryption as independent layers.