Your AI reviewer just approved malware it couldn't see

You know that green checkmark that appears when your code passes review? The one that means a senior developer looked at your work and approved it? 

That checkmark now comes from an AI assistant scanning every line you write. Your company pays for it. Your manager requires it. The AI catches bugs faster than any human could. It never gets tired. It reviews code at 2am and on weekends. It's supposed to make your software more secure.

Last week, someone figured out how to make it approve malicious code using a comment the AI can read but you cannot.

The approval came through. The malware shipped. And the developer who submitted the pull request never saw what their AI assistant actually approved.

What everyone thinks is happening vs. what's actually happening

Here's what we've been told: AI code reviewers scan every change for security vulnerabilities, style violations, and logic errors before code merges into production. They catch what humans miss. They make software development faster and safer.

Here's what's actually happening: AI code reviewers have become the highest-value target in your development pipeline — because they have permission to read everything, write everywhere, and their approvals are trusted automatically.

A new attack against Microsoft Azure DevOps makes this concrete. An attacker submits a pull request — a proposed code change — that looks completely normal. Buried inside it is a comment formatted in a way that's invisible to the human developer but perfectly visible to the AI assistant reviewing the code.

That hidden comment contains instructions. Not suggestions. Instructions.

It tells the AI to approve the pull request. It tells the AI to pull code from a different repository the attacker controls. It tells the AI to integrate that code into the project as if it were part of the original change.

The developer sees clean code and an AI approval. What actually merged contains malware, backdoors, or credential stealers the developer never reviewed — because the AI reviewer was hijacked mid-review by an invisible prompt injection.

Here's the part that should make you uncomfortable: This isn't a bug in AI. This is how AI works. The same capability that lets an AI assistant understand context and follow complex instructions is the capability that lets an attacker rewrite those instructions in real time.

You taught the AI to be helpful. The attacker taught it to be helpful to them instead.

How the attack actually works — without the attacker ever touching your repo

Here's the part that confuses people at first: if the attacker doesn't have access to your repo, how does anything malicious get in? The answer is they never need that access. They need access to one invisible sentence.

Step one: the attacker only needs a foothold, not the target. They need write access to some project — often a low bar, like an external contributor account or any repo that accepts outside pull requests. They don't need access to the sensitive project they're actually after.

Step two: the payload hides behind formatting the interface throws away. Pull request descriptions support Markdown, and Markdown allows HTML comments. In a rendered web page, an HTML comment displays as nothing — a reviewer scrolling the PR sees an ordinary, clean description. The comment is still sitting there in the raw text underneath.

Step three: the AI doesn't see what you see. This is the actual failure. The API that hands pull request content to the AI agent returns that hidden comment word-for-word, because the untrusted text was never separated from trusted instructions before being handed to the model. The human and the AI end up reading two different documents from the same pull request.

Step four: the hidden text is written as a command, addressed to the agent. Not vague bait — a checklist. Approve this pull request. Pull code from this external location. Integrate it as part of the change. Say nothing about it in the summary given to the reviewer.

Step five: the AI acts with the reviewer's permissions, not the attacker's. This is the part that makes the attack work at all. The agent operates using the authenticated developer's own access — so it can act anywhere that developer is authorized to touch, including places the attacker could never reach directly. Security researchers call this a confused-deputy attack: the attacker gains nothing directly. They borrow the reviewer's access through text the reviewer never sees.

It gets worse in fully automated pipelines. Where AI agents review every pull request on a webhook trigger with no human confirmation step, the attack fires the moment the pull request is opened — before anyone has even loaded the dashboard.

So the honest answer to "how does malware get into a repo the attacker can't touch" is: it doesn't, technically. The comment gets in through the attacker's own limited access. The comment's entire job is to instruct the reviewer's AI to go fetch and merge code from somewhere the attacker does control, using permissions the AI already has. The attacker never needs a key to your front door. They need one sentence your AI will read and you won't.

We replaced judgment with automation — then stopped watching the automaton

Three years ago, code review meant a human with context and experience looking at a change and asking: does this make sense? Is this safe? Should we ship this?

That took time. It created bottlenecks. So we built AI assistants to speed it up.

Then we did something subtle and catastrophic: we started trusting the AI's approval as much as we trusted the human's. In many workflows, an AI approval is now sufficient to merge code into production without a second human ever seeing it.

We made AI reviewers into authentication gatekeepers — and then we forgot they don't actually understand what they're approving. They predict what a helpful response looks like based on patterns in training data. When an attacker plants a new pattern — an instruction hidden in a comment, formatted as guidance to the assistant — the AI follows it. Not because it's compromised, but because that's what it was designed to do.

The AI is working exactly as intended. We just gave it a threat model it was never built to handle.

This isn't isolated to Azure DevOps. Researchers have demonstrated similar attacks in Android AI agents — where invisible text rendered on-screen can instruct the AI to execute commands the user never authorized. Another attack used crafted repository files to trick AI coding assistants into installing malicious dependencies.

What these attacks have in common: they all exploit the same architectural decision. We let the AI see everything, execute everywhere, and trusted that its "understanding" would keep it safe.

It won't. It can't. Because the AI doesn't evaluate trustworthiness — it predicts helpfulness. And attackers are very good at teaching it that malicious actions look helpful.

What to actually do if you use AI code review — or work at a company that does

1. Treat AI approval as a draft, not a decision.  

If your workflow allows code to merge on AI approval alone, stop. Require at least one human to review what the AI approved — not just the code, but the approval itself.

2. Check what your AI assistant can see and touch.  

Most AI coding tools have access to your entire codebase, your environment variables, your Git history, and sometimes your local files. Go into the settings and revoke access to anything it doesn't need for basic autocomplete. If you can't limit it, consider whether you should be using it at all.

3. Audit recent pull requests approved by AI without human review.  

Pull up the last 30 days of merged code. Filter for changes where the only reviewer was an automated bot or assistant. Read them yourself. You're looking for anything unusual: dependencies you don't recognize, config changes that weren't discussed, comments formatted strangely or in languages your team doesn't use.

4. Ban hidden formatting in code comments and pull request descriptions.  

Some systems let you embed invisible Unicode, HTML comments, or whitespace-encoded instructions that render as blank space to humans but are perfectly readable to models. Set a linter or pre-commit hook that flags anything non-printable in text fields.

5. If you're a parent, teacher, or manager: Ask how AI is reviewing decisions that affect you.  

AI review isn't just a developer problem. Schools use AI to review student essays for plagiarism. Banks use AI to review loan applications. Employers use AI to review résumés. In every case, someone taught an AI to make a judgment — and in every case, that AI can be instructed to change its judgment by someone who knows how to prompt it. Ask what's being reviewed. Ask if a human checks the AI's work. If the answer is "the AI is faster and we trust it," you now know what question to ask next.

What's the worst thing your AI assistant has access to?

Your calendar? Your Git repos? Your corporate email? The production environment? I want to know what you checked after reading this — and whether you were surprised by what you found.

Identity Decoded publishes every week at identity-decoded.com

Reply

Avatar

or to participate

Keep Reading