cd /news/ai-safety/securing-ai-agents-part-2-what-is-pr… · home › topics › ai-safety › article
[ARTICLE · art-182428] src=dev.to ↗ pub= topic=ai-safety verified=true sentiment=↓ negative

Securing AI Agents, Part 2: What Is Prompt Injection?

Security researcher Ham of FX Hamrat ran 96 trials of a real AI agent (Claude Code) across three models in an isolated environment with planted prompt-injection tricks, and the agent attempted a dangerous action 7 times — roughly 7% of runs. The writeup, the second in a series on securing AI agents, cites Brave's August 2025 Comet experiment, in which hidden instructions in a Reddit spoiler tag led an AI browser to read a user's email address, trigger and read a one-time login code, and post both publicly, and notes prompt injection ranks first in the 2025 OWASP Top 10 for LLM Applications.

recommendation

Treat any content an agent reads — web pages, email, PDFs, READMEs, issues — as untrusted input, and gate sensitive actions like reading credentials or posting externally behind human approval, since roughly 7% of injected runs still got through.

more in playbook: Securing agents and AI tools
read3 min views1 publishedDec 5, 2026

This article was written with the help of AI. The facts and figures were checked against the sources listed at the end.

Hi, I'm Ham from FX Hamrat. Last time I wrote about AI that now does hands-on work for people. This time we look at how that AI gets tricked.

AI cannot cleanly separate "instructions" from "plain information" in the text it reads. Attackers exploit this by hiding instructions in web pages and emails that the AI will read. This is prompt injection.

A scam aimed at a person builds a believable story over the phone or by email. Whether it works depends on how careful the target is.

With AI, the attacker sometimes does not even need a story. To the AI, the text its owner typed and the text of a web page it read mid-task are both just sequences of characters. If that text says "Ignore your previous instructions and do the following," the AI may obey. AI companies keep adding countermeasures, but because the weakness sits at the root of how these models work, it has not been fully removed.

In the OWASP Top 10 for LLM Applications, a widely cited reference for AI security, prompt injection is number one in the 2025 edition.

On August 20, 2025, Brave, the browser maker, published an experiment against Comet, an AI browser.

The attacker hides instructions in a Reddit post using the spoiler-tag feature, so people cannot see them. The user simply opens that page and asks the AI to "summarize this page."

The flow of the experiment Brave published. The user only asked for a summary. Every other action was taken by the AI, following the hidden instructions.

After reading the hidden instructions, the AI read the user's email address from their account page, triggered a one-time login code, opened the logged-in Gmail tab to read that code, and posted both as a reply on Reddit. The attacker only has to read the reply to take over the account.

A person who asked for a summary and saw Gmail open would notice something was wrong. The AI did not notice and carried it all out. That is what makes this frightening.

White text on a white background, invisible parts of a web page, inside email formatting, text inside images. In October 2025, Brave showed that an AI would read and follow text written in a screenshot so faintly that people cannot read it.

Anything you let the AI read can hide instructions: web pages, email, PDFs, a project's README, an issue someone else wrote. AI is useful because it reads everything for you. That same convenience is the way in.

I thought so too at first. So I had real AI agents carry out tasks with these tricks planted in them, many times over.

Out of 96 runs, the AI was tricked into attempting a dangerous action 7 times. The models are getting smarter and refuse on their own most of the time. Even so, about 7% got through. For someone who gives an AI 20 tasks a day, that works out to more than one dangerous moment every day.

The tests ran in a disposable environment cut off from the outside, using a real AI agent (Claude Code) with three different models. Only fake secrets and unused destination addresses were in place.

Next time we look at real 2025 incidents where a tricked AI carried information out.

── more in #ai-safety 4 stories · sorted by recency
── more on @ham 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/securing-ai-agents-p…] indexed:0 read:3min 2026-12-05 · —