By NHI Mgmt Group Editorial TeamBased on KeyRunner: “How Do You Stop Unsafe AI Agent Actions Before Execution?” (August 14, 2026)

TL;DR: Unsafe AI agent actions can be stopped before execution by intercepting every tool call and evaluating it against external policy before credentials or downstream APIs are used, according to KeyRunner. The control boundary must sit outside the model because prompt rules alone cannot guarantee which action the tool runner will execute.


At a glance

What this is: This is a practitioner explanation of pre-execution enforcement for AI agent tool calls, with the key finding that policy has to block or pause actions before secrets or APIs are reached.

Why it matters: It matters because identity and access decisions for agents cannot rely on prompts alone, and IAM teams need an external runtime boundary that governs action, credential release, and approval.


Context

AI agent tool security fails when the model is treated as the control plane. A prompt can influence intent, but it cannot reliably enforce execution because the tool runner may still call an API, request a secret, or continue after malicious context changes the agent’s behaviour.

The governance gap is between what the agent says it will do and what the runtime is allowed to execute. That is why the boundary has to sit outside the model and evaluate the request before credentials are released or downstream systems are touched. least privilege for AI agents is only meaningful when the runtime can deny the action, not just describe it.


Key questions

Q: What breaks when AI agent access decisions are handled in prompts?

A: Prompt-based access control is fragile because it places security logic inside the same system attackers are trying to influence. That makes policy easier to manipulate than an external authorization layer. When the model owns the decision path, organisations lose a clear boundary for audit, enforcement, and separation of duties.

Q: Why do AI agents need external policy enforcement before execution?

A: They need it because the security decision must happen at the point of action, not after the model has already decided. External enforcement can evaluate context, permissions, data scope, and impact, then block unsafe calls before they leave the environment. That is the only place where access can be stopped cleanly without exposing a secret or creating side effects.

Q: How do security teams know if coding agent monitoring is actually working?

A: Monitoring is working when it can correlate session behavior, file access, tool use, and network attempts into a single investigative trail. Useful signals include taint tracking after sensitive file access, anomaly detection after external content ingestion, and alerts on writes to restricted paths. If those patterns are visible, the program can distinguish intended work from manipulated behavior.

Q: How should organisations separate human and agent credential governance?

A: Use different ownership, issuance, and offboarding rules for people and agents. Human credentials map to employment or access roles, while agent credentials map to workload, workflow, or task boundaries. If both sit in the same inventory without distinction, revocation, review, and accountability become unreliable.


Technical breakdown

Why prompt instructions cannot be the security boundary

A prompt is advisory, not authoritative. The model can misinterpret instructions, be steered by injected context, or select an unexpected tool path, and none of those failures are prevented by text alone. In an agentic system, the real security decision happens when the runtime decides whether to execute a tool call, issue credentials, or forward the request to an API. If that decision remains inside the model loop, policy becomes a suggestion rather than a control. See the Agentic AI Security Guide.

Practical implication: Treat the prompt as input to policy evaluation, not as the policy engine itself.

How external policy interception works at the execution boundary

Pre-execution enforcement inserts a governed runtime between the agent and the tool. The runtime identifies the agent, user, session, environment, target, and policy version, then checks tool permission, parameters, data scope, time, rate, cost, and potential impact before allowing the call. This shifts control from post-hoc logging to decision-time enforcement. The same pattern applies whether the tool is an API, an internal workflow, or a credentialed downstream service. Read Zero Trust for AI Agents.

Practical implication: Route every agent tool request through a policy layer that can deny, pause, or approve before execution.

Why credential release must happen after allow

Credential retrieval is the irreversible step in many agent workflows. Once a secret, token, or delegated permission is exposed, the blast radius expands even if the tool call is later blocked. By delaying credential retrieval until after policy approval, the runtime prevents denied requests from ever reaching downstream systems with usable access. That separation matters because a blocked action should leave no secret, no API call, and no executed side effect behind. See the Agentic AI Identity Guide.

Practical implication: Bind secret retrieval to the allow decision so denied actions never receive usable credentials.


Threat narrative

Attacker objective: The objective is to trick the agent runtime into executing an unsafe action that policy should have blocked before credentials or APIs were used.

  1. Entry occurs when an AI agent receives a tool request that may be shaped by malicious context, prompt injection, or misinterpreted instructions.
  2. Escalation happens if the runtime lets the agent resolve credentials or reach downstream APIs before policy has approved the request.
  3. Impact follows when an unsafe tool call executes, creating unauthorized data access, unwanted changes, or a larger blast radius than intended.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Prompt governance is not execution governance. The article’s central point is that a prompt can shape behavior, but it cannot be the authority that decides whether a tool call is permitted. That distinction matters because agentic systems fail at the boundary between recommendation and execution, especially when malicious context or tool confusion is present. Practitioners should treat the model as an untrusted decision source and move enforcement to the runtime.

