Agent in Production
ResilienceLong read

Prompt Injection Attack Surfaces in Production Coding Agent Pipelines

· 9 min read
Cover illustration for “Prompt Injection Attack Surfaces in Production Coding Agent Pipelines”
Resilience · October 22, 2026 · 9 min read · 2,070 words

Production coding agent pipelines need hard infrastructure boundaries because prompt injection can turn untrusted text into credential theft, malicious changes, and unexpected API bills. Enforce spending caps at the session, developer, and time-period levels. Combine those caps with scoped credentials, isolated sandboxes, restricted tools, approval gates, and attributable logs so a hijacked agent cannot act beyond its authorized scope.

Why production coding agents are a qualitatively different injection target than chatbots

LLMs get system prompts, user messages, retrieved documents, and tool results as one sequence of tokens. Role tags provide formatting conventions while leaving trust boundaries unenforced at the model layer. Production coding agents therefore combine two dangerous properties, namely routine exposure to untrusted content and live write access to repositories, CI/CD pipelines, and cloud APIs. An instruction hidden in that content can redirect an agent that already has permission to act.

The distinction from chatbot injection is the consequence of obedience. A chatbot can produce a bad answer, while an agent can produce a deployment, a deletion, or credential exfiltration. Indirect injection requires no access to the system prompt because the payload arrives through material the agent is supposed to read. OWASP has ranked prompt injection LLM01 across two consecutive editions of its Top 10 for LLM Applications. There is no structural fix equivalent to parameterized queries for SQL injection.

How the attack surface is organized: a pipeline-stage taxonomy

Maloyan and Namiot’s SoK paper organizes attacks by delivery vector, modality, and propagation behavior, cataloging 42 distinct techniques. The delivery vector provides the clearest starting point for engineering controls because it identifies where an attacker can reach the agent. Each entry point has different access requirements and exposes different authority.

Repository content includes comments, commit messages, PR metadata, issues, and README files that agents inspect during ordinary work. CI/CD trigger metadata supplies GitHub event payloads, workflow inputs, and environment variables. Agent configuration files set instructions when a session starts, while MCP tool descriptions and server responses supply guidance through the services the agent connects to. External runtime data supplies package documentation, web pages, internal wikis, and documents retrieved to augment generation. Multi-agent message passing then carries one agent’s output into another agent’s context, creating a route for propagation.

Repository content as an injection surface: code comments, commit messages, and PR metadata

Clinejection turned a single malicious GitHub issue title into a supply chain compromise. Security researcher Adnan Khan identified the prompt injection weakness in the Cline AI coding tool’s automated issue triage workflow. The vulnerability was publicly disclosed February 9, 2026, and exploited in the wild February 17, 2026. A chain of four vulnerabilities led to an unauthorized compromise of the Cline npm package, which reached an undisclosed number of developer and CI/CD systems over approximately eight hours before removal.

RyotaK of GMO Flatt Security disclosed a separate authorization flaw in Claude Code GitHub Action in June 2026. Its checkWritePermissions function unconditionally trusted actor identities ending in [bot], allowing an attacker’s GitHub App to submit a crafted issue that passed the check. The injected instructions caused Claude to read /proc/self/environ and exfiltrate pipeline secrets. Anthropic patched the main bypass within four days after disclosure and released hardened versions. The mechanism matters beyond that patch because legitimate workflow inputs carried the payload, while an authorization assumption gave it access to elevated credentials.

Agent configuration files loaded at session startup as a privileged injection surface

Files such as CLAUDE.md and AGENTS.md are loaded as authoritative operator-level instructions before PR content is processed. A malicious PR body targets an invocation, but a poisoned configuration file can affect every subsequent session against that repository until corrected.

