Skip to main content
Back to all articles
AI Engineering 10 min readUpdated October 4, 2026

Your Agent Is Authorized to Act. It Still Shouldn’t.

Authorization only says an action is permitted. Production agents also need an abstention gate that checks evidence sufficiency, contradictions, missing facts, and risk before they answer, act, or escalate.

By Salman Butt · Senior Full-Stack & Generative AI Engineer
#AI Agents#Abstention#Evidence Sufficiency#Human-in-the-Loop#Agent Safety#Guardrails#LangGraph#TypeScript#Python#Production AI
On this page

At 5:42 PM, an IT agent receives an offboarding task.

The HR system says an employee’s access should end today.

A manager note says the employee’s last working day is tomorrow.

The identity platform shows the account is still attached to an active incident rotation.

The agent has permission to call disable_user.

The arguments are valid. The tool exists. The policy engine says this agent is allowed to disable employee accounts.

Nothing is technically broken.

And the correct action is still: do not disable the account yet.

That is the production boundary I think agent systems need more often.

Authorization answers:

Is this caller allowed to perform this action?

An abstention gate answers a different question:

Do we have enough trustworthy, non-conflicting evidence to choose an answer or action at all?

I wrote previously about putting an authorization gate in front of agent side effects. I still want that gate.

But permission is only one requirement.

An agent can be authorized and still be unjustified.

Confidence is not evidence

A model can sound extremely certain while the underlying information is incomplete.

That is why I would not implement abstention as:

Text
model confidence > 0.80→ execute

Even when a system exposes useful uncertainty signals, one number cannot tell me whether the agent retrieved the authoritative source, whether two primary systems disagree, whether a required field is missing, or whether the proposed action is reversible.

For the offboarding example, I care about facts such as:

Text
Which employee identity are we changing?What is the effective offboarding time?Which system is authoritative for that time?Is there an active exception or hold?Do authoritative sources agree?How fresh is the evidence?Is the action reversible?

Those are application questions.

The LLM can help interpret evidence. It should not be allowed to manufacture the evidence standard it must satisfy.

That distinction matters because research on selective prediction and abstention keeps finding the same uncomfortable result: uncertainty signals can help, but a single confidence or entropy signal is not a complete safety boundary. A production gate needs to combine uncertainty with evidence quality and task-specific requirements.

Give the agent more exits than “do it” and “fail”

A lot of agent workflows have only two practical outcomes:

Text
successerror

That is too small for real decision-making.

I want at least these outcomes:

TypeScript
type GateDecision =  | { kind: "execute" }  | { kind: "ask"; missing: string[] }  | { kind: "abstain"; reason: string }  | {      kind: "escalate";      reason: string;      evidenceIds: string[];    }  | { kind: "deny"; reason: string };

They mean different things.

Ask

The system knows exactly what information is missing and there is a reasonable path to obtain it.

Text
I have the employee ID, but not the effective offboarding time.Please confirm the effective time.

Abstain

The system cannot responsibly make the requested determination from the evidence it currently has.

Text
I cannot determine the current offboarding date from the available records.

Escalate

The evidence is ambiguous or the consequence is high enough that a human or another trusted authority needs to resolve it.

Text
HRIS and the manager-approved record disagree about the effective date.Human review is required before account access changes.

Deny

The action is not permitted, regardless of how good the evidence is.

Text
This agent is not authorized to disable executive accounts.

Execute

The evidence is sufficient, required facts are present, contradictions are resolved, policy permits the action, the caller is authorized, and the risk policy allows automation.

Those states should not be compressed into one generic “refused” response.

A refusal, an abstention, an authorization denial, and a request for missing information represent different system conditions. If we keep them distinct, the workflow can recover correctly instead of treating every stop as a dead end.

Build an evidence packet before making the decision

The gate becomes much easier to reason about if the application creates a structured evidence packet instead of giving the model a pile of retrieved text and asking whether it feels confident.

For example:

