TL;DR: The real attack surface in coding agents is the harness, not just the model, because prompts, tools, skills, MCP servers, and orchestration logic each create new trust relationships that attackers can manipulate, according to HiddenLayer. The practical consequence is that governance must shift to visibility, least privilege, validation, monitoring, and ownership across the full agent lifecycle.
At a glance
What this is: HiddenLayer’s analysis says coding agent risk is concentrated in the harness around the model, not just the model itself, because trust flows through prompts, tools, skills, MCP servers, and orchestration.
Why it matters: IAM and security teams need to govern how coding agents obtain, inherit, and use authority because those trust paths can turn a productive workflow into an attack surface.
Context
Coding agents are software systems that can read code, call tools, modify files, and execute tasks, which means they operate through a chain of delegated trust rather than a single isolated model. The security problem is not just prompt quality, but the governance of every trust boundary the agent crosses, including tools, skills, remote services, and runtime permissions.
For identity and access teams, the important shift is that the control point moves from model behaviour alone to the surrounding execution environment. Once harness components can inherit authority, change after approval, or hide instructions in metadata, traditional review models stop being sufficient and trust governance becomes the real issue.
Key questions
Q: What breaks when a coding agent harness is not governed as a trust boundary?
A: The agent starts inheriting authority from prompts, tools, skills, and servers that were only meant to support the task, not define it. That allows malicious or altered components to steer execution as if they were trusted instructions, which turns a productivity system into a governance gap.
Q: Why do trusted tool definitions and skill metadata create security risk in coding agents?
A: Because they can be loaded into the agent context before the user ever sees the underlying logic, which gives hidden instructions or changed parameters system-level influence. If teams do not revalidate those components after approval, they end up trusting content that may no longer match the original review.
Q: How can teams tell whether a coding agent is operating outside its intended boundary?
A: Watch for unexpected tool calls, abnormal file writes, unusual data movement, privilege escalation attempts, and elevated API or compute activity. Those signals show that the harness, not just the model, may be under influence. Effective monitoring should sit outside the model so it can independently confirm whether behavior matches policy.
Q: Who should own governance for production coding agents and their integrations?
A: The team that owns the production agent should also own its permissions, trusted integrations, and incident response path. Without named accountability, approvals and monitoring become fragmented, and no one is responsible when a trusted component changes after it has been granted access.
Technical breakdown
Why the agent harness becomes the attack surface
A coding agent is not just an LLM. It is a runtime system that combines prompts, tool definitions, skills, servers, policy, and orchestration logic into a single decision path. HiddenLayer’s analysis shows that attackers do not need to break the model directly if they can influence any component that the model treats as trusted input. That can happen through malformed tags, hidden instructions in metadata, changing server behaviour after approval, or payloads that propagate across repositories. The technical issue is trust inheritance: once a component is absorbed into the agent context, its instructions and permissions can behave as if they were authoritative.
Practical implication: Treat the harness as a governed control plane and inventory every component that can influence agent decisions.
How MCP, skills, and prompts create inherited authority
MCP and skill systems often blur the line between configuration and instruction. Tool descriptions may be embedded into the system prompt, which means a malicious or altered definition can carry more weight than the user expects. Skills can also hide logic or triggers in metadata before the visible executable code is reviewed. Remote MCP servers add another layer of risk because the service can change after permissions are already granted, turning a trusted integration into a drifting one. The core mechanism is not simply exposure, but authority reuse: once the agent has accepted the component, the component can steer behaviour with system-level influence.
Practical implication: Validate tool definitions, skill metadata, and remote integrations before trust is granted and again when they change.
Why runtime controls matter when the model cannot enforce policy
Coding agents are designed to act, not just recommend. That makes runtime oversight essential because the model itself cannot reliably enforce least privilege, data handling rules, or approval thresholds. HiddenLayer’s framework separates validation from monitoring for a reason: some risky behaviour is detectable before execution, but much of the operational damage only appears while the agent is reading files, moving data, or attempting privileged actions. Monitoring therefore has to watch behaviour outside the model, not just the prompt inside it. The architectural lesson is that security policy must sit alongside the agent, not inside the model’s instructions.
Practical implication: Place independent monitoring and approval gates around file operations, tool use, and privilege escalation attempts.
Threat narrative
Attacker objective: The attacker’s objective is to turn a coding agent’s delegated trust into unauthorized code changes, data movement, or destructive execution.
- Entry occurs when an attacker seeds malicious instructions through trusted harness components such as XML-tagged input, tool descriptions, or skill metadata.
- Credential or authority abuse follows when the agent accepts those components as trusted and inherits permissions that were intended for legitimate workflows.
- Impact occurs when the agent propagates payloads, modifies repositories, or executes high-impact actions under the guise of normal development work.
Breaches seen in the wild
- Amazon Q Developer extension compromise 2025: An over-scoped CI token let an attacker ship a prompt telling Amazon Q's AI coding agent to wipe files and AWS resources (CVE-2025-8217).
- PocketOS database deletion incident: An AI coding agent found an over-privileged Railway API token in the codebase and deleted PocketOS production data and backups in nine seconds.
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
The harness, not the model, is the governance unit that now matters. Coding agents make decisions through a stack of prompts, tools, skills, servers, and runtime rules, so the security boundary is distributed rather than singular. That changes how identity and access should be modeled because authority can be inherited through components the user never sees. Practitioners should govern the full trust chain, not only the model endpoint.
Hidden trust inheritance is the named failure mode this article exposes. A tool definition, skill metadata block, or remote MCP server can quietly acquire system-level influence once it is folded into the agent context. That is a governance assumption failure, not just a technical bug: teams assume reviewed components stay stable after approval. Practitioners need lifecycle controls for trusted agent components, including revalidation after change.
Least privilege is necessary but not sufficient for coding agents. The article shows that limiting permissions reduces blast radius, but it does not eliminate the need to decide what is trusted in the first place. That means visibility, validation, monitoring, and ownership have to operate together. The practitioner conclusion is clear: access governance must cover both authorization and trust establishment.
Coding agents create a new form of shadow AI risk inside development workflows. The article explicitly calls out deployed agents, tools, MCP servers, and skills that may not be fully visible to security teams. That intersects with NHI governance because these systems rely on credentials, delegated access, and environment-specific permissions to function. Practitioners should treat agent infrastructure as governed machine identity territory, not as a purely application-layer concern.
Agent governance now needs a named concept: harness trust drift. Once approval has been granted, the trusted component can change, expand, or embed new behaviour without the original review context following it. That makes the life cycle of tools and servers as important as the model invocation itself. Practitioners should build controls that detect when trusted agent components stop matching the state that was originally approved.
From our research library:
- 24,008 unique secrets were exposed in MCP configuration files in 2025 alone, the protocol's first year of widespread adoption, according to the State of Secrets Sprawl 2026.
- Read next: MCP Security Guide
What this signals
Harness trust drift: the real problem is not whether a coding agent can reason, but whether the components it trusts can change after approval. That makes component lifecycle governance, not model tuning, the control that most often determines whether an agent remains safe to run.
Development teams are now managing systems that can read repositories, invoke tools, and act on delegated authority, so security review has to move upstream into harness design and change control. For practitioners, that means tool inventory, trust revalidation, and runtime oversight need to be treated as part of the build platform rather than as an afterthought.
For practitioners
- Map every agent trust boundary Inventory deployed agents, tools, skills, MCP servers, orchestration layers, and the permissions each one can exercise across repositories and external systems.
- Revalidate trusted components on change Require review whenever tool definitions, skill metadata, remote server endpoints, or default configurations change, even if the agent itself has not changed.
- Constrain agent permissions to task scope Apply least privilege, narrow outbound connectivity, and approval gates for high-impact actions so a compromised harness component cannot immediately broaden its reach.
- Monitor behaviour outside the model Watch file operations, sensitive data movement, privilege escalation attempts, and abnormal tool usage because the model will not reliably enforce policy on its own.
- Assign ownership for production agents Place each production coding agent inside an AI governance process with explicit incident response, permission review, and accountable ownership for trusted integrations.
Key takeaways
- Coding agents expand the attack surface by turning prompts, tools, skills, and MCP servers into a governed trust chain rather than a single model risk.
- The most important failure mode is hidden trust inheritance, where a component can change after approval and still influence agent behaviour with system-level authority.
- Security teams need lifecycle controls, runtime monitoring, and explicit ownership so agent authority stays constrained to the task that was originally approved.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST AI RMF sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | Coding agents and their integrations can inherit excessive authority through trusted harness components. |
| NHI-10 — Human Use of NHI | Human operators can accidentally trust and deploy agent components without proper review and ownership. | |
| Recommendation — Apply NHI-05 to reduce inherited authority across agent tools, servers, and skills. Use NHI-10 to separate human review from automated agent execution and approval. | ||
| OWASP Agentic AI Top 10 | ASI03 — Identity & Privilege Abuse | The article centers on agents gaining or misusing authority through their harness. |
| Recommendation — Map agent harness controls to ASI03 and restrict privilege inheritance from trusted components. | ||
| NIST AI RMF | GOVERN — AI Governance and Accountability | The article emphasizes ownership, accountability, and governance across the agent lifecycle. |
| Recommendation — Establish GOVERN controls for ownership, review, and accountability across production agents. | ||
| MITRE ATT&CK | TA0006;TA0008 — Credential Access; Lateral Movement | The attack patterns involve abusing trusted components to reach broader system access. |
| Recommendation — Map agent abuse paths to TA0006 and TA0008 to improve detection of trust-driven movement. | ||
Key terms
- Agent Harness: The agent harness is the runtime layer that wraps a model and turns it into an acting system. It usually includes the loop, tools, context handling, permissions, hooks, and logs. In security terms, it is often the real place where privilege sits and where identity evidence must be governed.
- Trust Inheritance: The condition where one credential or integration is allowed to carry trust into multiple connected systems. It is often invisible until a token is replayed from outside the intended context. In practice, trust inheritance is what turns a valid login event into a cross-platform compromise.
- Shadow AI: AI agents, copilots, or connected tools operating without full visibility or governance from security teams. Shadow AI becomes an identity problem when those systems authenticate with unmanaged tokens, service accounts, or OAuth apps that can reach production resources.
- Runtime Monitoring: The practice of observing identity activity while it is happening, not after the fact. For agents and NHIs, it means tracking tool calls, credential use, and resource access in real time so deviations from approved scope can be detected before damage compounds.
Deepen your knowledge
NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps practitioners connect identity controls to the operational reality of delegated access and trusted integrations.
Published by the NHIMG editorial team on July 30, 2026.
Updated on October 13, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org