The weakness appears when teams treat these security boundaries as documentation. Anyone able to merge a change, or exploit a misconfigured branch protection rule, may be able to rewrite the agent’s behavioral policy. Maloyan and Namiot classify this mechanism as Rules File Exploitation, distinct from cross-origin context poisoning. Configuration that sets how an agent behaves should therefore go through the same review and meet the same branch-protection requirements as CI/CD workflow files. Its readable format does not make its authority less consequential.

MCP tool descriptions and server responses as a tool-poisoning surface

The Model Context Protocol extends the agent’s reach beyond the repository to file systems, shell access, external services, and other agents. It also extends the set of parties that can place text in the agent’s context. Tool descriptions come in as trusted metadata that helps the agent choose which capability to use. A poisoned description can therefore alter the action plan before the first tool call occurs.

An attacker controlling or compromising an MCP server can embed instructions in tool names, descriptions, or return values. Exposure can begin with a server installed by a developer and compromised later, a typosquatted package name, or a community-registry server fetched without integrity verification. The structural error is promoting a provider’s description of a tool into authority over the agent’s behavior. Server responses pose a similar risk after a tool runs because they can return instructions as data. Filtering these strings may catch known payloads, but it does not establish a boundary between information about a capability and permission to use it.

External data fetched at runtime: package documentation, web pages, and RAG-retrieved content

Zscaler’s July 2026 in-the-wild case showed agents making fraudulent cryptocurrency payments after they read poisoned package documentation. The agents had payment capabilities and no confirmation requirement. The attack entered through external material fetched during work, without a repository change or an operator instruction. That makes runtime retrieval a particularly broad surface because an attacker need not gain access to the target organization.

A fake package, typosquatted domain, or poisoned public documentation page can place instructions in an agent’s path. RAG adds a way to store the attack because one poisoned document can stay in a knowledge base and be retrieved into many later contexts. Maloyan and Namiot use cross-origin context poisoning to describe how malicious material from outside the task’s domain is accepted as context that belongs to the task. The economics favor reuse because a payload targeting one package’s documentation can reach deployments across organizations. Agents handling dependency resolution or package installation are especially exposed because external retrieval is an expected step.

How attack chains propagate across multi-agent pipelines once one stage is compromised

An issue title reached an automated triage workflow, yet the resulting chain ended in a compromised package distributed to developer and CI/CD systems. That incident demonstrates propagation across a workflow. Multi-agent pipelines add ways for an attack to spread when reasoning that has been compromised becomes input to another stage.

A hijacked agent can embed instructions in output that a downstream agent accepts as trusted work. It can also poison shared memory or a vector database that other agents consult. If the payload reaches an orchestrator, it can redirect task assignments across the pipeline. Maloyan and Namiot’s taxonomy distinguishes these cascading attacks from single-hop injections through its propagation axis. The defensive implication is to assume an individual agent can be compromised and limit its influence on neighboring stages, rather than relying entirely on protection at the initial entry point.

Why model-level defenses are insufficient against adaptive injection attacks

CISA, NSA, and their Five Eyes counterparts in the UK, Canada, Australia, and New Zealand issued joint guidance in May 2026 naming prompt injection as a core manipulation vector. Their guidance states that no single safeguard is sufficient and emphasizes governance, accountability, monitoring, and human oversight. That position makes model behavior one defensive layer rather than the security boundary for an autonomous workflow.

Maloyan and Namiot analyzed 18 defense mechanisms and found that most achieved less than half mitigation against sophisticated adaptive attacks. They report that attacks using adaptive strategies succeed more than 85% of the time against state-of-the-art defenses. Filtering can be evaded through encoding, obfuscation, or instructions split across retrieved chunks, while prompt hardening and fine-tuning leave the underlying trust problem intact. Output classifiers can spot known patterns, but new instructions can still get through and be carried out. Model defenses reduce the probability of compromise, but deterministic infrastructure controls bound its consequences without depending on how the payload is phrased.

Diagram: Model Defenses vs. Infrastructure Controls: Why One Fails. Visualizes: Show the contrast between probabilistic model-layer defenses and deterministic infrastructure controls.