TypeScript
type EvidenceAuthority =  | "primary"  | "secondary"  | "informal";​type EvidenceItem = {  id: string;  source: string;  authority: EvidenceAuthority;  observedAt: string;  claim: string;  subjectId: string;};​type RequiredFact = {  name: string;  value?: string;  evidenceIds: string[];};​type Contradiction = {  fact: string;  evidenceIds: string[];};​type EvidencePacket = {  subjectId: string;  requiredFacts: RequiredFact[];  evidence: EvidenceItem[];  contradictions: Contradiction[];};

Python has the same shape:

Python
from dataclasses import dataclassfrom typing import Literal​​Authority = Literal[    "primary",    "secondary",    "informal",]​​@dataclass(frozen=True)class EvidenceItem:    id: str    source: str    authority: Authority    observed_at: str    claim: str    subject_id: str​​@dataclass(frozen=True)class RequiredFact:    name: str    value: str | None    evidence_ids: tuple[str, ...]​​@dataclass(frozen=True)class Contradiction:    fact: str    evidence_ids: tuple[str, ...]​​@dataclass(frozen=True)class EvidencePacket:    subject_id: str    required_facts: tuple[RequiredFact, ...]    evidence: tuple[EvidenceItem, ...]    contradictions: tuple[Contradiction, ...]

The useful thing here is not the dataclass.

It is that the workflow can now inspect *why* an action is justified.

A decision can point to evidence IDs rather than to a hidden model impression.

Required facts should come from the action contract

For consequential tools, I like the tool or workflow definition to declare what must be known before execution.

Imagine the organization defines this illustrative offboarding contract:

TypeScript
type ActionRequirement = {  action: string;  requiredFacts: string[];  minimumAuthority: EvidenceAuthority;  maxEvidenceAgeMinutes?: number;  risk: "low" | "medium" | "high";};​const disableUserRequirement: ActionRequirement = {  action: "disable_user",  requiredFacts: [    "employee_id",    "employment_status",    "effective_at",  ],  minimumAuthority: "primary",  maxEvidenceAgeMinutes: 30,  risk: "high",};

Those values are product policy, not universal offboarding rules.

The point is structural: the model does not get to decide after seeing the evidence that effective_at was optional all along.

The application defines the evidence contract first.

Then the agent either satisfies it or it does not.

This is the same engineering habit we use elsewhere: schemas before parsing, permissions before side effects, invariants before writes.

The decision path I would ship

I want the runtime to make the stop conditions visible:

Abstention gate decision flow

I do not care whether these checks live in one service or several.

I care that they are different questions with observable answers.

In shorthand:

Text
may_execute =  evidence_sufficient  AND contradictions_resolved  AND policy_permits  AND caller_authorized  AND risk_gate_passed

A large model is not one of those booleans.

Make the evidence gate deterministic where you can

A surprisingly useful first version does not need another LLM call.

TypeScript
type Risk = "low" | "medium" | "high";​type GateInput = {  packet: EvidencePacket;  risk: Risk;  policyPermits: boolean;  callerAuthorized: boolean;  canRecoverMissing: boolean;  hasAuthoritativeEvidence: boolean;};​function decide(input: GateInput): GateDecision {  const missing = input.packet.requiredFacts    .filter((fact) => !fact.value)    .map((fact) => fact.name);​  if (missing.length > 0) {    if (input.canRecoverMissing) {      return { kind: "ask", missing };    }​    return {      kind: "abstain",      reason: `Missing required facts: ${missing.join(", ")}`,    };  }​  if (!input.hasAuthoritativeEvidence) {    return {      kind: "abstain",      reason: "Required facts are not backed by an authoritative source",    };  }​  if (input.packet.contradictions.length > 0) {    return {      kind: "escalate",      reason: "Authoritative evidence contains unresolved contradictions",      evidenceIds: input.packet.contradictions.flatMap(        (item) => item.evidenceIds,      ),    };  }​  if (!input.policyPermits) {    return {      kind: "deny",      reason: "Policy does not permit this action",    };  }​  if (!input.callerAuthorized) {    return {      kind: "deny",      reason: "Caller is not authorized for this action",    };  }​  if (input.risk === "high") {    return {      kind: "escalate",      reason: "High-risk action requires human review",      evidenceIds: input.packet.evidence.map((item) => item.id),    };  }​  return { kind: "execute" };}

