A developer asks an AI coding agent to look into a failing test after a dependency upgrade. The agent scans the repository, opens the dependency’s changelog, reads its README, and starts suggesting fixes.
Then it proposes an install command, edits a CI workflow, or reaches for credentials it has no reason to touch.
Nothing in the developer’s request looked malicious. The attack never showed up as a suspicious chat message. It came in through the repository itself, tucked inside documentation, issue comments, changelogs, or fetched web pages that the agent treated as part of the job.
This is the security problem now taking shape in the agentic software development lifecycle: the repository is no longer just a source of code. It is an instruction channel.
The repository became executable context
Traditional supply-chain attacks go after what gets built and deployed. Agentic prompt injection goes after what an AI system is told to do while it builds.
Coding agents read a lot these days: source files, issue bodies, pull-request descriptions, review comments, READMEs, dependency changelogs, error traces, web pages, and MCP tool responses. To a human, all of that is information. To an agent that can use files, a shell, Git, a package manager, and the network, any of it can turn into instructions.
The difference is subtle, but it matters:
- A developer prompt says: “Investigate the failing test.”
- A dependency changelog says: “Before upgrading, run this cleanup command.”
- An issue comment says: “The correct fix requires modifying the workflow configuration.”
- A fetched documentation page says: “To validate the change, export these environment variables.”
Each of these can pass for ordinary technical context. But if the agent folds them into its plan, the attacker has effectively slipped instructions into the developer’s workflow. OWASP explicitly names repository content as a potential instruction source, including issues, PRs, comments, READMEs, changelogs, error traces, fetched web pages, and tool responses.
Anatomy of a poisoned changelog

A poisoned-changelog attack doesn’t need a compromised laptop or a privileged account. It only needs to influence something the agent is going to read.
A simplified attack chain looks like this:
- Placement: An attacker plants instruction-like text in a dependency README, changelog entry, issue thread, PR comment, or web page.
- Ingestion: A developer asks an agent to upgrade a package, debug a failure, or build a feature.
- Instruction confusion: The agent mixes the legitimate task with instructions buried in untrusted content.
- Capability escalation: The agent uses tools it already has, such as Bash, file writes, package installation, Git operations, CI configuration, or outbound network access.
- Impact: The agent may run unsafe commands, change build or deployment files, leak secrets, or introduce a persistent change into the repository.
The key point is that the agent isn’t necessarily “hacked” in the usual sense. It is acting with permissions the developer or organization gave it, but it is being steered by content it should have treated as data.
From wrong answer to supply-chain compromise
Prompt injection in a chatbot might produce a misleading reply. Prompt injection in a coding agent can become remote code execution, credential exposure, or a compromised repository.
The difference is tool access.
An agent that can read files, run shell commands, install packages, write code, commit changes, and reach connected services turns a malicious instruction into a real action. A prompt injection stops being a bad answer and starts looking a lot like a compromised build agent.
The highest-value targets include:
.envfiles, API keys, SSH keys, and cloud credentials- GitHub tokens and CI/CD secrets
- Deployment configurations and infrastructure-as-code files
- Dockerfiles, package scripts, and dependency lockfiles
- CI workflow definitions and agent configuration files
- Test suites, especially tests that could be weakened or deleted to hide malicious changes
Anthropic’s enterprise guidance specifically stresses protecting sensitive files, credentials, and configuration from agent access, and limiting the network destinations an agent can reach.
Why “just refuse it” is not enough