Scoped credentials and per-session sandboxes as the first deterministic control layer

Containment begins before the agent reads its first untrusted input. Credentials should be minted fresh for each session, limited to the operations required by its task, and revoked automatically when the session ends. A session should not inherit a broad, long-lived CI service account or credentials for unrelated systems. In the Claude Code GitHub Action attack, environment variables exposed pipeline secrets, so access to credentials was key to the exfiltration path. Ephemeral credentials still require careful placement because a secret readable during a session can be stolen during that session.

Isolation addresses the execution state that credential scoping does not cover. Each invocation should have its own sandbox, a fixed time-to-live, and automatic destruction on completion. MicroVM-level isolation gives each workload its own kernel, while shared-kernel containers retain escape paths when code is untrusted. Sandboxes should never be reused across tasks because compromised state can carry over into later work. Ellipsis implements this pattern with an isolated cloud sandbox for every session, freshly minted task-scoped credentials, and revocation on completion.

Least-privilege tooling and human approval gates for irreversible actions

The Zscaler payment case exposes the cost of letting a readable document influence an irreversible action without confirmation. Sandbox isolation alone cannot prevent harm that an agent is explicitly authorized to cause. The tools an agent can use must therefore fit its task, so a code-review agent should have no shell execution capabilities and a dependency-upgrade agent should hold no production deployment credentials.

Approval requirements should then escalate with consequences and reversibility. Read-only operations can proceed autonomously, while writes to production artifacts require a human in the loop. A human should have to give explicit confirmation before production deployments, package publishes, secret rotations, and external API calls that have financial consequences. Actions that move money or send messages outside the organization also need explicit approval beyond the permission given for the original task. The gate matters because it separates permission to investigate or prepare a change from permission to commit the organization to its effects.

How do you stop unexpected API bills while logging every tool call, diff, and token?

The Hugging Face incident described in the notes ran for roughly a week, illustrating the blind spot that unlogged agent behavior can create. An immutable action record makes an incident reconstructible and gives responders a basis for scoping remediation. That record should capture the requested task and trigger, resources touched, commands executed, files changed, API calls made, and session outcome. Secret access attempts, permission escalations, dependency changes, and external network calls provide security signals against the declared task. Every tool call and diff must be attributable to a person or trigger.

Cost belongs in the same record because unexpected token use and runtime can be signs of injected workloads. Monitoring alone reports how much is used but cannot stop that use. The infrastructure must enforce caps for each session, developer, and time period so that execution cannot spend more than allowed. For Ellipsis, session-level spend limits complement its logging of every tool call, diff, and thinking token with attribution to the initiating person or trigger. The distinction is between an audit trail that explains expenditure and a hard boundary that constrains it.

Treating agent configuration as code: the governance practice that makes all other controls auditable

These controls remain dependable only if changes to them are visible. Tool scope, credential bindings, approval requirements, sandbox TTLs, and budget caps should live in version-controlled configuration reviewed through pull requests. A diff then exposes a widened permission or removed approval gate before it becomes policy. Version control supplies an author, reviewer, and timestamp rather than leaving security decisions in unaudited toggles or runtime changes.

OWASP’s Top 10 for Agentic Applications, published December 2025, includes goal hijacking, tool misuse, identity & privilege abuse, memory & context poisoning, and cascading failures. Versioned policy helps make controls against these risks reviewable and auditable against known-good states. One operational example is Ellipsis’s model of YAML-defined agents checked into repositories, executed in isolated cloud sandboxes with session-scoped credentials, and supported by attributed action logs. Apply branch protection to CLAUDE.md and AGENTS.md, require at least one reviewer for any agent configuration change, and treat those files as security policy.

Sources

  1. Prompt Injection Attacks on Agentic Coding Assistants
  2. AI Agent Prompt Injection: The New CI/CD Supply Chain Threat
Filed underResilience

More in Resilience