ProjectsHome

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:
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.
— me, in a totally very real interview

by the numbers:

  • < 5 msto screen an output (p95)
  • 0%of safe outputs blocked
  • ~100×faster than ML safety classifiers

how it works:

  1. 01

    Intent phrases

    Looks for verbs that show an intent to do harm, not only the presence of key words.

  2. 02

    Structural patterns

    Regex for leaked personal data (SSNs, API keys, credit cards, passwords) and the shape of dangerous instructions.

  3. 03

    Shannon entropy

    Flags high-entropy strings, the fingerprint of leaked secrets, tokens, and hashes.

  4. 04

    N-gram overlap

    Compares character 4-grams against protected text, like a system prompt, to catch it being repeated back.

  5. 05

    Refusal classification

    Reads the whole answer to tell when the model refused, with adaptive thresholds that catch soft refusals too.

  6. 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)

next up: