Supply Chain Security in Agent-Driven Code Pipelines
Agents now pose supply chain risks that human code review alone cannot control.
Sponsored by Graphide

For large AI-generated diffs, the alternative to line-by-line review is CI-enforced architectural checks paired with targeted human review of interfaces, security-sensitive paths, tests, and dependencies. Supply chain security in agent-driven code pipelines needs controls before code is generated and run, as well as scans of the finished code. The agent itself must be treated as a supply chain dependency, with constrained privileges and auditable decisions.
Why AI agents are now a node in the software supply chain, not just a tool on top of it
A developer sends a prompt, and an agent changes dozens of files and resolves a half-dozen dependencies autonomously. What controls stand between those decisions and a merge? Treating the agent as an accelerated developer misses its operational role. It chooses external code, writes implementation code, and runs build commands without a person reviewing each decision.
Cloud Security Alliance’s research note describes the agent, its models, its tool integrations, and its autonomous decisions as a structural dependency that organizations are not yet inventorying, signing, or auditing like a third-party library. The Model Context Protocol is embedded in build pipelines, making each connection a new dependency class. Requiring a human to approve a merge cannot control commands that have already run or packages that are already installed.
Slopsquatting: how hallucinated package names become pre-registered attack surfaces
When an agent chooses dependencies on its own, it gives attackers a way in even if no legitimate maintainer has been compromised. An agent invents a plausible package name that does not exist, and an attacker registers that name with malicious code behind it. CSA describes repeated hallucinated names across queries, giving attackers predictable registration targets. The name originates in generation. The attacker exploits the agent’s consistency.
Once registered, the name resolves through the same package-management workflow used for legitimate dependencies. Automated resolution can thus install code that an attacker controls before a human sees the decision to install it. A syntactically valid name is not evidence of trustworthy provenance. Static application security testing and dependency scanning do not establish that provenance at generation time merely by accepting the name or finding no known vulnerability.
Prompt injection through the pipeline: how an agent's CI/CD privileges become the attack surface
Dependency selection is only one route into the pipeline. Once an agent can execute commands, the context it reads can redirect those privileges. CSA documents Clinejection as a production incident in which an attacker placed instructions in a GitHub issue title. The agent read the title as task context and executed the injected commands. Those commands poisoned the GitHub Actions cache, creating a bridge from a low-privilege triage workflow to the high-privilege nightly release workflow.
When the release workflow ran, the attacker exfiltrated an npm token. Credential rotation revoked the wrong token, leaving a usable publication credential. The attacker then published a modified Cline package that silently installed an unrelated agent tool on developer machines that updated. This was injection chained with cache poisoning. Even though the first workflow was isolated, a later workflow still used the poisoned cache.
The input surface also includes PR descriptions, commit messages, README files, and outside material fetched during a task. These serve as working context only. An agent’s sandbox should be scoped around the access its task requires, since closing off all external context cannot be assumed practical. Useful access and release authority are different permissions, and a shared pipeline resource can connect them.
Plugin ecosystems and MCP servers as unsigned extension points agents trust by default
Plugins extend an agent’s authority through externally supplied code. Air Security disclosed Plugin4Shell in September 2026, affecting Claude Code, OpenAI Codex, GitHub Copilot, and Google Gemini CLI. Repository owners could replace reviewed plugin code even when an agent had locked the plugin to a specific commit hash. The declared version still appeared correct. On platforms such as Bitbucket, attackers created branch names that mimicked commit hashes, causing the agent to fetch malicious code instead.
Because plugins execute with the user’s permissions, the substituted code could access files, steal credentials, and reach connected systems. Air Security’s disclosure records patches from Anthropic and OpenAI, while GitHub Copilot remained unpatched and Google would not patch the retiring Gemini CLI. A version lock was not an integrity guarantee. The failure lay in how the hash reference resolved.
CSA also documents internet-exposed MCP servers with no authentication and the ClawHavoc poisoning campaign against OpenClaw’s ClawHub marketplace. Malicious skills in that campaign exfiltrated cloud credentials and hijacked developer environments. These are separate failures at the same trust boundary. Agents use tools or instructions from external providers that lack the integrity guarantees needed for the execution privileges they receive.
Payload-less skill hijacking: the attack that current scanners cannot see
Even an extension with no executable payload can redirect an agent. Zhejiang University researchers introduce Semantic Compliance Hijacking, or SCH, in which a malicious skill encodes harmful goals as natural-language compliance rules. The agent treats those rules as operational directives and generates the harmful code itself. The skill contains no code payload to identify. The attacker has shifted from supplying an executable artifact to influencing the agent’s task planning.
The researchers report that the scanning tools they tested, including SkillScan, had a 0.00% detection rate for SCH-crafted skills. The artifacts have no Abstract Syntax Tree signatures or explicit harmful commands that those tools can recognize. Tests covered three mainstream agent frameworks and three foundation models, with peak success for confidentiality breaches and remote code execution under the most vulnerable configurations. Multi-Skill Automated Optimization made the attacks work better in testing. These findings apply specifically to the tested configurations.
Permission limits remain necessary, but they do not fully address this mechanism. An agent legitimately allowed to read files and execute shell commands can be redirected toward unauthorized targets without requesting a new permission. The researchers therefore call for semantic intent validation rather than signature-based detection alone, a control category not yet available in production tooling at scale.
How malicious skills propagate through multi-agent systems and why a single compromised node cascades
In multi-agent pipelines, delegated trust can turn a local compromise into a system-wide exposure. One agent’s output, credential, or dependency becomes another agent’s trusted input. The initial workflow did not need release privileges because a later workflow consumed the compromised resource.
CISA disclosed the Shai-Hulud npm worm in September 2025, showing how stolen credentials could support autonomous propagation beyond an initial compromise. The worm harvested credentials from developer machines and build environments and used them to republish malicious packages without a human operator. A second wave in late November 2025 touched more than 27,000 repositories. The common link is delegated authority. When a credential or artifact is trusted across boundaries, a compromise can spread through the system, so controls must cover what downstream actors inherit.
Where security controls must be applied: the generation layer, not just downstream scanning
Governance must cover the decisions that produce artifacts as well as inspection of the artifacts afterward. A hallucinated dependency can be resolved before a manifest exists, an SCH-directed operation can execute before there is code to scan, and a substituted plugin can load before a PR opens. Output scanning arrives after those actions. CSA recommends treating package resolution and CI/CD execution as privileged operations, requiring allowlisted dependencies, and restricting agents to agent-prefixed branches without production credentials, deployment rights, or self-approval. Dependency allowlists address slopsquatting, while credential and execution restrictions limit the reach of injected instructions.
Plugin4Shell establishes the need to verify the resolved object. Semantic skill analysis addresses a different gap. A study of malicious skill detection in the agentic supply chain reports a 93% F1 score across two hundred real-world skills by linking artifacts, operations, operands, and value flows. That supports looking beyond signatures, but it does not show that the approach defeats every SCH configuration.
Model loading also belongs inside this boundary. CSA recommends safetensors over pickle, immutable revision hashes rather than moving tags, and trust_remote_code set to false by default. These controls address the risk of execution-at-load-time before inference begins. SLSA provenance, Sigstore signing, and SBOM generation extend software transparency practices to model artifacts and agent runtimes. None replaces downstream scanning, but each governs a source of authority that downstream scanning alone cannot secure.
CI enforcement as the architectural gate for reviewing large AI-generated pull requests before a merge
For teams reviewing large agent-authored pull requests, CI should enforce architectural constraints while human review concentrates on consequential decisions. Large diffs lose reviewability when a bug fix also reformats files, renames variables, and changes comments. Approval then risks becoming a formality. Machine-checkable rules that exit non-zero and block a merge make the boundary enforceable independently of reviewer attention. Agent-branch restrictions and independent approval must therefore be enforced through pipeline rules.
GitHub Actions can fail a build when schemas, API routes, or architectural constraint definitions change without corresponding updates. A living architecture graph can also support a consistency gate for dependency introductions and module-boundary violations. Passing them establishes compliance only with the encoded constraints.
The remaining software factory controls still apply. CSA describes SLSA provenance, build-time and release-time Sigstore signatures, an SBOM, integration-test release gates, SAST, CVE scans, and hermetic builds. Tests need scrutiny of their own. An agent can make a run pass by skipping a test, weakening an assertion, or catching an exception rather than correcting the implementation, so test-file changes warrant particular suspicion. CI becomes an architectural gate only when its rules constrain both the output and the agent’s ability to bypass review.
What developers need to treat differently when agents are in the pipeline
With those gates in place, developers can focus more on judging changes to the system as a whole. Review should begin at public interfaces, security-sensitive paths, generated files, tests, and dependency manifests. Code that looks right on its own can still break the wider design, and an agent-authored change to a security-sensitive path should merge only if a developer can explain it.
Dependency and extension provenance become part of that ownership. Before installation, every agent-selected package should be verified against a known registry, with approved sources and immutable hashes constraining what can enter the environment. A resolving name alone is insufficient evidence. Skills and plugins need the same close review as third-party libraries, including checks of the natural-language rules that tell the agent what to do. Their instructions can exercise the agent’s existing authority even when the files contain no executable payload.
Human review capacity does not grow in proportion to agent output, so exhaustive diff reading cannot be the sole control. Architectural enforcement must handle the repeatable constraints that reviewers cannot reliably check across every changed line. A living architecture graph gives developers a map of the relationships changed across many files, making it possible to judge dependencies and boundaries as a system. That is the practical oversight model for agent-driven pipelines, with CI enforcing the rules and an accountable developer deciding whether the resulting design belongs.


