Independent analysis by NHI Mgmt GroupSource article: Adversa AI, “B u i l d v s b u y f o r A I c o d i n g a g e n t s e c u r i t y O w n t h e p l u m b i n g , b u y t h e c o h e r e n t p i c t u r e” (November 22, 2026)

TL;DR: AI coding agent security failures keep landing in harnesses, settings and nearby credentials rather than in model traffic, according to Adversa AI, so a proxy alone misses the destructive paths that matter most. The decisive control is the environment around the agent, not the conversation it sends to a model.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on Adversa AI's blog post: AI coding agent security still fails at the harness, settings and credential layer, not just at model traffic control.

Why it matters: IAM, PAM and security teams need to treat coding agents as runtime systems with delegated access, because the dangerous failure modes sit in the credentials, configuration and execution environment around them.


Context

AI coding agents are not governed only by where prompts and model calls flow. They also inherit the permissions, filesystem access and configuration state of the workstation or CI environment they run inside, which means the real security boundary is the surrounding runtime, not the proxy in front of the model.

That matters because many teams still assume a gateway can see enough to control agent behaviour. In practice, the most damaging failures come from approval bypass, over-broad credentials, agent hooks, and project settings that alter execution before any model request is visible. In a mixed estate, security has to treat the agent, the host and the routing layer as one control surface, not separate problems.


Key questions

Q: How do I secure AI coding agents against destructive commands?

A: Secure AI coding agents by enforcing command approval outside the prompt, shrinking credential scope, and locking down configuration files that can change behaviour before a model call. The key control is runtime containment on the host and in managed settings, because a traffic gateway cannot stop a command that already executes locally.

Q: Why do AI coding agents need host controls beyond a gateway?

A: AI coding agents need host controls because a gateway only governs model traffic, not what the agent does on the workstation or server. Host controls constrain local files and shell execution, limit process spawning, and separate the agent’s runtime account from human credentials, so an unsafe prompt cannot freely read, write, or execute beyond its intended scope.

Q: How does an agent configuration hook create security risk?

A: An agent configuration hook creates security risk when it runs automatically at session starts and can alter the agent’s tools, prompts, credentials, or execution scope before oversight begins. If the hook is tampered with, it can silently redirect behaviour, widen access, or inject malicious instructions into every later action.

Q: What is the difference between a model gateway and agent security controls?

A: A model gateway controls access to the model, policy enforcement, and traffic inspection, while agent security controls govern the agent’s runtime behaviour, tool use, file access, and command execution. Gateway controls sit in the request path, but runtime control contains the agent after the model responds, which is where the real authority to act exists.


Technical breakdown

Why model traffic gateways miss coding agent damage

A model gateway only mediates requests and responses between the client and the model. It can log prompts, enforce routing and sometimes inspect tool calls, but it cannot observe local file edits, shell commands, config file hooks or what a command does once it runs on the machine. That is why destructive agent events can happen while the gateway still looks normal. The architectural mistake is assuming conversation control equals execution control. See the Agentic AI Security Guide.

Practical implication: Monitor the agent host and the gateway together, because the harmful step often happens outside the traffic plane.

Why agent configuration files are a security boundary

Agent configuration is executable policy in practice. Settings files, task files and repository-scoped rules can define hooks, route requests, alter trust prompts and set provider endpoints before a model call is made. If attackers can write those files, they can persist control across sessions and bypass policy that exists only in the prompt or in a remote proxy. This makes configuration integrity part of the attack surface, not a convenience feature. See the AI Coding Agents Security Guide.

Practical implication: Protect agent config paths with file integrity controls and administrative restrictions, especially on developer workstations.

How delegated credentials expand the blast radius

When an agent operates with a token, API key or cloud credential that can reach production systems, the agent inherits the full consequences of that privilege. If the credential is long-lived, over-scoped or reachable from unrelated files, the attack path becomes straightforward: find the secret, use it, and execute a destructive action faster than a human can intervene. The problem is not merely credential theft. It is delegated authority without containment.

Practical implication: Scope agent credentials to the smallest possible task and keep production access out of developer workspaces.


Threat narrative

Attacker objective: The attacker wants to turn an AI coding agent's delegated access into fast, low-friction control over code, credentials or production systems.

  1. Entry occurred when attackers or malicious packages influenced agent settings, hooks or project files that a coding agent would load automatically.
  2. Credential_harvested followed when those hooks or files exposed API keys, cloud credentials or provider endpoints within the agent's reachable environment.
  3. Escalation happened when the agent used broad permissions, unreviewed commands or trust overrides to reach production resources or external exfiltration paths.
  4. Impact was destructive execution, backup loss, secret theft or unauthorized release activity that the gateway alone could not prevent.
  • Langflow Flodrix botnet 2025: Attackers used Langflow's unauthenticated code endpoint to dump AI servers' environment variables and enlist them in the Flodrix botnet.
  • Hugging Face API tokens exposed 2023: Lasso Security found 1,681 live Hugging Face tokens in public code, 655 with write access, reaching 723 organisations including Meta; all were revoked.

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

AI coding agent security is a runtime governance problem, not a traffic-filtering problem. The evidence in Adversa AI's analysis shows that the failures with the highest impact happen where the agent executes, not where the model speaks. That shifts the control question from prompt moderation to execution containment, credential scope and host integrity. Practitioners should stop treating the gateway as the primary security boundary and start treating it as only one telemetry source.

