Egress policy
Allowlist, blocked hosts and how the guard decides what to stop.
The guard stops outbound connections that would carry a secret, and any host your policy doesn't allow.
How it decides
- It fingerprints sensitive environment values (API keys, tokens) and blocks any connection whose payload contains one.
- By default it reads only the host name (TLSTransport Layer Security — encrypts the connection between your machine and a server. SNI). With
--tls mitm(ortls_inspection: mitm) it decrypts HTTPS with a local CACertificate Authority — issues the local TLS certificate CapyShield uses to inspect traffic. to inspect requests from install scripts and agents. - An allowlist in
capyshield.yamlpermits known-good hosts.
Policy file
Keep the policy in capyshield.yaml at the project root. In enforce mode, once allow_hosts/allow_presets is non-empty, hosts outside it are blocked; deny_hosts always blocks.
version: 1
mode: enforce
fail_mode: fail_closed
egress:
tls_inspection: mitm
allow_presets: ["npm"]
allow_hosts: ["npm.pkg.example.com"]
deny_hosts: ["pastebin.com"]
scan:
pii_patterns: ["credit_card", "private_key", "email"]
agents:
claude-code:
allow_hosts: ["api.anthropic.com", "registry.npmjs.org", "github.com"]Run capyshield presets to list the presets. An agent's allow_hosts replaces the global list for that agent, selected by --agent-id or the X-Agent-ID header.
Team egress policy (Team plan)
Team plans manage one guard egressEgress — outbound network traffic from your machine or CI to external hosts. policy in the dashboard (owners and admins edit it). guard --sync pulls it and adds it to your local capyshield.yaml. Free keeps the local capyshield.yaml only; on Free, guard --sync reports are accepted but discarded.