r/learnmachinelearning • u/No-Conclusion3720 • 22h ago
Request Your coding agent trusts the repo, and the repo is the attack
Coding agents inherit trust from whatever context they're given. That includes the repo.
In a two-month incident review, we saw this pattern twice: malicious instructions embedded in a codebase or dependency coax a coding agent into executing an action the developer never sanctioned. The agent reads the content, treats it as legitimate context, and acts — committing code, triggering a deploy, or exfiltrating data. The model isn't malfunctioning. It's doing exactly what it was trained to do with the input it received.
The attack surface is quietly large. Any file the agent reads during a task — a README, a config, a third-party module, an inline comment — is a potential injection point. The agent has no way to distinguish 'this is a legitimate instruction from a maintainer' from 'this was planted by someone who got a commit into this dependency.'
Two confirmed incidents in sixty days is a small sample, but it's also two more than most teams are tracking, because most toolchains have no visibility into what an agent actually did versus what a developer intended.
For those running coding agents in production or CI environments: how are you handling the boundary between what the agent is allowed to read and what it's allowed to act on? Is the control at the prompt level, the tool level, somewhere else, or not yet solved?