Agent configuration integrity is the new policy perimeter. Hooks, task files and managed settings can execute before the model is even consulted, which means the configuration layer can either enforce policy or silently defeat it. This is a direct identity and access issue because those settings decide which credentials, models and tools the agent can reach. Security teams need managed configuration for AI coding agent controls and a clear rule that user-writable policy is not policy.

Delegated authority creates a standing privilege problem for AI agents. A coding agent with production credentials is not just a productivity tool, it is a privileged runtime with a rapid action loop. The article's incidents show that approval prompts and gateways fail when the credential itself can perform the damage. That is why the governance model has to move toward task-scoped access, short-lived credentials and explicit containment of agent reach.

Build vs buy should be decided by who can maintain detection, not who can route traffic. Adversa AI's argument is strongest where it separates cheap routing from expensive security coverage. Most organisations can own their routing preferences and vendor settings, but very few can keep threat research, detection engineering and cross-vendor correlation current on their own. The practical conclusion is to buy the detection plane and keep ownership of the local controls that only the enterprise can enforce.

AI coding agent damage now defines a distinct class of exposure: agent execution drift. That term captures the gap between what a policy says an agent should do and what the runtime can still make it do. Once drift exists, the organisation needs controls that observe the host, the config and the record of actions across all vendors and models. The practitioner priority is to detect drift early, before it becomes irreversible system change.

From our research library:

What this signals

Agent execution drift: the risk is no longer just that an agent makes a bad call, but that it can still act after policy has supposedly constrained it. Enterprises should prepare for controls that verify runtime state on the host, not just routing decisions in the model layer, because that is where destructive actions now emerge.

Endpoint telemetry will matter more as coding agents spread across multiple vendors and models. A single proxy cannot reconstruct the full chain from prompt to command, so the programme that survives will correlate managed settings, host events and audit logs into one actionable record.


For practitioners

  • Restrict agent approval paths to enforced controls Disable auto or bypass modes where possible and make destructive commands fail closed unless a separate control authorises them.
  • Lock down agent configuration files Protect settings, task files and hooks with managed settings, file permissions and code review so users cannot silently alter agent policy.
  • Remove production credentials from agent workspaces Replace broad tokens with short-lived scoped credentials and keep backups and cloud secrets outside paths the agent can reach.
  • Correlate endpoint and gateway telemetry Treat the model gateway, endpoint tooling and SIEM as a single detection chain so you can reconstruct actions that never appear in model traffic alone.

Key takeaways

  • AI coding agents create a security problem that lives in execution context, not just in model routing.
  • The strongest failures combine broad credentials, ungoverned hooks and commands that cannot be rolled back.
  • Security teams need host-level containment, managed configuration and cross-layer telemetry to govern these systems effectively.

Related NHI Mgmt Group resources: Claude Code Security Guide · Agentic AI Security Guide · AI Coding Agents Security Guide · Langflow Flodrix botnet 2025


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 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI03 — Identity & Privilege AbuseCoding agents in this piece fail when delegated access and privilege boundaries are too broad.
ASI05 — Unexpected Code ExecutionThe destructive cases in Adversa AI's analysis hinge on agents turning instructions into local execution.
ASI10 — Rogue AgentsThe article covers agents acting outside intended policy through hooks, settings and hidden paths.
Recommendation — Constrain agent privilege boundaries and require enforced approval before high-risk actions can execute. Sandbox agent execution and block unapproved command paths that can modify production systems. Detect and isolate agent behaviour that deviates from approved policy or runtime scope.
NIST AI RMFMANAGE — AI Risk ManagementThe build-vs-buy decision here is fundamentally about ongoing AI risk controls and operational ownership.
Recommendation — Assign clear ownership for AI agent risk controls, monitoring and incident response across the lifecycle.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsProduction credentials and agent reach are central to the incidents Adversa AI discusses.
Recommendation — Review agent entitlements and remove production access that exceeds task scope.
MITRE ATT&CKTA0006;TA0011 — Credential Access; Command and ControlThe cases include secret harvesting and routing through attacker-controlled endpoints.
Recommendation — Map agent attack paths to credential access and command channels, then hunt for those behaviours in telemetry.

Key terms

  • AI Coding Agent: An AI coding agent is software that writes, edits, reviews, or tests code with limited human prompting. It operates as an agentic system that can plan actions, call tools, and modify development artifacts, so its identity, permissions, and audit trail must be governed like any other privileged software actor.
  • Managed Settings: A persistent configuration layer that defines what an AI coding tool may do, what it must ask about, and what it cannot touch. For identity teams, this becomes the policy boundary that governs command execution, tool use, and exposure to sensitive paths.
  • Agent Hook: A hook is a deterministic command that runs at a fixed point in an AI agent's workflow, such as before a tool call or after an edit. It is used to allow, deny, annotate, or verify actions regardless of what the model intended to do.
  • Model Gateway: A central routing and control point for model access, API keys, logging, and usage policy. For security teams, it reduces credential sprawl and creates a practical place to enforce audit, segmentation, and offboarding for AI systems that call external models.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, workload identity and secrets management. It helps practitioners connect identity controls to the runtime systems that now carry delegated access.
NHIMG Editorial Note
Published by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org