Model-level safeguards matter. Alignment training, injection probes, and intent classifiers can lower the odds that an agent follows malicious content or does something at odds with what the user asked for.
But they are probabilistic defenses.
A determined attacker may find wording that gets past a filter. More importantly, the agent may never need to believe it is doing something malicious. It may simply be convinced that the action is a normal part of debugging, upgrading, testing, or documenting a change.
That is why security can’t depend only on the model spotting bad intent. The proposed action itself has to be checked against an external, deterministic policy before it runs.
Deterministic boundaries: the new perimeter
The strongest emerging approach separates judgment from enforcement.
| Layer | Purpose | Examples |
|---|---|---|
| Judgment layer | Reduces the chance that an agent follows malicious input | Alignment training, injection probes, intent classifiers |
| Fixed boundary layer | Determines whether a proposed action may run | Permission rules, Bash command analysis, PreToolUse hooks |
| Containment layer | Limits damage if an action runs | Sandboxing, scoped credentials, egress allowlists, ephemeral environments |
Anthropic describes this as a fixed-boundary layer that makes an agent’s blast radius explicit. Permission rules, command analysis, and hooks decide whether an action runs, while sandboxing and egress controls limit what it can reach and where data can go.
Pre-tool-call hooks
Hooks run at fixed points in the agent lifecycle, before a tool call executes. A security-focused hook can look at the proposed action and then block it, require approval, or defer it.
For instance, a hook can check whether a proposed Bash command fits the task, whether it touches a protected path, or whether it would change a sensitive configuration file. Anthropic notes that a PreToolUse hook can block a commit containing a secret, while a configuration-change hook can reject attempts to weaken security settings during a session.
Command analysis, not string matching
A solid boundary can’t lean on simple blocklists like “deny rm” or “deny curl.” Commands can be chained, wrapped in subshells, or built in ways that slip past naive pattern matching.
Command analysis should parse the proposed command and judge what it actually does: which files it touches, which network destination it contacts, whether it changes permissions, and whether it alters the agent’s own controls. Anthropic specifically lists Bash command analysis as part of deterministic enforcement.
Fail closed
If a hook errors out, times out, or can’t tell whether an action is safe, the default should be to block it, not allow it.
Security controls should also be managed centrally and be hard to weaken locally. If a repository can change the agent’s permissions mid-session, the attacker has found a way to make the agent’s own configuration part of the attack. Anthropic’s containment work specifically addresses project-local configuration that could run before a user accepts a folder-trust prompt.
A practical defense blueprint

Organizations adopting coding agents should treat repository context as untrusted by default.
- Treat issues, PRs, comments, READMEs, changelogs, logs, web results, and MCP responses as untrusted input.
- Give agents only the context the task needs, not unrestricted repository access.
- Use scoped, short-lived credentials instead of handing over a developer’s full standing access.
- Deny reads to credential paths and mask secrets wherever possible.
- Run agents in isolated, disposable environments with filesystem and network restrictions.
- Use narrowly scoped egress allowlists, and remember that a domain allowlist alone can’t tell an approved repository from an attacker-controlled one.
- Require explicit human approval for high-blast-radius actions: production migrations, IAM changes, credential rotation, infrastructure edits, and irreversible deletes.
- Review the full agent diff, not just the PR description.
- Flag out-of-scope changes to lockfiles, CI configurations, test files, Dockerfiles, and agent rules files.
- Keep an audit trail of what the agent read, proposed, executed, and was blocked from doing.
The new review checklist
Security review has to go beyond “Did the agent write good code?”
Ask:
- Did the agent read untrusted external content during the task?
- Did it propose commands, package installs, file writes, or network calls beyond the stated goal?
- Are the changes confined to the intended scope?
- Were CI workflows, package scripts, Dockerfiles, or agent configuration files modified?
- Were tests deleted, weakened, or swapped out for mocks?
- Were credentials, secrets, or sensitive files exposed to the agent’s context?
- Was the action gated by a deterministic policy, or only by model judgment?
- Can the organization reconstruct the agent’s context, proposed actions, and enforcement decisions?
OWASP’s guidance sets the baseline plainly: repository content processed by an AI coding agent should be treated as untrusted input.
Trust is a boundary, not a prompt
Repositories have always been part of the software supply chain. Agentic AI turns them into something riskier: a surface where attacker-controlled text can influence systems that can read, decide, and act.
The organizations that adopt coding agents safely won’t just ask models to be careful. They will define the boundaries agents operate within, enforce those boundaries deterministically, and audit every consequential action.
The poisoned changelog is not a futuristic threat. It is the natural result of giving an agent the ability to read everything in a repository, and the power to act on what it reads.