hen my secrets detector evaluates a candidate string, it doesn't see code.
It sees a vector of 26 numbers.
That vector is the bridge between human intuition — "this looks like a secret" — and machine classification. Every insight a security engineer uses when reading code to spot exposed credentials has been translated into a numerical feature that the Random Forest classifier can reason about.
This article is a complete walkthrough of those 26 features: what each one measures, why it matters, what it catches, and what it misses. By the end, you'll understand exactly what the model sees when it evaluates any candidate value — and why the combination of features catches things that no single signal could.
How Feature Extraction Works
Before the classifier sees anything, every candidate string goes through a feature extraction pipeline in features.py .…