Independent analysis by NHI Mgmt GroupSource article: Ent.ai, “Coding Harnesses: The Attack Surface Hiding in Plain Sight” (November 10, 2026)

TL;DR: AI coding harnesses can turn ordinary repository content into code execution, file changes, and credential exposure because they act on instructions, tools, and OS commands with limited human oversight, according to Ent.ai research. The trust boundary has shifted from the prompt to the harness runtime, where semantic intent now matters as much as IOCs.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on Ent.ai's blog post: AI coding harnesses can execute commands, modify files, and expose credentials when repository content influences agent decisions.

Why it matters: Security and identity teams need to treat coding harnesses as execution environments with delegated access, because trust decisions, permissions, and telemetry all shape blast radius.


Context

AI coding harnesses are execution environments, not passive chat interfaces. They can read files, call tools, run commands, and delegate work to subagents, which means repository content can influence actions long after a developer has clicked trust once.

The governance problem is that the control point has moved from the user prompt to the runtime. If the harness can act on untrusted content with broad permissions, then identity, policy, and telemetry all need to cover the agent's behaviour, not just the developer's intent.

This is where AI coding agents security becomes a distinct governance problem: the question is no longer only what the agent can read, but what it is allowed to do after reading it.


Key questions

Q: How do AI coding harnesses turn repository files into execution risk?

A: AI coding harnesses can parse repository-supplied instructions, choose tools, and run commands with the permissions of the active developer session. That means a file that looks informational can become operational context, allowing poisoned instructions to drive code execution, file changes, or secret exposure without a classic software exploit.

Q: What should security teams log for agent-driven command execution?

A: Log the command, the agent identity, the triggering prompt or event, the tool call, parameters, execution result, and the content the agent consumed. Include timestamps, target host or API, human owner, and any privilege elevation or secret use so investigators can reconstruct intent and scope.

Q: How should organisations scope permissions for coding assistants?

A: Scope permissions to the minimum file, shell, network, and integration access needed for the task, then separate read, write, and execute rights. Use per-repo or per-project service accounts, deny-by-default policies, and short-lived credentials, so coding assistants cannot browse unrelated data or chain into wider systems.

Q: What is the difference between sandboxing and trust prompts in agent tools?

A: Sandboxing constrains what the agent tool can actually do, such as limiting filesystem access, processes, network calls, and writable paths. Trust prompts only ask the model to behave cautiously, so they guide output but do not enforce isolation. Use the sandbox for control, and the prompt for instruction.


Technical breakdown

How repository content becomes execution

A coding harness can ingest text from files such as AGENTS.md or CLAUDE.md and then use that content to guide tool calls, shell execution, and file operations. That is different from a normal editor workflow because the instruction source is untrusted, yet the runtime may treat it as operational context. When the harness delegates tasks to subagents or invokes the model directly, the resulting action chain can be longer than the user realises, which makes attribution and review harder. See the AI IDE and Coding Agent Security Guide.

Practical implication: Treat repository-supplied instructions as untrusted input that can alter runtime behaviour, not as safe operational guidance.

Why traditional indicators miss agent-driven compromise

Hashes, domains, and suspicious command lines still matter, but they only describe the visible artefact after the agent has acted. The harder question is why the agent chose that action in the first place. In harness-driven environments, defenders need to correlate the user's intent, the content the agent consumed, the decision it made, and the command it executed. Without that chain, alerts tell you that something ran, but not why the harness allowed it to run.

Practical implication: Build detections that preserve instruction provenance and decision context, not just endpoint telemetry.

Why trust prompts are not a security boundary

A trust prompt can reduce friction, but it does not convert untrusted content into trusted content. Once a repository has been accepted, the harness may continue to follow project-specific configuration, hooks, permissions, and integration settings that persist across sessions. That means the real boundary is the policy and isolation model around the harness, not the one-time consent dialog. The risk grows when multiple agents, multiple surfaces, and remote integrations can all act under the same developer identity.

Practical implication: Enforce sandboxing, policy controls, and least privilege at the harness level, not at the prompt level.


Threat narrative

Attacker objective: The attacker wants the harness to execute trusted-looking instructions in a way that turns developer access into host compromise or secret exposure.

  1. Entry occurs when a developer opens a malicious or poisoned repository inside a coding harness and the harness reads attacker-controlled instructions from files such as context or skill documents.
  2. Credential access or code execution follows when the harness uses its legitimate permissions to run commands, invoke tools, or fetch external content on behalf of the agent.
  3. Impact lands when the resulting actions expose credentials, modify files, or compromise the host without a traditional exploit or obvious malicious command from the user.
  • Sentry MCP Agentjacking 2026: Researchers showed a fake Sentry error, posted with a public DSN, could make AI coding agents run attacker code with developers' credentials.
  • Nx s1ngularity attack 2025: Attackers stole Nx's npm token via a GitHub Actions flaw and shipped malware that stole 2,349 secrets and abused developers' AI CLIs.

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 harnesses collapse the old trust boundary between content and execution. A repository file is no longer just documentation when the runtime is allowed to parse it, branch on it, and act on it with the developer's permissions. That changes the governance model from prompt review to execution control, because the instruction source and the execution surface have merged. Practitioners should treat the harness as a privileged runtime with an identity of its own, not as a smarter terminal.

