nodrail

All guides

Approve once vs always allow: scoped rules for AI agents

By Nodrail · 5 min read · Published

On this page
  1. What a one-time approval authorizes
  2. What a standing rule has to define
  3. What happens when something changes
  4. Keep precedence simple
  5. Control who can create a rule
  6. Revocation, expiry and work in progress
  7. Test that nothing is inherited
  8. Where rules stop

Approving once authorizes one exact action. "Always allow" creates a standing rule that authorizes future requests without a person looking at them. They are different decisions with different consequences, and an auto-approval rule should be narrow enough that you could read it aloud and say exactly what it permits.

Rules exist for a good reason: if every routine action needs a click, reviewers stop examining what they approve. The goal is fewer repeated reviews without turning one approval into broad access.

The policy and tables below are illustrative. They are not a published Nodrail format or evidence of a deployed integration.

What a one-time approval authorizes

A one-time approval answers one question: may this agent perform this exact operation, on this resource, with these parameters, now?

The OWASP AI Agent Security Cheat Sheet recommends binding approval to the exact action, including the actor, tool, target resource, normalized parameters, timestamp and expiry. It should be consumed once. Afterwards, the next request is a new request, even if it looks the same. See the human approval guide for that lifecycle.

What a standing rule has to define

A rule replaces a human decision for every request it matches, so each dimension should be stated rather than implied:

# Illustrative only. Not a Nodrail policy format.
rule:
  agent:      release-agent
  tool:       github
  action:     release.create
  resource:   acme/website
  conditions: environment == staging
  decision:   allow
  created_by: a person with authority over this scope
  expires:    a concrete date, or a reviewed decision to have none

Avoid wildcards while you are learning what the agent does. The same cheat sheet advises against giving agents unrestricted tool access or wildcard permissions.

Check what "always" really means in the runtime you use. A sticky choice may apply only to later calls to one tool within the current run, while a standing organization policy can outlive that run. Read the exact runtime documentation and make the scope visible before asking someone to save the choice.

What happens when something changes

Take the rule above, created after a person reviewed one release. Here is how later requests behave in this model:

RequestOutcomeWhy
release.create on acme/website, staging, v1.4.1Allowed by the ruleEvery condition matches
release.create on acme/website, staging, v1.5.0Allowed by the ruleThe version is not part of its scope
release.create on acme/website, productionNeeds reviewThe environment is outside the rule
release.create on acme/docs, stagingNeeds reviewAnother repository does not inherit it
release.delete on acme/website, stagingNeeds reviewAnother operation does not inherit it
The same action from support-agentNeeds reviewAnother agent does not inherit it
The same action through a gitlab toolNeeds reviewAnother tool does not inherit it

Look at the second row before saving. If a major version should get a human look, the rule needs a condition that says so. Anything left out of a rule is something the rule permits.

Keep precedence simple

Decide what wins when policies overlap and write it down. In this model:

  1. An explicit prohibition wins over any rule or approval.
  2. A valid rule can allow a request without review.
  3. Anything else stops and asks, or is denied.

A rule should not be able to override a prohibition, and a one-time approval should not be able to either.

Control who can create a rule

Creating a rule is a change to your policy, and a more consequential act than approving one action. In this model:

  • The agent cannot create, widen or renew its own rules.
  • Authority to approve one request does not imply authority to save a rule.
  • The confirmation shows the exact scope. A button labeled "Always allow" should say what "always" includes.
  • Text produced by the agent is never used to fill in the rule's scope unreviewed.

Revocation, expiry and work in progress

A rule should be easy to find and revoke. Revoking it affects later checks; it cannot undo what already happened.

Decide these cases in advance:

SituationA defensible default
Rule revoked before the next checkThe next request no longer matches it
Rule revoked while a call is runningThe call is not recalled; record what happened
Rule expiredRequests return to review, not to allow
Policy service unavailableThe call stops rather than relying on a stale allow

If your integration caches decisions, document how long a revoked rule can keep working. That delay is part of the guarantee you are offering.

Test that nothing is inherited

Run these with a simulated tool and count real invocations:

ScenarioExpected result in this model
One-time approval reused for a second releaseNo second invocation
Rule applied to another repositoryNo invocation without review
Rule applied to another agent or toolNo invocation without review
Agent attempts to create its own ruleRejected and recorded
Next check after revocationThe rule no longer authorizes the call
Prohibition overlaps with a ruleThe prohibition wins

These are acceptance criteria for the example, not results from a test we have already run.

Where rules stop

A rule only applies to calls that pass through an enforced check, and an allow decision does not prove that a tool ran or succeeded. To decide what a rule should cover in the first place, start with the guide to managing agent permissions.

Model repeated work with a scoped APF allow rule and keep individual approvals tied to their requests. Test a standing rule or explore shared approvals.