And the same boundary in Python:

Python
from dataclasses import dataclassfrom typing import Literal​​DecisionKind = Literal[    "execute",    "ask",    "abstain",    "escalate",    "deny",]​​@dataclass(frozen=True)class GateDecision:    kind: DecisionKind    reason: str | None = None    missing: tuple[str, ...] = ()    evidence_ids: tuple[str, ...] = ()​​def decide(    packet: EvidencePacket,    *,    risk: Literal["low", "medium", "high"],    policy_permits: bool,    caller_authorized: bool,    can_recover_missing: bool,    has_authoritative_evidence: bool,) -> GateDecision:    missing = tuple(        fact.name        for fact in packet.required_facts        if fact.value is None    )​    if missing:        if can_recover_missing:            return GateDecision(                kind="ask",                missing=missing,            )​        return GateDecision(            kind="abstain",            reason="Required facts are missing",            missing=missing,        )​    if not has_authoritative_evidence:        return GateDecision(            kind="abstain",            reason=(                "Required facts are not backed "                "by an authoritative source"            ),        )​    if packet.contradictions:        evidence_ids = tuple(            evidence_id            for conflict in packet.contradictions            for evidence_id in conflict.evidence_ids        )​        return GateDecision(            kind="escalate",            reason=(                "Authoritative evidence contains "                "unresolved contradictions"            ),            evidence_ids=evidence_ids,        )​    if not policy_permits:        return GateDecision(            kind="deny",            reason="Policy does not permit this action",        )​    if not caller_authorized:        return GateDecision(            kind="deny",            reason="Caller is not authorized",        )​    if risk == "high":        return GateDecision(            kind="escalate",            reason="High-risk action requires human review",            evidence_ids=tuple(                item.id for item in packet.evidence            ),        )​    return GateDecision(kind="execute")

This is intentionally conservative and incomplete.

A real product may distinguish source types, freshness windows, reversible actions, legal holds, tenant policy, or business-specific exceptions.

But I like this version because a reviewer can read it and explain why the agent stopped.

No one has to reverse-engineer a confidence score after the incident.

Contradiction should usually beat confidence

Suppose the HR system says:

Text
effective_at = 2026-09-23 18:00

and another authoritative workflow record says:

Text
effective_at = 2026-09-24 18:00

The agent may have a plausible reason to prefer one.

That does not mean it should silently pick one for an irreversible or high-impact action.

I would rather produce:

JSON
{  "kind": "escalate",  "reason": "Conflicting effective dates",  "evidenceIds": ["hris:8821", "offboarding:1944"]}

Now the human reviewer receives the actual conflict instead of a vague message saying “the AI is uncertain.”

That is a much better escalation packet.

Humans are good at resolving specific discrepancies.

They are much less effective when the agent sends them its entire transcript and asks them to figure out what went wrong.

“Three retrieved chunks” is not an evidence standard

RAG systems create a subtle version of this problem.

Imagine the agent retrieves three documents that all say the employee leaves today.

That sounds like strong agreement until you notice all three were generated from the same stale wiki page.

Counting chunks is not the same as counting independent evidence.

I care about provenance:

Text
HRIS record       → primary sourcemanager approval  → primary workflow sourcewiki page         → secondary sourceSlack message     → informal source

Three copies of the wiki do not outvote the HRIS record.

Likewise, semantic similarity is not authority.

The closest embedding match may be an old procedure, a cached copy, or a user comment.

This is one reason I keep source identity, version, and freshness attached to retrieved evidence instead of flattening everything into anonymous text before the model sees it.

Abstention should depend on consequence

I do not want the same evidence threshold for every task.

Compare these requests:

Text
What time does the office usually close?

