Trust a repo¶
Activate the .failsafe.rego policy that lives in a repository by adding the repo's path to the trust list.
Background¶
A .failsafe.rego file cloned from an untrusted source could loosen your guards. failsafe therefore ignores repo-level policies until you explicitly trust the path. See Trust model for the reasoning.
Add a repo¶
From inside the repo (the command walks up from your cwd to find the nearest .failsafe.rego):
Or pass an absolute path:
On success:
If the repo is already trusted, the command exits cleanly:
What counts as the repo root?
failsafe trust add . walks up from the current directory until it finds a .failsafe.rego file, stopping at $HOME. That directory becomes the trusted path. If no .failsafe.rego is found, the command prints an error. Create the policy file first (see Protect a repo with a checked-in policy).
List trusted repos¶
Each line shows the absolute path, an optional reason (if one was recorded), and the date it was added:
/path/to/your/repo (added 2026-05-31)
/path/to/another-repo — added after security review (added 2026-04-10)
Remove a repo¶
After removal, the .failsafe.rego in that repo is skipped again. Bundled and user policies still apply.
Check whether a repo is trusted¶
Checks the repo containing the current directory. Exit code 0 = trusted, 1 = not trusted:
Pass a path to check a specific directory:
Confirming the policy loaded¶
After trusting, run failsafe explain to confirm the repo layer appears and is marked [trusted]:
Policy chain (2 modules at this cwd):
[bundled] bundled/kubectl.rego
[repo] /path/to/your/repo/.failsafe.rego [trusted]
If you still see [untrusted], the path recorded in the trust list does not match the resolved repo root. Run failsafe trust list and compare.