Pre-Action Authorization for AI Agents: The Missing Security Layer

The gap between what an AI agent can do and what it should do is an authorization problem, not an alignment problem. Model alignment shifts the distribution of outputs toward safe behaviour — but cannot guarantee any individual action. Post-hoc evaluation finds violations in completed runs — after the damage is done. Pre-action authorization is the control that fires before every tool call, evaluates it against declared policy, and blocks it before execution if it does not pass. Under a strict pre-action gate, adversarial social engineering attacks against an AI agent drop from a 74.6% success rate to zero.

AgenticRail enforces pre-action authorization on every step — ALLOW, DENY, or HALT, with a signed receipt written before the action executes.

The pre-action authorization problem

Researchers formalised this gap in early 2026 as the pre-action authorization problem: the absence of a standard mechanism to enforce per-action authorization at the tool-calling boundary — before execution — based on declared policy rather than model inference.

The tool-calling boundary is where the agent's probabilistic reasoning produces a concrete, structured action: a function call, an API request, a database write, a command. Up to that moment, the agent is reasoning about what to do. At that moment, it has decided. Pre-action authorization intercepts that decision before it becomes an execution.

Without it, the decision to execute is made in one of two places, both of which are inadequate:

Three approaches to AI agent authorization — only one fires before execution
Model alignment
Training-time control. Shifts the distribution of outputs toward compliant behaviour. Cannot guarantee any individual action — the same model that refuses 99% of harmful requests will comply with 1%. Vulnerable to prompt injection and jailbreaks targeting that 1%.
Probabilistic. Cannot guarantee.
Post-hoc evaluation
Retrospective, batch analysis. Finds patterns in completed runs. Does not intercept individual tool calls in production. By the time a violation is detected, the action has already executed — the API call was made, the record was written, the email was sent.
Too late. Action already ran.
Pre-action authorization
Synchronous interception before every tool call. Evaluates the action against declared policy. Returns ALLOW or DENY before execution. Produces a signed, tamper-evident record at decision time. External to the agent's reasoning — cannot be bypassed through prompt manipulation.
Before execution. Deterministic.

What the numbers say

Research published in March 2026 ran a live adversarial testbed: social engineering attacks against an LLM-based agent across two conditions — permissive runtime policy and a strict pre-action authorization gate. The results are not close.

74.6%
Attack success — no pre-action gate Social engineering attacks succeeded in manipulating the agent into executing prohibited actions under permissive runtime policy. Model alignment alone.
0%
Attack success — with strict pre-action gate Zero successful attacks across 879 attempts under a restrictive pre-action authorization policy. Same model. Same attack vectors. Different enforcement layer.

The model did not change. The alignment training did not change. The attack vectors did not change. The only difference was the presence of a pre-action gate that evaluated every tool call against declared policy before execution. The attacks could still manipulate the agent's reasoning — but its reasoning no longer controlled whether the action executed.

This is the core architectural insight: the agent's reasoning and the authorization gate are separate systems. Compromising the agent's reasoning does not compromise the gate. The gate's decision is a function of declared policy and current state — not of what the agent believes it should do.

How pre-action authorization works

A pre-action authorization gate fires at the before_tool_call boundary — the moment the agent's reasoning has produced a concrete action and before the framework executes it. The gate is synchronous: the action cannot proceed until the gate returns a decision.

Pre-action authorization — decision sequence per tool call
1
Intercept

The gate receives the proposed action at the tool-calling boundary, before execution. The agent's reasoning produced the action — the gate evaluates whether it is permitted to proceed.

2
Evaluate against declared policy

The gate checks the action against the declared policy: is this function permitted? Is this action type allowed for this function? Is the sequence state correct — is this the next expected step? Is the nonce fresh? Is the timestamp within the validity window?

3
Decide: ALLOW, DENY, or HALT

The decision is deterministic — a pure function of policy and state. ALLOW: all conditions pass, action proceeds. DENY: one or more conditions fail, action blocked with a reason code. HALT: policy-defined termination condition, sequence stopped immediately.

4
Write signed receipt before returning

The decision is HMAC-signed over all fields — action, decision, reason code, nonce, timestamp — and written to immutable storage before the gate returns. The record exists whether the action proceeds or not. It cannot be altered after write.

Steps 2–4 complete in under 100 milliseconds. The gate adds no meaningful latency to the agent's execution path. What it adds is a permanent, verifiable record of every authorization decision — before execution, not after.

Pre-action authorization vs sequence enforcement: both layers required

Pre-action authorization and sequence enforcement are complementary controls that operate at different levels. Both fire before execution. Neither replaces the other.

Control What it enforces What it catches
Pre-action authorization Whether a specific action is permitted by policy — function, action type, parameter bounds Policy-violating actions within a step: wrong function, disallowed action type, out-of-scope capability
Sequence enforcement Whether the step containing the action is the next permitted step in the declared workflow Out-of-order steps, skipped prerequisites, replay attempts, post-seal submissions
Nonce protection Whether this exact action has been submitted before Replay of individual actions or full sequences with original nonces
Sequence sealing Whether the workflow has already completed Post-completion replay, capability extension after workflow close

An agent that passes pre-action authorization but submits its steps out of order still gets a DENY — from sequence enforcement. An agent that follows the correct step order but attempts a prohibited action type still gets a DENY — from pre-action policy evaluation. Both layers must be present for the enforcement record to be complete.

