Defaults: allow, deny, audit and block
The default action is what a policy decides when no rule matches a call, and it is one of four values, allow, deny, audit or block, with allow and audit permitting the call and deny and block refusing it.
Last updated: 14 Oct, 2026 · Agent Governance Toolkit 4.1.0
Every lesson so far leaned on defaults.action without looking at it. The Which rule wins: priority lesson let a call fall through to the default; this lesson is about that fall-through, the four values it can take, and the one value it takes when you leave it out.
The four default actions
A policy with no rules puts every call on the default. Building the same empty policy four times, once per action, shows what each default does to a call that matched nothing.
import warnings; warnings.simplefilter("ignore")
import tempfile, os
from agent_os.policies.schema import PolicyDocument
from agent_os.policies.evaluator import PolicyEvaluator
# the same empty policy; only defaults.action changes between the four
template = "name: d\nrules: []\ndefaults: {{action: {0}}}\n"
folder = tempfile.mkdtemp()
for action in ["allow", "deny", "audit", "block"]:
path = os.path.join(folder, action + ".yaml")
open(path, "w").write(template.format(action))
d = PolicyEvaluator(policies=[PolicyDocument.from_yaml(path)]).evaluate({"action": "x"})
print(f"default {action:6} -> allowed={d.allowed!s:5} action={d.action}")default allow -> allowed=True action=allow default deny -> allowed=False action=deny default audit -> allowed=True action=audit default block -> allowed=False action=block
What the four actions mean
- allow permits the call, so
allowedis true. - deny refuses the call, so
allowedis false. - audit permits the call like allow, but marks it as worth recording rather than blocking, so
allowedis true. - block refuses the call like deny, so
allowedis false. The pairing is deliberate: allow and audit let a call run, deny and block stop it.
The default when you leave it out
The value that bites is the one you did not set. A policy file that names rules but no defaults block does not fall back to deny. It falls back to allow, so a call matching no rule is permitted. This is the fail-open default from the first part, now in a file.
version: "1.0"
name: no-default
rules:
- name: allow-status
condition: {field: action, operator: eq, value: order_status}
action: allowfrom agent_os.policies.schema import PolicyDocument
from agent_os.policies.evaluator import PolicyEvaluator
doc = PolicyDocument.from_yaml("no-default.yaml")
print("defaults.action with none set:", doc.defaults.action.value)
# delete_account matches no rule, so the default decides the call
d = PolicyEvaluator(policies=[doc]).evaluate({"action": "delete_account"})
print("delete_account allowed:", d.allowed, "| rule:", d.matched_rule)defaults.action with none set: allow delete_account allowed: True | rule: None
What each default does to an unmatched call
| Default action | allowed | The call |
|---|---|---|
| allow | True | Runs |
| audit | True | Runs, and is flagged for recording |
| deny | False | Is refused |
| block | False | Is refused |
| Omitted | True | Runs, because the default is allow |
Where the default matters
- A fail-closed policy, where
defaults.actionis deny so a call matching no rule is refused rather than waved through. - An observe-first rollout, where the default is audit so nothing is blocked while you watch what would have been.
- A review of any policy file, where the first thing to check is whether a
defaultsblock is present at all.
defaults block does not mean no default; it means the allow default, which lets every unmatched call through. For a policy you trust to stop things, set defaults.action to deny explicitly and never rely on the absence of a block.Related
- Previous: Which rule wins: priority
- Next: Policy scope
- See also: Governance is opt-in: the fail-open default
- Add a
defaultsblock withaction: denyto the second file and watch the deletion flip to refused. - Evaluate
order_statusagainst the no-default file and confirm the allow rule still matches by name. - Change one default to
auditand read bothallowedandactionon the decision.
You understood something today that you didn't yesterday.