full, and exec isolation can fall back to ordinary host
execution. Use this checklist before exposing Comis to untrusted users or a
network.
Quick Check: Run the Security Audit
Before working through the checklist manually, run the built-in security audit to see where your installation stands:Hardening Checklist
Critical (Do First)
These items address the most significant security risks. Complete them before exposing your installation to any network.1
Set file permissions
Your config file contains sensitive settings and your data directory holds databases and secrets. Restrict access so only your user account can read them:Why: Prevents other users on the system from reading your configuration or data files. On a shared server, this is essential.Verify:
ls -la ~/.comis/config.yaml shows -rw-------.2
Remove plaintext secrets from config
If your config.yaml contains raw API keys, migrate them to environment variables or the encrypted store:Or better yet: set up the encrypted secrets store for production-grade secret management.Why: Config files may be backed up, shared, or accidentally committed to version control. Plaintext secrets in config are the most common security mistake.Verify:
comis doctor reports no “plaintext secret” findings.3
Configure gateway authentication
If you expose the HTTP gateway (for the web dashboard, JSON-RPC, or WebSocket), always require authentication tokens. Each token entry needs a unique Generate a strong token:Why: Without authentication, anyone who can reach the gateway can control your agents, read your data, and modify your configuration.Verify:
id, a secret of at least 32 characters, and the scopes it is allowed to use:~/.comis/config.yaml
curl http://localhost:4766/health returns 200, but curl http://localhost:4766/api/agents returns 401.4
Bind to localhost or enable TLS
If the gateway is only for local use (web dashboard on the same machine), bind to localhost:If you need remote access, enable TLS to encrypt traffic:Why: Without TLS, traffic (including auth tokens) is sent in plain text over the network. Anyone on the same network can intercept it.Verify:
~/.comis/config.yaml
~/.comis/config.yaml
comis doctor reports no “gateway exposure” findings.Important (Do Next)
These items strengthen your security posture significantly. They are important for any production deployment.1
Enable the encrypted secrets store
Migrate from .env files to the encrypted store for production:The encrypted store uses AES-256-GCM encryption at rest, protecting your secrets even if someone gains access to the data directory. This is the default backend.See Secrets for the step-by-step setup procedure, including master key generation and importing existing secrets.Why: .env files store secrets in plain text. The encrypted store ensures secrets cannot be read without the master key.
~/.comis/config.yaml
2
Configure per-agent secret access
Restrict each agent to only the secrets it needs using glob patterns:See Secrets: Per-Agent Access for details.Why: Follows the principle of least privilege. If an agent is compromised, it can only access the secrets it was explicitly granted — not every secret in the store.
~/.comis/config.yaml
3
Enable the approval workflow
Require human approval for destructive agent actions:This pauses execution when an agent attempts a destructive action (like deleting a file) and waits for your approval before proceeding. If you do not respond within the timeout, the action is automatically denied.See Approvals for the full configuration including custom rules and timeout settings.Why: Prevents agents from taking irreversible actions without your knowledge. This is especially important for agents with broad tool access.
~/.comis/config.yaml
4
Review tool policy profiles
Switch agents from the default See Tool Policy for all profiles and custom rules.Why: Limits the blast radius if an agent is compromised. A messaging agent does not need file system access, and a coding agent does not need agent administration tools.
full profile to a more restrictive one:~/.comis/config.yaml
5
Verify audit logging is enabled
Confirm that audit logging is active (it should be by default):Why: Audit logs are essential for detecting and investigating security incidents. Without them, you have no visibility into what your agents have done.Verify: Check the Security dashboard Audit Log tab for recent events.
~/.comis/config.yaml
Advanced
These items provide additional hardening for environments with strict security requirements.1
Verify exec sandbox is active
The exec sandbox wraps shell commands in an OS-level namespace so agents
cannot access files outside their workspace. On Linux, this requires
bubblewrap:On macOS, Why: Without the exec sandbox, agents can bypass file tool path
restrictions by using
sandbox-exec is built in — no installation needed.Verify your config does not disable the sandbox:~/.comis/config.yaml
exec cat instead of the read tool. The
sandbox prevents this at the kernel level.Verify: Check logs for "Exec sandbox provider: bwrap" (Linux) or
"Exec sandbox provider: sandbox-exec" (macOS) at daemon startup.2
Configure Node.js permission model
For maximum process isolation, enable the Node.js permission model to restrict what the Comis process itself can access:Why: Restricts the Node.js process itself to only the file paths and network hosts you specify. Even if an attacker achieves code execution, they cannot access files or hosts outside the allowed list.
~/.comis/config.yaml
3
Set up CORS restrictions
If the web dashboard is accessed from a specific domain, restrict CORS to prevent unauthorized web pages from making API requests:Why: Without CORS restrictions, any web page open in a user’s browser could potentially make API requests to your gateway if the user is on the same network.
~/.comis/config.yaml
4
Review plugin hook registrations
If you use custom plugins, review which hooks they register. Each hook point has security implications — a plugin registered on the
beforeToolCall hook can intercept and modify tool invocations, while a plugin on beforeResponse can alter agent output.Why: Malicious or poorly written plugins can intercept and modify messages, tool calls, or agent behavior. Only install plugins from trusted sources.Verify: Review your plugin configuration and the hooks each plugin uses.5
Configure browser sandboxing
If agents use browser tools, ensure sandboxing is properly configured. Browser tools provide powerful web access capabilities, which also means they are a potential vector for data exfiltration or accessing internal services.Why: Browser tools can access the web, which creates opportunities for both SSRF attacks and data exfiltration. Proper sandboxing ensures browser actions are constrained.Verify: Check your
comis doctor output for specific browser security recommendations.What the installer does for you: The browser tool ships enabled, so a default install provisions the browser runtime (unless you pass --without-browser). Whenever the browser runtime is provisioned — the default, or an explicit --with-browser / --with-cloakbrowser — the systemd unit is written with two layers of filesystem isolation around the browser binary:Both are emitted by
render_systemd_unit in install.sh and rendered into /etc/systemd/system/comis.service. The unit is checksummed and refuses to overwrite hand edits, so once you’ve audited the paths they stay stable across upgrades.For the --with-xvfb variant, the companion comis-xvfb.service unit runs as the same user and exposes Xvfb on a Unix socket only (-nolisten tcp) — no network surface added. Both units bind a shared host dir (/run/comis-x11) onto their PrivateTmp /tmp/.X11-unix — Xvfb read-write (it creates the X99 socket), the daemon read-only (it connects) — so the socket is reachable without opening either /tmp more broadly.What it does not do: the daemon does not block what URLs the browser navigates to (beyond the always-on SSRF guard against private IPs, loopback, and cloud metadata endpoints). If you need URL allowlisting, layer that at the network egress level (egress-logging chain + outbound firewall rules).6
Review SSRF attack surface
Review which agents have access to web-fetching tools. SSRF protection is always active — Comis blocks requests to private IPs, loopback addresses, and cloud metadata endpoints — but reducing the number of agents with web access reduces your overall attack surface.Why: Fewer agents with web access means fewer potential SSRF vectors. Even with built-in SSRF protection, defense in depth means reducing unnecessary exposure.
~/.comis/config.yaml
7
Rotate the SECRETS_MASTER_KEY periodically
Treat the master key like any other production credential — rotate it on
a schedule (every 90 days is a reasonable cadence) and after any
suspected exposure. The recommended flow:Why: A compromised master key gives an attacker every secret in the
encrypted store. Periodic rotation limits the blast radius and ensures
your operational runbook actually works before you need it.
8
Lock down the email allowlist
If you enable the email channel, set Comis additionally auto-detects bulk and automated mail (Auto-Submitted
headers, Precedence, List-Unsubscribe, noreply addresses) and rejects
those even if the sender is listed.Why: Email is the easiest prompt-injection vector. An open allowlist
on a public address is equivalent to letting the internet drive your
agent.
allowMode: "allowlist" and list
every legitimate sender. The default closed posture rejects any sender
not on the list:~/.comis/config.yaml
9
Configure network egress allowlist (allowedNetHosts)
If you enable the Node.js permission model, also restrict outbound
network to only the providers your agents actually need:Remember to launch the daemon with the matching
~/.comis/config.yaml
--allow-net=... flag
— the config field alone is a declaration, not enforcement. See
Node Permissions.Why: Even with SSRF protection on every web tool, an
egress allowlist provides a second layer that limits exfiltration to
known good hosts.Verification
After completing the checklist, run the security audit again to confirm your changes:- Severity — Critical, warning, or info
- Description — What was found
- Remediation — Specific steps to fix the finding
- Category — Which security area the finding relates to
Security hardening is not a one-time task. Re-run
comis doctor periodically, especially after configuration changes or upgrades. New versions may introduce additional security checks.Output Guard for Agent File Writes
Comis can scan file writes for secret-shaped values and warn or block before a live API key is committed to disk in cleartext. Configuresecurity.writeSecretGuard (default: warn) — see Secrets — Output Guard for Secret Egress for configuration options and tradeoffs.
Related
Defense in Depth
How the security controls work together
Secrets
Set up the encrypted secrets store
Approvals
Configure human-in-the-loop approval
Security Model Reference
Technical security reference
