shipped · Dec 2025 – Mar 2026
TokenFind
A rule-based safety critic that screens LLM outputs in under 5 ms using entropy, n-gram analysis, and pattern matching, with no machine learning.
- built with:
- PythonRule-based text processing
- team:
- Independent research
- links:
- GitHubRead the paper
My code needs to run the fastest it can run, because that’s essentially why we made code. TokenFind runs in under 5 milliseconds, and I still think about shaving it down.
by the numbers:
- < 5 msto screen an output (p95)
- 0%of safe outputs blocked
- ~100×faster than ML safety classifiers
how it works:
- 01
Intent phrases
Looks for verbs that show an intent to do harm, not only the presence of key words.
- 02
Structural patterns
Regex for leaked personal data (SSNs, API keys, credit cards, passwords) and the shape of dangerous instructions.
- 03
Shannon entropy
Flags high-entropy strings, the fingerprint of leaked secrets, tokens, and hashes.
- 04
N-gram overlap
Compares character 4-grams against protected text, like a system prompt, to catch it being repeated back.
- 05
Refusal classification
Reads the whole answer to tell when the model refused, with adaptive thresholds that catch soft refusals too.
- 06
Output only
It never sees the prompt or the conversation, it’s completely blind to context (so it’s unsusceptible to bias/social engineering)