External policy enforcement is the real identity control for agents. The security decision has to occur before credentials are resolved and before downstream APIs are contacted. That makes the runtime policy layer the effective gate for AI agent identity, not the prompt, and it aligns with least privilege for AI agents only when denial happens ahead of execution. The practical implication is that access control for agents must be evaluated per action, not assumed from the prompt.

Credential release after allow is the key design break point. The article shows that denying a tool call is only meaningful if the agent never receives the credential needed to proceed. If secret retrieval happens earlier in the workflow, the denial arrives too late to contain risk. Practitioners should therefore separate policy evaluation from credential issuance and treat that separation as a core control, not an implementation detail.

Runtime blast-radius control is the named concept that should anchor this pattern. The article is describing a control model in which tool permissions, data scope, rate, cost, and approval thresholds are assessed before execution so unsafe actions never materialise. That is more than guardrails and more than logging. The implication is that agent governance must be designed around contained execution windows rather than trusted intent.

From our research library:

What this signals

Runtime blast-radius control: agent governance is moving from declarative guidance to enforced execution boundaries. The practical question for teams is no longer whether an agent can be told what to do, but whether the runtime can prevent it from doing the wrong thing before a secret or API call is involved.

Access review models do not fit agentic workflows well when the decision and the action occur inside a single runtime turn. The programme implication is that security teams should shift control points earlier, toward issuance-time enforcement, and align that change with the policy stack rather than the prompt layer.


For practitioners

  • Implement pre-execution policy interception Place a governed runtime between the agent and every tool call so approval or denial happens before any network request is sent.
  • Delay secret retrieval until after allow Bind credential issuance to the allow decision so a denied request never receives a token, key, or delegated permission.
  • Validate parameters and target context Check tool name, arguments, target system, data classification, and policy version before the request can proceed.
  • Set approval thresholds for high-impact actions Pause actions that cross defined blast-radius limits, such as bulk writes, privileged changes, or external data transfer.
  • Log blocked and allowed attempts Record the decision, policy reason, and session context for every agent tool call so blocked requests are auditable.

Key takeaways

  • Unsafe AI agent actions are only contained when policy enforcement happens outside the model and before execution.
  • The critical control point is credential release, because once a token or key is exposed the blast radius expands.
  • Agent security programmes need runtime enforcement, not just prompt guardrails, if they want deniable and auditable control.

Related NHI Mgmt Group resources: AI Agent Authorisation Guide · Zero Trust for AI Agents · AI Agent Observability, Audit and Incident Response Guide · Agentic AI Identity Guide


Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10, OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseThe article centres on preventing an agent from overstepping permitted identity and tool authority.
Recommendation — Enforce per-action authorisation so agent requests are denied before privilege can be abused.
OWASP Non-Human Identity Top 10NHI-04 — Insecure AuthenticationThe runtime must authenticate and authorise tool requests before credentials are released to the agent.
NHI-05 — Overprivileged NHIThe article warns that agent access must be scoped to the exact action rather than granted broadly.
Recommendation — Gate each agent action through authenticated policy checks before exposing any secret or token. Reduce agent permissions to the narrowest task scope and deny any out-of-policy tool call.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe core control problem is authorising agent actions by context, target, and policy before execution.
Recommendation — Apply access-authorisation checks at request time so only permitted agent actions can proceed.
MITRE ATT&CKTA0006 — Credential AccessCredential exposure before policy approval is the main risk the article is designed to prevent.
Recommendation — Map agent workflows to credential-access risk and stop requests before secrets are resolved.

Key terms

  • Pre-execution Control: A control that evaluates or blocks a transaction before it is signed, submitted, or otherwise made irreversible. For stablecoin programs, pre-execution control is central because fast settlement leaves little room for after-the-fact remediation once the transfer has occurred.
  • Runtime Policy Boundary: The external decision layer that sits between an agent and the tools it wants to use. It independently checks identity, context, scope, and impact, so the model cannot self-authorise an unsafe action or bypass approval by changing its prompt.
  • Credential Retrieval After Allow: A design rule in which tokens, keys, or delegated permissions are issued only after a policy decision approves the specific action. This prevents denied requests from ever obtaining usable access and reduces blast radius in agentic workflows.
  • Blast Radius Control: Blast radius control is the practice of limiting how far damage can spread when an identity, system, or workload is compromised. It uses segmentation, least privilege, isolation, and scoped credentials to contain impact. In identity security, it reduces lateral movement, privilege escalation, and data exposure after a breach or misuse.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an identity security programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on October 22, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org