What a pre-action authorization receipt looks like

Every gate decision produces a receipt. The receipt is written before the action executes — it is not a log of what happened, it is the evidence that an authorization decision was made before anything happened. An auditor can verify it offline with the signing key. No agent, no gate, no re-execution required.

Pre-action gate — sequence: loan-proc-3341a / action: submit_credit_decision ALLOW
decision ALLOW — all pre-action conditions passed
function check submit_credit_decision ✓ — declared in policy
action_type check WRITE_RECORD ✓ — permitted for this function at this step
sequence check step 4 of 4 ✓ — all prior steps completed in order
nonce e4d9c2b1-8f3a-4e1d-b027-9c3f2e4a7d51 — first use
recorded before submit_credit_decision executed
hmac sha256:7c3f… — verifiable offline, tamper-evident
Pre-action gate — sequence: loan-proc-9982b / action: submit_credit_decision DENY
decision DENY — SEQUENCE_VIOLATION
sequence check Expected step: fraud_check (step 2). Received: submit_credit_decision (step 4). Steps 2–3 not completed.
action submit_credit_decision blocked — did not execute
recorded before action attempted — credit decision was not submitted
hmac sha256:2a8e… — DENY receipt is tamper-evident, same as ALLOW

The DENY receipt is as auditable as the ALLOW. It proves the gate intercepted a sequence violation before the credit decision executed — not that the violation was discovered in a post-hoc review of completed transactions.

Pre-action authorization and the OWASP Agentic AI Top 10

The OWASP Top 10 for Agentic Applications 2026 (ASI01–ASI10) identifies the critical security risks specific to autonomous AI agents. Pre-action authorization is the structural mitigation for the top three.

OWASP Agentic AI Top 10 — how pre-action authorization responds
Risk
Description
Pre-action gate response
ASI01
Agent Goal Hijacking — adversarial manipulation of the agent's objectives via prompt injection
Gate evaluates actions against declared policy, not the agent's stated goal. Even if the goal is hijacked, the action must still pass the pre-action check. SEQUENCE_VIOLATION fires if the hijacked goal attempts to skip steps.
ASI02
Tool Misuse — agent invokes tools outside their intended purpose or with disallowed parameters
Policy explicitly declares permitted functions and action types per step. An action_type not in policy returns DENY · ACTION_NOT_ALLOWED before the tool executes.
ASI03
Identity and Privilege Abuse — agent exceeds its declared scope or escalates privileges
Sequence contract is the privilege boundary. Actions outside the declared function set return DENY · NO_POLICY_MATCH. Sealed sequences cannot be extended — SEALED_SEQUENCE blocks post-completion capability extension.
ASI05
Memory and Context Poisoning — attacker manipulates stored context to alter future agent behaviour
Gate's sequence state and nonce ledger are maintained independently of the agent's context window. Poisoned context cannot alter the gate's record of what steps have completed.

What compliance frameworks require

EU AI Act · Article 12
Pre-execution evidence
Requires logs enabling reconstruction of the sequence of events. A pre-action receipt written before execution proves the authorization decision happened before the action — not that the action was observed after. This is the difference between enforcement evidence and audit log.
ISO 42001 · A.6.1.6
Operational logging
Certification auditors require records that prove operational constraints ran during execution. A DENY receipt written before a prohibited action executed is proof the constraint fired. A post-hoc anomaly detection flag is an observation — not proof.
NIST AI RMF · Govern 1.2
Accountability structure
Requires policies and processes enabling accountability for AI actions. Pre-action authorization is a structural accountability mechanism: the gate's decision is independent of the agent's reasoning, external to the system it governs, and produces tamper-evident evidence at decision time.
December 2027 — EU AI Act full enforcement

High-risk AI systems — credit scoring, insurance pricing, healthcare triage, recruitment, law enforcement — face full Article 12 logging obligations from December 2027 (extended from 2 August 2026 by the Digital Omnibus on AI, May 2026). Article 12 requires that logs enable reconstruction of the sequence of events. Pre-action authorization receipts satisfy this requirement. Post-hoc evaluation logs do not: they describe what was observed, not what was enforced at execution time.

The deadline is December 2027 (extended from August 2026 by the Digital Omnibus on AI, May 2026). Organizations that have not implemented pre-action authorization for their high-risk AI systems will not have the evidence trail Article 12 requires when it lands.

Pre-action authorization is an infrastructure decision, not a model decision

The framing of AI safety as an alignment problem — something solved at training time by the model vendor — has led many teams to treat authorization as the model's responsibility. If the model is sufficiently aligned, the reasoning goes, it will refuse prohibited actions on its own.

The 74.6% attack success rate against an aligned model under permissive runtime policy demonstrates the ceiling of this approach. Alignment shapes the distribution. It does not set a hard boundary. A sufficiently motivated adversary, or a sufficiently unusual edge case, will find the tail of the distribution and exploit it.

Pre-action authorization is the hard boundary. It does not depend on the model's alignment. It does not depend on the model's reasoning. It does not depend on the prompt instructions the agent was given. It depends on declared policy and current sequence state — both of which are external to the agent and outside the reach of any manipulation that targets the agent's input.

The agent and the gate are separate systems. Compromising one does not compromise the other. This is the architectural property that makes pre-action authorization a security control rather than a safety guideline.

Run a sequence in the demo. Attempt a prohibited action. See the pre-action DENY receipt written before the action executes.