and:

Text
Disable this employee's account now.

The first answer can tolerate some uncertainty. The agent might say:

Text
The current office guide says 6 PM, but I could not verify today's exception schedule.

The second action should have a much stricter evidence contract.

That is why I tie evidence requirements to risk.

A useful policy shape is:

Text
low risk→ answer with qualified uncertainty when evidence is reasonable​medium risk→ require authoritative evidence and no unresolved contradictions​high risk→ authoritative evidence + complete required facts + explicit authorization + human review or stronger automation policy

The exact tiers are product-specific.

What matters is that the consequence of a wrong action affects the threshold for automation.

“Be confident” is not a risk policy.

Ask for missing information only when the question has an answer

Agents can also overuse clarification.

If a required effective_at value is missing and the manager can provide it, asking is productive.

If five sources fundamentally disagree about whether the account belongs to the right employee, another conversational question may not fix the underlying data problem.

That should escalate.

I use a simple distinction:

Text
missing + recoverable→ ask​missing + not recoverable from current actor→ abstain or escalate​conflicting + low consequence→ qualify / ask​conflicting + high consequence→ escalate

This stops the agent from turning every unsafe decision into an endless interview with the user.

Sometimes the user is not the authority who can resolve the conflict.

Put human review at a resumable boundary

When a workflow needs a person, I do not want to restart the entire agent from the beginning after approval.

LangGraph interrupts are useful for this pattern because the graph can persist its state, pause, and later resume with external input using the same thread.

A review node can be small:

TypeScript
import { interrupt } from "@langchain/langgraph";​function reviewAction(state: AgentState) {  if (state.gate.kind !== "escalate") {    return {};  }​  const review = interrupt({    type: "evidence_review",    action: state.proposedAction,    reason: state.gate.reason,    evidenceIds: state.gate.evidenceIds,  });​  return {    humanReview: review,  };}

Then the execution node checks the reviewed result and revalidates anything that may have changed before performing the side effect.

One LangGraph detail matters here: when an interrupted node resumes, its code runs again from the beginning of that node.

So I keep consequential side effects after the interrupt, or make pre-interrupt operations idempotent.

The human approval is not permission to execute some vaguely similar future action either.

Bind it to the exact proposal the reviewer saw:

Text
actionsubjectargumentsevidence versionpolicy versionapproval ID

If the action changes, evaluate again.

A reviewer should see evidence, not the agent's confidence monologue

For human escalation, I want a compact packet such as:

Text
Proposed action:Disable employee account emp_4821 at 18:00 UTC​Why automation stopped:Conflicting effective dates​Primary evidence:HRIS record hris_8821 → Sep 23 18:00Offboarding record off_1944 → Sep 24 18:00​Current policy:High-impact identity changes require resolved effective date​Options:[Approve Sep 23] [Approve Sep 24] [Cancel] [Investigate]

That is actionable.

This is not:

Text
The AI is 62% confident and would like a human to review.

A reviewer needs the disagreement and the consequence, not a synthetic feeling of certainty.

The no-action path needs first-class evals

Agent eval sets often reward completing the requested task.

That creates a blind spot.

If every test says:

Text
user asks for Xcorrect result = X completed

then the suite never teaches us whether the system can recognize when not completing X is the correct result.

I would deliberately include cases like these:

CaseExpected behavior
Required effective timestamp missingAsk
Only an informal Slack message supports terminationAbstain
Two authoritative records disagreeEscalate
Evidence complete but caller lacks permissionDeny
Evidence complete, authorized, medium-risk actionExecute
High-risk action with complete evidenceEscalate or execute only under explicit high-risk policy
Stale evidence beyond allowed freshnessRe-fetch, then abstain/escalate if freshness cannot be restored

The critical assertion is not just whether the final answer sounds reasonable.

It is whether the system chose the correct control state.

That makes abstention testable.

Measure coverage and error together

An agent that refuses everything has a fantastic unsafe-action rate.

It is also useless.

