the short answer
Yes. Repository rules live in project-scope policy files committed with the code. Central rules are deployed per machine from the console, in observe or enforce mode. Persona assignment, such as stricter rules for on-call or infra admins, is available in managed deployments, and you can also key a policy on the credentials a command uses. Use repository scope for conventions, persona and credential rules for risk, and one base pack everywhere.
- Repository
<repo>/.failproofai/policies/*policies.{js,mjs,ts}, committed- Local
<repo>/.failproofai/policies-config.local.json, one user, gitignored- User
~/.failproofai/policies/and~/.failproofai/policies-config.json- Machine
- Cloud deployment per machine, observe or enforce
- Persona
- Assigned in managed deployments, or keyed on the credentials in a command
The Scopes
| Scope | Where it lives | Who changes it | Use it for |
|---|---|---|---|
| Repository (project) | .failproofai/policies/ and .failproofai/policies-config.json in the repo | Anyone who can merge to the repo | Project conventions: generated files, package manager, test-before-stop |
| Local | .failproofai/policies-config.local.json in the repo, gitignored | One developer, for one project | Overrides for that developer only; not a control |
| User | ~/.failproofai/policies/ and ~/.failproofai/policies-config.json | The developer | Personal preferences; not a control |
| Machine | Cloud deployment from Admin → enforcement or fp fleet deploy | Admins | Org-wide guardrails, observe or enforce per policy |
| Persona | Assigned by role in managed deployments, or a policy that keys on elevated credentials | Admins | Stricter rules for infra admins and on-call |
A Typical Persona Map
Failproof’s managed console lets admins assign policy sets by persona; ask us how persona assignments map to machine deployments in your setup. You can also script per-machine assignments yourself with fp fleet deploy.
| Persona | Adds on top of the base pack |
|---|---|
| All engineers | Pack defaults (secrets, push to main, sudo, curl-pipe-sh), plus block-force-push |
| Backend | Database target checks, migration conventions |
| Infra and platform admins | Terraform plan-only, Route 53 protection, Kubernetes prod guard, approved AWS profile |
| On-call (rotating) | Elevated-profile guard: agents diagnose, humans change production |
| Contractors | block-read-outside-cwd (off by default in the pack), no cloud CLI |
Scripting per-Machine Assignment
Label machines right after enrolling (failproofai config --machine-label infra-alice-mbp); the flag renames a machine that is already connected, and hostnames rarely survive laptop replacement. fp fleet deploy replaces the machine’s set with the computed result: --add keeps what is there, while --set replaces it, so include the base policies when you use --set. Fleet commands exit with an error under an API key, so run this as a signed-in admin, not from unattended CI. Check the JSON shape of fp fleet list in your installed version before relying on the field names.
fp login # fleet commands need a signed-in session with policies:write
fp policies publish terraform-plan-only ./terraform-plan-only.policy.mjs
fp policies publish protect-route53 ./protect-route53.policy.mjs
# Deploy the infra-admin set to every machine labelled infra-*
for id in $(fp --json fleet list | jq -r '.[] | select(.label | startswith("infra-")) | .id'); do
fp fleet deploy "$id" --yes \
--add terraform-plan-only:enforce \
--add protect-route53:enforce
doneWhen Scopes Overlap
- Built-in policies evaluate before custom ones, and the first deny stops evaluation. A repository cannot “allow” its way past a central deny.
- Policy parameters (for example
allowPathsonblock-rm-rf) come from the first scope that defines them, in project, local, user order. - Which pack policies are on is machine-wide, not per repository, regardless of
--scope. - Repository policies are code that anyone with merge rights can change. Treat
.failproofai/like CI config and require review on it.
Credential-Keyed Rules Are Harder to Escape
Machine-based assignment assumes the right person is on the right laptop. Credential-keyed rules assume nothing: they apply stricter checks whenever a command names an elevated profile, whoever runs it. That is the better fit for rotating roles like on-call; see on-call guardrails.
FAQ
Can a repository weaken an org-wide policy?
A repository can add policies and set parameters for its own scope, and parameters can broaden what a built-in allows (for example an allow path). Review .failproofai/ changes like CI changes. A repository cannot remove a centrally deployed policy.
Can I target a policy at one user rather than a machine?
Central deployments target machines. Map people to machines with labels after enrollment, use persona assignment in a managed deployment, or key the policy on the credentials that person holds.
How do I see which policies a machine runs?
On the machine, failproofai policies. Centrally, fp fleet show <machine-id> or the machine row under Admin → enforcement.
Sources
Checked against the sources below on October 21, 2026. Harness settings, hook capabilities and cloud features change between versions.
- Failproof AI docs: Local configuration
- Failproof AI docs: Custom policies (policy SDK)
- Failproof AI docs: Deploy a policy
- Failproof AI docs: Cloud CLI reference
- Failproof AI docs: failproofai CLI reference
- Failproof AI docs: Use a policy pack
- Failproof AI docs: Users and organizations