Agent Governance ToolkitAgent Governance Toolkit 4.1.0 · Python 3.10+
Dashboard
0%

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.

ExampleThe four default actions on 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}")

What the four actions mean

  • allow permits the call, so allowed is true.
  • deny refuses the call, so allowed is false.
  • audit permits the call like allow, but marks it as worth recording rather than blocking, so allowed is true.
  • block refuses the call like deny, so allowed is 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.

yaml
version: "1.0"
name: no-default
rules:
  - name: allow-status
    condition: {field: action, operator: eq, value: order_status}
    action: allow
ExampleNo defaults block means fail-open, not deny
from 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)

What each default does to an unmatched call

Default actionallowedThe call
allowTrueRuns
auditTrueRuns, and is flagged for recording
denyFalseIs refused
blockFalseIs refused
OmittedTrueRuns, because the default is allow

Where the default matters

  • A fail-closed policy, where defaults.action is 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 defaults block is present at all.
Watch out. Leaving out the 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.
Try it yourself
  • Add a defaults block with action: deny to the second file and watch the deletion flip to refused.
  • Evaluate order_status against the no-default file and confirm the allow rule still matches by name.
  • Change one default to audit and read both allowed and action on the decision.

You understood something today that you didn't yesterday.