Continuous Attack Surface Monitoring in CI/CD Pipelines
AI agents in CI/CD pipelines need runtime monitoring, not just static security scans.

Continuous attack surface monitoring in CI/CD pipelines must treat AI agents as privileged actors that read and act on untrusted text. Every new commit, action reference, or pipeline-readable input can change what an agent is exposed to and what it can do. The required security posture combines runtime monitoring of arguments, memory, and trust boundaries with containment controls and evidence that each fix stops an attack without breaking approved workflows.
Why CI/CD pipelines are a qualitatively different attack surface when AI agents run inside them
An AI agent joins an untrusted text interpreter to the privileges of a trusted pipeline actor. That combination inverts the pipeline’s trust model. Repository content and metadata are no longer merely inputs to predefined automation, because they can influence the model that decides which actions to take. A single message can lead an agent to read a file, execute a shell command, query a database, and send results to a webhook. Each action crosses a different boundary, and a probabilistic model that can be manipulated chooses which boundary to cross.
Traditional pipeline defenses assumed that trust boundaries were set before execution and that input validation controlled what could cross them. Agentic workflows make those boundaries depend partly on runtime decisions. Consequently, the automation itself becomes a first-class target, including its unpinned action references, secrets in runner memory, and state that survives between jobs. Existing supply-chain hardening remains useful, but it does not resolve this change in authority. In vulnerable workflows, an attacker need not gain write access to a trusted repository when opening an issue or pull request is enough to put instructions before a privileged agent.
What the first confirmed exploits in this class actually looked like
The Clinejection incident on February 17, 2026, began with a malicious GitHub issue title. That title was the entry point. It triggered a chain of four to five vulnerabilities that resulted in an unauthorized supply chain compromise of the Cline AI coding tool’s npm package. The malicious package reached developer and CI/CD systems over roughly eight hours before it was removed. CSA’s June 2026 research note describes the incident as evidence that pipeline-readable metadata can initiate a compromise extending beyond the agent’s own execution.
RyotaK of GMO Flatt Security disclosed a critical flaw in Anthropic’s claude-code-action in January 2026 [10]. Its authorization function, checkWritePermissions, determined whether an actor could trigger the agent in automation mode. The documented exploit chain combined an authorization bypass with prompt injection and access to live credentials. Some bash commands could run without explicit approval, so a successful injection could read /proc/self/environ and exfiltrate API keys. The resulting exposure included full repository compromise and downstream supply-chain propagation. Anthropic patched the primary authorization bypass and released hardened versions, but the underlying pattern was broader than that implementation.
The HackerBot-Claw campaign acted on its own across multiple targets, using remote code execution and stealing privileged tokens inside pipelines. The earlier March 2025 tj-actions/changed-files compromise, CVE-2025-30066, had already established pipeline dependency graphs as delivery vehicles for secret exfiltration, affecting roughly 23,000 repositories. The distinction is the route into pipeline authority. With AI agents, untrusted repository text can influence the actor entrusted to use that authority, rather than requiring the attacker to compromise a dependency first.
The full attack surface an AI agent introduces into a pipeline — beyond prompt injection
Prompt injection through issue text is only one entry point. Tool-call and MCP injection can instead place malicious instructions in tool descriptions or MCP server responses, overriding agent instructions or redirecting calls to attacker-controlled endpoints. Credential exfiltration is a familiar result, but defenses aimed only at that outcome miss how an attacker comes to control tool selection and arguments.
Persistent memory creates a different route to authority. “Memory provenance laundering” occurs when untrusted external observations are rewritten during consolidation as trusted user history. The attacker’s input can then become part of the context used for later decisions. Cross-agent poisoning extends that influence beyond one agent, as a compromised orchestrator relays instructions downstream through legitimate LLM interactions. Johann Rehberger’s March 2026 “Agent Commander” pattern demonstrated a persistent command-and-control topology built around that propagation.
MAESTRO’s seven-layer architecture explains why these vectors cannot be assessed independently. An attack can start at the Foundation Models layer, move through Agent Frameworks, and reach ecosystem integration. In particular, the composition of agents, tools, memory, and external integrations creates risks that are not visible when each component is considered alone. The relevant surface is therefore the chain of influence from untrusted content to privileged action.
Why static scanning cannot see this attack surface
Static analysis can identify a dangerous execution primitive without seeing who determines its arguments. A SAST tool may correctly flag exec.Command("bash", "-c", cmd) as a command-injection risk. The missing context is the decisive part. If an LLM derives cmd from untrusted input, the vulnerability spans the input, the model’s decision, and the resulting execution. That relationship is not captured by examining the shell invocation alone.
The Clinejection and claude-code-action cases illustrate the gap between inspecting code and observing runtime influence. A malicious issue title or an agent’s decision to read live credentials does not present the same evidence as a vulnerable source-code pattern. A tool call can also be allowed even when its arguments are unauthorized. Its name and timestamp cannot establish whether its values, operation type, or provenance were acceptable. Mutable memory and a compromised planner can also turn an otherwise benign invocation into one step in an attack chain.
Sanitizing direct user input leaves indirect input from web pages, emails, documents, tool outputs, pull request titles, and issue bodies outside the same control. The agent encounters those inputs while working. Because its decisions define which trust boundaries are crossed, the threat model must account for behavior during execution rather than remain a document describing the code at scan time.
What continuous attack surface monitoring must actually cover in an agentic pipeline
Monitoring must operate at the argument, memory, and trust-boundary layers. Its starting point is the flow of untrusted content into an agent’s context, including pull request titles, issue bodies, HTML comments, commit messages, and environment variables. Each field needs to retain its status as untrusted input when the agent reads it. Monitoring must flag that transition during the pipeline run, rather than treating repository metadata as safe because it arrived through an approved workflow.
Provenance-Aware Capability Contracts, or PACT, moves runtime enforcement from tool invocations to individual arguments. It distinguishes content-bearing arguments from arguments that confer authority. That distinction avoids treating every mixed-trust call as an all-or-nothing decision. The PACT paper reports 100% utility and security achievement on diagnostic suites under oracle provenance, a condition that matters to how the result is read. It shows that the approach works with supplied provenance, but does not show that production systems already get provenance that is as reliable.
The Provenance-Preserving Memory Firewall, or PPMF, addresses the same authority problem in persistent state. It keeps platform-maintained provenance attached to memories and matches action risk to the authority of the memories relevant to the action. Monitoring therefore needs to follow what an agent remembers and where that memory originated. Threat In, Threat Out, or TITO, complements this runtime view by building MAESTRO classification into an automated CI/CD scanner. A developer adding a tool can see the new attack surface as part of the pipeline.
Provenance-Aware Capability Enforcement, or PACE, mediates every tool call immediately before execution. It uses path confinement and capability and effect verification to check temporal dependencies and value flows across calls as well as isolated anomalies. These controls also need a view of privilege. Credentials should be bound to a repository, branch, environment, or trusted reusable workflow, with monitoring detecting scope beyond the workflow’s needs. Monitoring must still cover unpinned action references and outbound connections, while egress restrictions enforced by the infrastructure limit what a compromised agent can send.
Limiting blast radius when monitoring fails to catch an injection in time
Monitoring will miss some injections before they run. Containment must therefore stand independently of detection. The claude-code-action case shows why credential scope is a high-leverage control, as a trust assumption in authorization exposed pipeline-level authority without a scope limit. GitGuardian’s synthesis of nine incidents into six practitioner controls pairs scoped, isolated credentials with sandboxing the agent to the project directory. These restrictions limit the resources a compromised agent can reach even when its instructions have already been subverted.
The same synthesis calls for configuration files to be protected from agent writes and the workspace to be scanned for secrets before the first run. It also calls for logging every tool call and outbound connection, with default denial and approval required only for write, send, delete, and spend actions. Prompt injection can still get through all of these controls. They instead constrain its consequences and preserve evidence of attempted abuse. Sandbox and egress controls should operate outside the agent’s process so that the compromised actor cannot disable its own restrictions.
Approval volume can undermine that containment model. When permission prompts are frequent, users come close to approving every action, whatever its risk. Anthropic telemetry reported that Claude Code Auto Mode reduced permission prompts by 84% by automating safer approvals. Human interruptions should be reserved for the actions that require judgment. The smallest safeguard that stops an attack without disrupting approved work is more sustainable than a broad restriction that trains users to approve reflexively.
The blind spots that continuous monitoring leaves uncovered — and why naming them matters
Multi-agent propagation remains difficult to observe reliably. When a compromised agent passes instructions downstream through legitimate LLM interactions, what crosses one agent’s boundary can look like normal communication. Current monitoring tools do not reliably track provenance across those handoffs in real time. Persistent state has a related gap, because memory consolidation can rewrite untrusted observations as trusted history. Most logging systems do not instrument that step finely enough to distinguish authorized memory writes from laundering.
PACT and PACE demonstrate their approaches in controlled evaluation, but deployment at pipeline scale is not yet routine. Verification must run with low enough latency to avoid bottlenecks and few enough false positives to avoid constant intervention. An inventory gap compounds these engineering limits. Developer-installed extensions, IDE plugins with pipeline access, and MCP servers added without security review can remain invisible to monitoring scoped only to sanctioned agents.
HackerBot-Claw operated across multiple targets at machine speed, while autonomous attackers can iterate on failed techniques within seconds. Detection calibrated to human decision-making cannot rely on a log awaiting later review. Monitoring must support alerting and containment within that attack window. These gaps are reasons to layer credential limits, isolation, and egress restrictions around monitoring.
What a verifiable, evidence-based monitoring practice looks like in a release workflow
A release workflow needs evidence of exploitability. The documented 2026 cases exposed structural vulnerabilities that were there before the attacks, but knowing the general class did not prove whether a given configuration was vulnerable. A monitoring finding must make that connection explicit. Continuous threat modeling gives teams a place to start by showing what exposure a new tool adds. A proven attack against the actual configuration then gives reviewers a basis for deciding what must change.
A control that blocks an attack by disrupting approved work can create the approval fatigue that eventually defeats it. Before a release ships, the smallest safeguard that stops the proven attack should be re-verified against every approved workflow. Human reviewers must remain in control of every production change. Autonomous security tooling should keep the human checkpoints that were absent on the attacker side.
A Verified Change Record makes that decision reproducible. It documents the proven attack, the minimal fix, and the re-verified workflow results in one release artifact. The approver can then judge both the security effect and the operational cost. Without that record, a finding can remain in a backlog without resolving the exposure it identified.
Sources
- AI Agent Prompt Injection: The New CI/CD Supply Chain Threat
- Applying MAESTRO to Real-World Agentic AI Threat Models
- Autonomous AI Agents as Offensive Weapons: From GitHub Actions to Self-Directing Malware
- MATRA: Modeling the Attack Surface of Agentic AI Systems -- OpenClaw Case Study
- Indirect Prompt Injection Goes Operational
- Indirect Prompt Injection in the Wild: An Empirical Study of Prevalence, Techniques, and Objectives


