← All work

Case study · AI security

PromptShield

AI agents read emails, web pages and documents written by strangers. PromptShield checks that text for instructions aimed at the agent, including ones hidden from human eyes, before the agent sees it.

A demonstration build with invented samples. It runs entirely in your browser; nothing you paste is sent anywhere. It is one protective layer, not a complete defence, and the evaluation below shows what it misses.

Text to scan

Scans as you type too.
0risk / 100

Waiting for text

Paste text or load a sample.

What the agent would have seen

Risky passages are marked in the visible text.

–

What to pass to the agent instead

Hidden content removed, and the text wrapped and labelled as data.

–

Evaluation

Including what it gets wrong

24 labelled samples, half malicious and half ordinary, are scanned by a script. The figures are read from that script's result file.

–Malicious samples caught
–Ordinary samples wrongly flagged
–Recall
–Precision

The two it gets wrong

    Both failures are the expected weakness of pattern matching: it reads words, not intent. An injection phrased politely slips through, and an article that quotes an attack is flagged. This is why the scanner is paired with structural defences, and why a model-based second check is the next layer for high-risk agents.

    How it works

    Layers, cheapest first

    1. Reveal

    Zero-width characters, HTML comments and visually hidden elements are extracted. Text a person cannot see is scanned separately and scores higher.

    2. Decode

    Long base64 runs are decoded. If the result reads as an instruction, it is reported with the decoded text.

    3. Match

    Six rule families: instruction override, role hijack, data exfiltration, tool invocation, false authority and concealment.

    4. Score

    The strongest finding in each family counts once, so repeating a phrase does not inflate the score. Hidden delivery adds a penalty.

    5. Decide

    Block, quarantine or allow. Even clean text is passed to the agent wrapped and labelled as data.

    What actually keeps an agent safe

    Least-privilege tools, human approval before irreversible actions, and never mixing untrusted text with instructions. A scanner supports those; it does not replace them.

    Have an agent that reads outside content? Talk to me