Skip to the content

Policies

What a policy says, and how to move it from audit to enforce.

What a policy says

A policy is a YAML file in your agents.d directory, validated against the published schema (agentgarm.com/schemas/agents/v1). It names the agent it covers, its mode, how it fails, and the boundaries the agent works within. The opening of the default Claude Code pack:

# AgentGarm default policy pack: Claude Code.
# Install with `agentgarm policy init claude-code`. Packs ship in audit mode: run
# `agentgarm policy lint --blast-radius` on your own history before promoting to enforce.
schema: agentgarm.com/schemas/agents/v1
name: claude-code
version: "1.1.0"
mode: audit
profile: interactive
on_internal_error: fail_open_alert

match:
  launcher: true
  binaries: [claude]
  process_tree_root: true

swarm_governance:
  max_subagent_depth: 4
  max_concurrent_subagents: 8
  loop_detection:
    max_identical_tool_calls: 8
    window_seconds: 120
    action: alert

security_boundaries:
  filesystem:
    # Reads of credentials are denied; .env.example and other templates stay readable.
    deny:
      - "~/.ssh"
      - "~/.aws"
      - "~/.gnupg"
      - "~/.config/gcloud"
      - "~/.azure"
      - "~/.kube/config"
      - "~/.netrc"
      - "~/.git-credentials"
      - "~/.docker/config.json"
      - "~/.config/gh/hosts.yml"
      - "**/.env"
      - "**/.env.local"
      - "**/.env.*.local"
    # Configuration that runs commands outside any sandbox: file tools may not change it.

Audit, then enforce

Packs ship in audit mode: every decision is made and recorded, and nothing is blocked. Check a candidate against what your agents actually did before you enforce it:

agentgarm policy lint ~/.config/agentgarm/agents.d/claude-code.yaml --blast-radius

It reports shadowed and conflicting rules, and what the policy would have denied in your recent history.

Fail modes

Each boundary declares how it fails: fail_closed denies when AgentGarm cannot decide, and fail_open_alert lets the action through and raises an alert. Where each is enforced.