Two different sandboxes. Comis has two distinct sandbox concepts that are
sometimes conflated:
- Skill sandbox (this page) — application-level protection that runs whenever a skill is loaded or invoked: content scanning, sanitization, tool policy, budget caps. This applies to all skills regardless of how they execute.
- Exec sandbox (separate page) — OS-level
filesystem isolation for the
system.exectool only, using bubblewrap on Linux or sandbox-exec on macOS. It does not sandbox arbitrary agent code, MCP servers, or in-process Node tools.
What the Sandbox Protects Against
The sandboxing system is designed to catch a range of threats:- Malicious skills — A skill that tries to execute system commands, read environment variables, or exfiltrate data
- Compromised dependencies — An MCP server or external tool that has been tampered with
- Resource abuse — A skill that consumes excessive memory, CPU, or network bandwidth
- Data exfiltration — A skill that tries to send your data to external servers
- Prompt injection via skills — A skill that contains hidden instructions to override agent behavior
How the Sandbox Works
The sandboxing process is automatic. When an agent loads a skill, Comis runs it through a pipeline of checks before the skill can execute. You do not need to invoke the sandbox manually — it is always active for all skills. The key principle is defense in depth: each layer catches a different type of threat, so a skill must pass all of them to execute. A threat that slips past one layer is caught by the next.The Four Layers of Sandboxing
Skills pass through four layers of protection before and during execution. Each layer catches a different category of threat.Content Scanning
Before a skill is loaded, Comis scans its content for six threat categories:
- Command execution — Shell commands, eval calls, subprocess invocations
- Environment harvesting — Attempts to read API keys from environment variables
- Cryptocurrency mining — Crypto mining scripts or wallet addresses
- Network exfiltration — Suspicious outbound network requests
- Obfuscated encoding — Base64-encoded payloads and other encoding tricks
- XML injection — XML entity attacks and breakout attempts
Sanitization
All skill content passes through a four-step sanitization pipeline:
- HTML comment stripping — Removes hidden instructions embedded in HTML comments
- Unicode normalization (NFKC) — Converts visually similar characters to their canonical forms
- Invisible character removal — Strips zero-width characters and other invisible Unicode
- Size enforcement — Rejects content exceeding the 20,000 character limit
Tool Policy
Each agent has a tool policy that controls which tools skills can access. Five built-in profiles give you a starting point:
- minimal — Basic file operations only
- coding — Development tools (read, write, edit, execute)
- messaging — Communication tools only
- supervisor — Fleet management and administration
- full — All tools, no restrictions (this is the default)
Execution Constraints
During execution, additional safety limits apply:
- Budget caps prevent runaway API costs by limiting tokens per execution
- Circuit breakers pause agents with high error rates to prevent cascading failures
- Step limits cap the number of tool calls per execution
OS-Level Filesystem Sandbox (Exec Tool)
For the special case of thesystem.exec tool, which spawns a shell, the
skill-level layers above are reinforced by a kernel-enforced filesystem
namespace. This is the only Comis sandbox that operates at the OS level.
| Platform | Provider | Mechanism |
|---|---|---|
| Linux | bubblewrap (bwrap) | Mount, PID, user, IPC, and cgroup namespaces; private /tmp; --die-with-parent |
| macOS | sandbox-exec (built-in) | SBPL profile generated per invocation; default-deny; symlink-aware paths |
execSandbox.enabled: "always" and ensuring the binary
is installed).
Successful exec call vs blocked exec call
Here is what an agent sees when it tries to read a permitted vs forbidden path through the exec tool. The agent’s workspace lives at~/.comis/workspace-code-assistant/.
What Happens When a Threat Is Found
The response depends on the severity of the finding:- Critical threat — The skill is blocked from loading. An audit event is recorded. The agent continues without the compromised skill.
- Warning — The skill loads with a warning logged. The audit trail records the concern for your review.
- Clean — The skill passes all checks and loads normally.
If a legitimate skill is incorrectly flagged as a threat, you can adjust the content scanning configuration to allow specific patterns. See Security Scanning for details.
Configuration
The most relevant sandbox settings are shown below. Detailed configuration lives on the linked pages.~/.comis/config.yaml
| Setting | Default | Details |
|---|---|---|
skills.contentScanning.enabled | true | Security Scanning |
skills.contentScanning.blockOnCritical | true | Security Scanning |
skills.toolPolicy.profile | full | Tool Policy |
MCP Server Sandboxing
MCP (Model Context Protocol) integrations connect your agents to external tools and data sources. Because MCP servers run as separate processes, they receive the same sandboxing treatment as other skills:- Content scanning applies to the MCP server manifest and tool descriptions
- Tool policy controls which MCP tools your agents can use
- Execution constraints apply to MCP tool calls just like built-in tool calls
Related
Security Scanning
Detailed content scanner documentation
Tool Policy
Configure per-agent tool restrictions
Defense in Depth
How sandboxing fits into the security layers
Sandbox Reference
Technical sandbox reference