That means I do not optimize for “more abstention.”

I want the right abstentions.

The core metrics I would track are:

Text
automation coverageunsafe execution rateunsupported answer ratefalse-abstention rateclarification resolution ratehuman escalation rateescalation acceptance/override ratestale-evidence ratecontradiction rate

The tradeoff I care about is risk versus coverage.

As the gate becomes stricter, fewer cases are automated. The error rate among automated cases should fall.

That produces a curve rather than one magic threshold.

For a low-risk FAQ, I may accept higher coverage.

For disabling identities, issuing refunds, changing infrastructure, or making other consequential updates, I will usually accept lower coverage in exchange for a much lower unsafe-action rate.

This is also why I would segment the metrics by risk tier.

A global 3% escalation rate tells me almost nothing if the agent escalates 0% of the dangerous cases and 20% of the easy ones.

False abstention deserves attention too

Safety controls can fail in the conservative direction.

Suppose the evidence is complete, fresh, authoritative, and consistent, but the gate still escalates 40% of normal cases.

Users will route around the system.

Operators will learn to approve everything without reading.

The human-review queue will become the bottleneck the agent was supposed to remove.

That is why I keep a regression set for false abstentions:

Text
clear answerable questionswell-supported low-risk actionsrepeated routine casescases with harmless wording variationcases where several sources agree

A production abstention gate should reduce unjustified actions without converting ordinary automation into paperwork.

Re-check evidence after a long approval pause

Suppose the human approves the offboarding at 6:15 PM.

The approval request was created at 5:42 PM.

During those 33 minutes, the employee’s status could have changed.

So I do not treat human approval as a frozen snapshot of reality.

Before execution, the runtime should revalidate volatile facts:

Text
Is this still the same employee?Is the effective time still current?Has an exception been added?Has the action already happened?Is the authorization still valid?

Then use idempotency at the side-effect boundary.

Abstention protects the decision before execution.

Revalidation and idempotency protect the gap between decision and execution.

These layers solve different failures.

Do not let the model turn an abstention into a workaround

There is another implementation detail I care about.

If the gate returns:

JSON
{  "kind": "abstain",  "reason": "No authoritative evidence for effective date"}

then the next model turn should not be allowed to say:

Text
I'll use a different tool that bypasses the requirement.

The gate needs to live at the trusted execution layer, not as advice inside the prompt.

If two tools can produce the same side effect, both need the same evidence and authorization policy.

Otherwise an agent can accidentally route around the control simply because another tool description looked easier.

This is the same reason authorization belongs at the executor boundary.

Prompt instructions are useful.

Controls belong in code.

The architecture I want

For consequential agent actions, the model is one participant in a larger decision system:

Text
user / event    ↓agent proposes answer or action    ↓evidence collector    ↓evidence sufficiency + contradiction gate    ↓policy + authorization    ↓risk gate    ├── ask    ├── abstain    ├── escalate → human review → revalidate    ├── deny    └── execute            ↓      idempotent side effect            ↓          audit

This is more infrastructure than letting the model call a tool directly.

It also gives every important stop a reason you can inspect later.

That is the difference I care about in production.

The rule I would keep

An agent should not act because it produced a confident-looking plan.

It should act because the application can establish a chain of justification:

Text
we know what action is being proposedwe know which facts that action requireswe have those facts from acceptable sourcesthose sources are fresh enoughimportant evidence does not conflictpolicy permits the actionthis caller is authorizedrisk policy permits automation

Only then does execution become the next state.

If a required fact is missing, ask.

If the evidence cannot support the conclusion, abstain.

If trusted sources disagree or the consequence is too high, escalate.

If policy or authorization fails, deny.

And if everything passes, execute through the same controlled side-effect boundary you would use without an LLM.

Confidence is not evidence, and evidence is not authorization.

A production agent needs all three ideas kept separate.

That is how “I don’t know enough to do this safely” becomes a feature of the system instead of an accidental sentence the model sometimes remembers to say.

References

KEEP READING

Related engineering notes