Policy Reference

YAML policy files configure how tirith responds to detected threats.

01Policy Discovery

Tirith discovers policy files by walking up the directory tree from the current working directory to the nearest .git boundary, looking for:

  • -.tirith/policy.yaml (then .yml)
  • -Fallback: ~/.config/tirith/policy.yaml

02Example Policy

policy.yaml
# .tirith/policy.yaml
fail_mode: closed
 
allowlist:
- "*.example.com"
- "registry.npmjs.org"
- "ghcr.io/*"
 
blocklist:
- "evil.example"
- "*.malware.test"
 
severity_overrides:
plain_http: warn
shortened_url: info
 
allow_bypass_env: false

03Fields

fail_mode

Controls behavior when the engine encounters an error. open allows execution to proceed, closed blocks execution on error. Default: open.

allowlist

A list of glob patterns for domains and URLs that should be excluded from findings. Matching URLs will not trigger any rules. Supports wildcards.

blocklist

A list of glob patterns for domains that should always be blocked, regardless of rule results. Blocklist overrides allowlist when both match.

severity_overrides

Override the default severity for specific rule IDs. Valid values: block, warn, info. This lets you tune which rules block execution vs. just warn.

allow_bypass_env

When true, users can set TIRITH_BYPASS=1 to skip blocking. Default: false. Useful for CI environments where a human has reviewed the command.

04Centralized Policies (Team+)

Team and Enterprise tiers can manage policies centrally through the admin console. The CLI fetches the active policy from the server on startup and caches it locally. Local policy files are merged with the server policy, with the server taking precedence.