Enforcement
What is pre-execution action enforcement?
Pre-execution action enforcement is an authorization check that runs after an AI agent has decided what to do and before the resulting tool call executes. At that moment the action is fully specified but has not yet had an effect, which makes it the only point in the loop where a governance decision can still prevent an outcome rather than describe one. The check returns allow, block, or escalate.
The interception point
An agent action passes through a fixed sequence, and each stage offers a different amount of information and a different amount of leverage.
| Stage | What is known | Can it be stopped? |
|---|---|---|
| Prompt received | What was asked. Nothing about what the agent will do. | Only by refusing the request outright. |
| Agent reasoning | Partial and provisional. The plan may still change. | Not reliably — there is no final action to rule on. |
| Action decided, not yet executed | Everything: tool, operation, parameters, target, identity. | Yes. Nothing has happened yet. |
| Tool call executing | Everything, plus partial effects. | Partially, and inconsistently. |
| After completion | Everything, including the outcome. | No. Only compensated or reported. |
Only the third row has both properties at once — full information and full reversibility. Earlier, you do not yet know what you are ruling on. Later, you are describing something that already happened. That narrow window is what "post-reasoning, pre-execution" names, and it is where a control has to sit to actually be a control.
What the check evaluates
At the interception point, the action is a fully-specified object rather than an intention. That is what makes deterministic evaluation possible. A pre-execution check has access to:
- The operation. Which tool, which specific operation on it, and the parameters — including the ones that determine blast radius, like the value on a payment or the scope of a delete.
- The target. Which system of record is about to be written to, and how that system is classified.
- The identities. Which agent is acting, and which person or workflow it is acting on behalf of. Both, because Segregation of Duties is a statement about who.
- The history. What this agent and this human have already done in the workflow, which is what makes "did you raise the invoice you are now approving" answerable.
- The scope. The action surface mapped and classified for this agent at design time, which the operation is compared against.
The evaluation is a comparison, not an inference. That keeps it fast — safe actions clear without perceptible latency, because checking whether an operation falls inside a pre-computed scope is a lookup rather than an analysis performed from scratch.
Three outcomes, not two
A binary control forces every policy into a choice between blocking legitimate work and permitting risk, so a third outcome does most of the useful work in practice.
Allow. The operation is inside scope and no threshold applies. It proceeds with the decision recorded. The overwhelming majority of actions land here, which is the point: governance that stops everything is not governance an organisation keeps running.
Block. The operation is outside the agent's scope, or crosses a boundary that has no legitimate exception — an agent approving its own invoice, a coding agent attempting a production drop. The call does not execute and the attempt is recorded.
Escalate. The operation is inside scope but above a threshold or inside a class requiring human authority. The action is held — not queued behind an action that already completed — and routed to the named approver for that scope. It resumes on approval, or is denied. This is where deterministic policy and human judgement meet: the rule about when to escalate is fixed, and the decision itself stays with an accountable person.
Why detection is not a substitute
The most common architecture in the market observes agent behaviour, scores it, and alerts. That model is borrowed from security monitoring, where it works, and it transfers badly here for a reason worth being precise about.
Security monitoring assumes a response window. An anomalous login can be investigated and the session terminated because compromise takes time to convert into damage. An agent action has no such window: the tool call completes in milliseconds and the effect is immediate and often irreversible. The payment settles. The record is deleted. The email leaves. By the time a score is computed and a human reads the alert, there is nothing left to decide.
So a log line saying an agent deleted a production database is evidence, not a control. It may be useful evidence. It is not the thing that was supposed to prevent the outcome, and an auditor asking who authorized that action will not accept it as one.
Common questions
How does pre-execution enforcement differ from an AI gateway blocking a call?
A gateway decides whether a request may be routed — which model answers, whether the key is valid, whether a rate limit has been hit. It sits before the model call, so at the moment it acts the agent has not yet decided anything and there is no action to evaluate. Pre-execution enforcement sits after the agent has reasoned, when the specific operation, parameters, and target are all known. The two are complementary and operate on different objects: a gateway can tell you a call was routed, and only an action-level check can tell you the operation at the end of it was permitted.
What happens to the agent while an action is held for approval?
The action is suspended rather than failed, and the agent's workflow waits on it. This is deliberate and it is the difference between real human-in-the-loop and a notification. If the call were allowed to proceed and the approval raised in parallel, the approver would be confirming something that already happened. If the call simply errored, the agent would typically retry or route around it. Holding the action keeps the workflow coherent: when the named approver allows it, execution resumes from where it paused, and when they deny it, the agent receives a definitive refusal it can reason about.
Does the check add latency to every agent action?
Not meaningfully for actions that clear, because the evaluation is a comparison against a scope computed at design time rather than an analysis performed at request time. Set against the model inference that produced the action in the first place, the check is not the expensive part of the loop. Escalated actions obviously introduce a wait for the human decision, but that is the intended behaviour rather than overhead — the alternative is an unreviewed action, which is the outcome the escalation exists to prevent.
Where does enforcement run — in the agent, the gateway, or somewhere else?
Outside the agent, which is the property that matters, and in practice in more than one place. LangGuard's Arbiter is distributed: it runs inside the AI infrastructure layer, at the gateway and MCP catalogue, and inside the agent harness itself. Multiple placements exist because agents reach tools by more than one path, and a check that only covers the gateway misses whatever bypasses it. What is never acceptable is enforcement implemented inside the agent's own reasoning, as a system-prompt instruction or a function the agent chooses to call, because that fails in exactly the case it exists for.
Can pre-execution enforcement work with agents you did not build?
Yes, and that is the usual case. Enforcement attaches at the points where an agent reaches your systems — the MCP servers, the tool catalogue, the gateway, the harness — rather than requiring changes to the agent's code or its framework. A third-party or vendor-supplied agent still has to make a tool call to affect anything you own, and that call is where the decision is made. This is also what keeps policy consistent across a heterogeneous estate: the same rule applies whether the agent runs on Bedrock, Anthropic, or something a team built in-house.
Watch an action get blocked before it executes.
LangGuard maps your complete agent action surface in minutes. Free for the first five managed agents, with every Scope included from day one.