Skip to Content
RabbitLock Docs

Policy file

The rabbitlock.agent.yaml schema.

rabbitlock.agent.yaml
project: 3f9a1c2b7d4e                  # written by `rabbitlock init`

# Team mode only (written by `rabbitlock team enable`):
# secrets_file: secrets.sops.json
# recipients:
#   - { name: you, key: 3f9a… }
#   - { name: ana, key: 8c21… }

secrets:
  GITHUB_TOKEN:
    hosts: [api.github.com, github.com]
  STRIPE_API_KEY:
    hosts: [api.stripe.com]
    approval: once
  INTERNAL_API_KEY:
    hosts: ["*.internal.example.com"]
    approval: every

Fields

FieldTypeDefaultNotes
projectid ([a-z0-9-], 4 to 64 chars)written by initWithout secrets_file, secrets and receipts live in ~/.rabbitlock/projects/<project>/ (individual mode)
secrets_filepathnoneSet by team enable. The encrypted file lives here, relative to the policy file, and is committed (team mode)
receiptspath~/.rabbitlock/projects/<project>/receipts.jsonlRelative to the policy file if set
recipientslist of hex keys, or { name, key }[]Who can decrypt in team mode. Your own key is always added on write. Manage with rabbitlock team
secretsmap{}Only secrets listed here reach the agent
secrets.<NAME>.hostslistrequired, non-emptyExact host names, or one leading wildcard
secrets.<NAME>.approvalnever | once | everyneverSee Approvals

Host matching

  • Exact, case-insensitive: api.github.com matches only api.github.com.
  • Wildcard: *.example.com matches a.example.com and a.b.example.com, but not example.com itself, and not evilexample.com.
  • No schemes, paths or ports. https://api.github.com/user is rejected.

Validation

Malformed entries are errors, never guesses. A typo must not silently widen or drop protection. RabbitLock refuses to run with:

  • a secret name that doesn't match ^[A-Z][A-Z0-9_]*$
  • a missing or empty hosts list, or an invalid host entry
  • an approval value other than never, once or every
  • a project id with characters other than a-z, 0-9 and -
  • recipients entries that aren't a hex key or { name, key }

Policies written before 0.4 (no project, no secrets_file) keep their secrets in secrets.sops.json and receipts in .rabbitlock/ next to the policy, as before.

On this page