Most conversations about securing AI agents still revolve around prompt injection as if it’s purely a model problem. “Sanitize the input.” “Add better guardrails.” “Use a stronger system prompt.”
This framing misses where some of the most effective attacks are actually happening.
In recent demonstrations, autonomous agents were compromised through poisoned configuration files and code in repositories. Malicious instructions placed in what the agent treats as trusted source material caused it to harvest cloud credentials, enumerate internal infrastructure, and extract CI/CD keys — all without any direct manipulation of the model’s reasoning through user input. The agent simply did what it was built to do: read the code/config in its environment and act on it.
This is indirect prompt injection delivered through the supply chain.
Why This Is Different
Traditional prompt injection assumes the attacker has to reach the model through the “user” channel. The poisoned repository approach bypasses that entirely.
The agent has legitimate permission (often necessary for its function) to read from repositories, configuration files, or dependency manifests. Once those sources are compromised, the agent becomes an unwitting executor of attacker instructions.
This is not a new class of bug. It’s the same supply chain and trust issues that have plagued software development for years, now weaponized against systems that can act autonomously.
We saw similar patterns in 2025 with incidents like:
• Cline: a crafted GitHub issue title turned an authenticated coding session into a package installer affecting ~4,000 machines.
• LiteLLM: a backdoored release on PyPI that was pulled ~47,000 times in three hours.
• MCP servers: ~200,000 exposed with no authentication by design.
In each case, the compromise didn’t require breaking the AI model. It required abusing the authority the agent already possessed because of how the surrounding system was designed.
The Guardrail Blind Spot
Current defensive tooling for agents largely focuses on the prompt layer and tool-use restrictions. These are useful, but they assume the data the agent consumes is relatively clean or at least auditable in real time.
When the poison lives in a Git repository, a config file the agent
is expected to load, or a dependency it autonomously pulls, those assumptions collapse.
Many teams still treat “our repo” as a trusted boundary. That boundary is disappearing the moment agents start making decisions based on what they read there.
Practical Reality Check
If your agent can:
• Read code/config from external or even internal repositories
• Execute or act on what it reads
• Trigger pipelines, modify files, or call APIs
…then you have a supply chain attack surface that traditional application security controls were never designed to protect against autonomous execution.
Signing commits helps. Pinning dependencies helps. But these are partial measures. An agent operating at scale will eventually encounter poisoned or malicious content that looks legitimate enough to act on.
What Actually Moves the Needle
From an offensive security perspective, the teams making progress are treating every external (and many internal) sources an agent reads as untrusted by default. They are:
• Implementing provenance and integrity checks before agents act on code or config
• Severely limiting what an agent can do even when operating on “trusted” sources
• Monitoring for behavioral anomalies when agents interact with repositories or dependencies
• Designing workflows where high-impact actions require explicit confirmation rather than autonomous execution
The uncomfortable truth is that many current agent architectures were built by teams optimizing for capability first and security second. That order is now creating exactly the conditions for supply chain attacks to succeed at machine speed.
The question isn’t whether poisoned repositories will become a standard attack vector against agents. They already are.
The real question is whether your agent design assumes the code it consumes is safe — or whether it assumes the opposite.
Top comments (3)
Great piece, Sergey. You nailed the core problem: the industry is still fighting the last war. Prompt injection gets all the headlines, but supply chain compromise against autonomous execution is where the real damage lives - and you're absolutely right that "capability first, security second" is the architectural sin enabling it.
A few thoughts that amplify your argument from the offensive side:
Thanks for the thoughtful expansion — especially the distinction between dependency reach and autonomous installation authority. That is exactly where the blast radius changes: an agent does not merely suggest a dependency; it may resolve, install, and execute it within the same workflow. Slopsquatting makes this particularly dangerous because the model itself can generate the attacker’s target namespace.
I also strongly agree that we need an SBOM-like inventory for agent skills, tools, MCP servers, prompts, and dynamically loaded instructions — plus an execution ledger showing what the agent loaded, trusted, and invoked during each run. Without that, incident response becomes largely forensic guesswork.
One small nuance regarding MCP: an MCP server does not necessarily sit between the agent and the model provider or directly modify model responses. More commonly, it mediates access to tools and data. But the security consequence may be just as serious: a compromised server can poison tool output and context, expose credentials, or present malicious capabilities that the agent treats as legitimate.
“Agents need a digital immune system” is an excellent framing. Provenance, least privilege, behavioral monitoring, and confirmation gates have to work together; none of them is sufficient alone. Thanks for adding such a strong offensive perspective — I’d be glad to compare notes on practical testing approaches for these architectures.
Thanks for the clarification - you're absolutely right, and that distinction makes the threat model sharper.
If the MCP server mediates tool access rather than model responses, the compromise surface shifts from "response tampering" to "capability forgery." That is, in some ways, more dangerous. The agent doesn't question a tool's output because it assumes the tool is legitimate - and if the compromised server presents a malicious capability as a standard tool, the agent executes it with the same trust it would give to a benign one. The poisoned context enters through the "trusted tool" channel, which bypasses most of the detection layers teams have built for prompt-level attacks.
On practical testing approaches - a few patterns we've been exploring in red team exercises against agent architectures: