# LLM Guard InvisibleText Unicode filtering

> Do the Rust scanner and LLM Guard's default InvisibleText scanner return the same cleaned text, validity, and risk on fixed Unicode samples?

Source: https://keryn.dev/evals/llm-guard-invisible-text/

Do the Rust scanner and LLM Guard's default InvisibleText scanner return the same cleaned text, validity, and risk on fixed Unicode samples?

| Evaluation detail | Description |
|---|---|
| Keryn engine | Keryn prompt-injection-detector scan_invisible_text at `8ef659dcc5ec` |
| Reference | LLM Guard InvisibleText.scan  |
| Corpus | Authored text and Unicode category boundaries |
| Comparison | Exact equality of cleaned Unicode text, validity, and risk on each authored input. |
| Receipt | [`llm-guard-invisible-text.json`](https://keryn.dev/evals/llm-guard-invisible-text.json), sha256 `2ffb33bef0671330` |

## Results

| Measure | Value | Count | Denominator |
|---|---|---|---|
| Exact result agreement | **100%** | 17 / 17 | all authored inputs |

Cases by status: 17 identical.

## What this does and does not measure

- Opt-in default Cf, Co, and Cn filtering with Unicode Character Database 16.0.0.
- Format characters can be meaningful in ordinary text, including emoji and right-to-left scripts. This scan measures character filtering only.
- The corpus tests compatibility on fixed samples. It makes no claim about prompt-injection detection accuracy.

## All cases (17)

**Show every case**

| Fixture | Reference valid | Keryn valid | Reference risk | Keryn risk | Cleaned text agrees |
|---|---|---|---:|---:|---|
| `ascii-control-and-text` | true | true | -1 | -1 | Yes |
| `ascii-del` | true | true | -1 | -1 | Yes |
| `emoji-joiner` | false | false | 1 | 1 | Yes |
| `empty` | true | true | -1 | -1 | Yes |
| `format-bidi-isolate` | false | false | 1 | 1 | Yes |
| `format-bom` | false | false | 1 | 1 | Yes |
| `format-zero-width` | false | false | 1 | 1 | Yes |
| `mixed-repeated-categories` | false | false | 1 | 1 | Yes |
| `non-ascii-control-preserved` | true | true | 0 | 0 | Yes |
| `noncharacter` | false | false | 1 | 1 | Yes |
| `private-use-bmp` | false | false | 1 | 1 | Yes |
| `private-use-supplementary` | false | false | 1 | 1 | Yes |
| `unassigned` | false | false | 1 | 1 | Yes |
| `unicode-assigned-16` | true | true | 0 | 0 | Yes |
| `unicode-combining-mark` | true | true | 0 | 0 | Yes |
| `unicode-variation-selector` | true | true | 0 | 0 | Yes |
| `unicode-visible` | true | true | 0 | 0 | Yes |
