CLI

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

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.

capyshield.yaml
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 egress 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.

Blocked-host reports sent to the Cloud contain host, port, rule id and count — never payloads or env values.