AI agent safety · prompt-injection defence

There may be text in here your eyes can't see.

A web page, an email, a PDF, a pasted string — any of them can carry instructions or data hidden in Unicode that renders as nothing to a human but reads loud and clear to a model: invisible tag characters, bidi overrides, variation-selector payloads, zero-width runs, homoglyph spoofs. invisible-ink finds it, decodes it, and strips it — without mangling real Arabic, Hindi, Thai, or emoji.

0
critical false positives…
206,448
…across real sentences
204
languages tested
100%
attack recall & decode
reveal — paste any text, see what's hidden loading scanner…
input (what a human sees)
revealed (what the machine sees)■ hidden
try an attack:
The smuggling vectors

Five ways to hide text in plain sight.

Each is a real, documented technique. Click any card to load it into the demo above and watch it get revealed and decoded.

Evaluation

Catches the attacks. Keeps the languages.

A sanitiser that strips all non-ASCII would catch every attack and destroy the world's text. The hard part is precision on real multilingual content, so invisible-ink is calibrated against FLORES-200: 1,012 professionally-translated sentences in each of 204 languages.

Precision on legitimate text

FLORES-200 · real sentences across 204 languages
0critical false positives, out of 206,448 sentences
Languages with zero false alarms—
Overall flag rate (all warnings)—
Legitimate text altered by the sanitiser—

The remaining warnings are genuine mixed-script tokens (a Cyrillic letter inside a Latin word) in transliterated text — flagged, correctly, as confusable, and never as a hard threat.

Recall on attacks

every documented smuggling vector, with payload recovery where applicable
—of crafted attacks detected
Detection—
Hidden payload decoded byte-for-byte—
Scan latency per input—
Confusable look-alikes in the table—

Grounded in the Unicode standard, not guesswork

character classes generated directly from the Unicode Character Database
Under the hood

Scan, decode, sanitise.

No model, no network. The detection rules come from the Unicode Character Database, and the context logic is tuned so legitimate international typography (Indic/Arabic joiners, Thai word breaks, CJK variation selectors, emoji ZWJ) is never mistaken for an attack.

01

Classify every code point

Against UCD-generated tables: default-ignorable, bidi controls, variation selectors, scripts, and a 6,712-entry confusables map.

02

Judge in context

A zero-width joiner inside Devanagari is typography; the same character between two Latin letters is smuggling. Script context decides.

03

Decode the payload

Tag characters map back to ASCII; variation-selector runs decode to bytes. The hidden message is recovered, not just flagged.

04

Sanitise, losslessly

Strip the smuggling vectors while leaving legitimate multilingual text byte-for-byte intact.

sanitise untrusted input before it reaches your model
# a tool returns web/email/document text — clean it before the model trusts it
from invisible_ink import scan, sanitize

report = scan(tool_output)
if report.verdict == "dangerous":
    log("hidden payload:", report.hidden_text)   # the decoded instruction

clean = sanitize(tool_output).cleaned             # safe to pass on; languages intact

Ships as a library and a CLI: invisible-ink --reveal "$text" prints the hidden payload; --clean prints the sanitised text.