Semantic intent is becoming a security signal. Traditional detections can tell you that a script ran, but they cannot explain whether the agent was manipulated into running it or simply completing a legitimate task. The important control gap is not a missing IOC, but the lack of a durable trail from what the agent read to what it decided to do. That gap makes incident review harder and weakens accountability across developer, platform, and security teams.

Trust once, attack forever is a governance failure, not a user mistake. A one-time approval can persist across sessions while the harness continues to consume new content and spawn new actions under the same access context. That pattern resembles AI coding tools becoming embedded operating environments rather than disposable assistants. The implication is that lifecycle governance, policy enforcement, and logging need to move to the harness level, where authority is actually exercised.

Least privilege is only useful when the runtime can be constrained in practice. If a harness can reach repos, ticketing systems, internal knowledge bases, shells, and remote machine controls under one identity, then access scope is broader than most developers realise. That creates identity blast radius even when no vulnerability is exploited, because legitimate features become the abuse path. Practitioners should re-evaluate which permissions are truly necessary for each harness surface and whether those grants are separable.

Instruction poisoning is now a supply chain pattern for code execution. Poisoned context files, malicious skills, and extensibility mechanisms can all influence the harness without changing the underlying software binary. That means the control problem sits at the intersection of content trust, policy enforcement, and telemetry. The right posture is to govern the full instruction-to-action chain, because the exploit is often the interaction between legitimate features rather than a single defect.

From our research library:

What this signals

Instruction provenance will become a core control surface for AI coding environments. When a harness can act on text from files, skills, and integrations, the question is no longer whether the code is trusted but whether the instruction path is attributable and bounded. Programmes that cannot reconstruct that chain will struggle to explain agent behaviour after the fact.

Endpoints are now part of the governance perimeter for coding harnesses. Once a harness can read repositories, invoke shells, and reach remote systems, host telemetry and policy enforcement have to work together or the agent becomes an easy pivot point for secret exposure and file manipulation.


For practitioners

  • Inventory harness surfaces and permissions Map which coding harnesses are in use, what data sources they can read, and what OS, file, and network actions each one can perform under current policy.
  • Separate untrusted content from execution rights Restrict repository-supplied instructions, hooks, and extensions from inheriting the same authority as the developer session that opens them.
  • Log the instruction-to-action chain Capture what the agent consumed, what it decided, what tools it invoked, and what command or file operation followed so investigations can reconstruct intent.
  • Review enterprise policy enforcement, not just policy text Verify which controls are actually enforced across harnesses, including sandboxing, approvals, remote control, and subagent visibility.
  • Limit reach into sensitive systems Reduce access to source code, credentials, ticketing systems, and internal knowledge bases unless the harness truly needs them for the task.

Key takeaways

  • AI coding harnesses create risk because they can treat repository content as executable context, not just reference material.
  • The most important evidence is the chain from what the agent read to what it decided and executed, because endpoint telemetry alone is not enough.
  • Organisations need to govern harness permissions, sandboxing, and logging at the runtime layer if they want trustworthy agent behaviour.

Related NHI Mgmt Group resources: AI Coding Agents Security Guide · AI IDE and Coding Agent Security Guide · AI Coding Tools Hub · Sentry MCP Agentjacking 2026


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 CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04 — Insecure AuthenticationThe harness accepts and acts on content under a developer trust decision, which is a runtime authentication and trust problem.
NHI-05 — Overprivileged NHIThe article centres on harnesses acting with broad permissions across files, shells, repos, and remote systems.
NHI-10 — Human Use of NHIDevelopers are using coding harnesses as delegated non-human actors with human credentials and oversight gaps.
Recommendation — Constrain harness trust decisions so untrusted content cannot inherit the developer's operational authority. Reduce harness permissions to the minimum set of tools and resources required for each workflow. Separate human intent from machine execution by logging and governing every action the harness takes.
OWASP Agentic AI Top 10ASI02 — Tool MisuseThe threat pattern is agentic tool misuse driven by poisoned instructions and permissive runtime behaviour.
Recommendation — Restrict agent tool paths so hostile instructions cannot trigger unintended shell, file, or network actions.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsHarnesses are being granted broad entitlements that shape how far malicious instructions can reach.
Recommendation — Review and tighten entitlements for harnesses that can read code, run commands, or access remote systems.
MITRE ATT&CKTA0002;TA0006 — Execution; Credential AccessThe article describes execution paths that can culminate in credential exposure and host compromise.
Recommendation — Map agent-driven command chains to execution and credential access detections in your telemetry pipeline.

Key terms

  • AI Coding Harness: An AI coding harness is the wrapper environment that lets an AI model interact with code, tools, and a development workspace. It typically mediates tool calls, file access, execution limits, and feedback loops so the model can read, edit, run, and test code under controlled permissions.
  • Context File Poisoning: Context file poisoning is the injection of misleading or malicious content into files an agent reads as context. The agent then treats that content as trusted input, which can steer code changes, tool calls, or policy decisions if file provenance and read boundaries are weak.
  • Subagent Delegation: Subagent delegation is the handoff of a task from one agent to another agent with a narrower role or scope. The delegating agent passes instructions, context, and sometimes credentials or tool access, while the parent agent retains oversight and is usually accountable for the outcome.
  • Trust Prompt: A consent checkpoint that asks a user to approve execution before code or tool access proceeds. In MCP security, a trust prompt is only useful if execution cannot begin before the prompt completes and if later behaviour is still validated against the approved server definition.

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 IAM programme, it is worth exploring.
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