The model combines raw text embeddings with hand-crafted features:
Entropy: Shannon entropy of value and key
Length: value length, key length, line length
Key patterns: ALL_CAPS, contains SECRET/KEY/TOKEN/PASSWORD, word count
Value patterns: hex, base64, UUID, IP, URL, numeric, boolean, common word
API prefixes:sk_live_, ghp_, AKIA, hf_, npm_, etc.
Special formats: private key, JWT, @ in value, mixed case, digit/alpha ratios
Benchmark Results
Overall Performance
Benchmark Overview
Metric
ONNX FP32
ONNX INT8
Accuracy
99.62%
99.62%
Precision
100.00%
100.00%
Recall
98.92%
98.92%
F1 Score
99.46%
99.46%
Accuracy by Category
Category Accuracy
21 of 22 categories at 100%. The only miss: 1 of 4 connection strings misclassified (the model needs @ + password patterns in URIs to be more distinctive).
Latency Analysis
Latency Analysis
ONNX FP32
ONNX INT8
Mean
0.84ms
0.77ms
p50
0.83ms
0.75ms
p95
1.08ms
0.98ms
p99
1.37ms
1.10ms
Runs on Modest Hardware
Tested on potato — an Intel i3-6100 @ 3.70GHz, 8GB RAM, no GPU, Debian 13.
potato Results
potato Overview
Metric
ONNX FP32
ONNX INT8
Accuracy
99.62%
99.62%
Latency (mean)
1.04ms
0.91ms
Throughput
973 l/s
1,102 l/s
potato Latency
Same accuracy, same model, <1ms on a 2015 i3. No GPU needed.
potato Summary
Quick Start
ONNX (recommended)
pip install onnxruntime transformers
python
1import onnxruntime as ort
2import numpy as np
3from transformers import AutoTokenizer
45# Load6session = ort.InferenceSession("keizen1_int8.onnx")7tokenizer = AutoTokenizer.from_pretrained("keizen1")89defpredict(line):10 enc = tokenizer(line, max_length=64, padding="max_length",11 truncation=True, return_tensors="np")12 feats = compute_features(line)# see benchmark.py13 fv = np.array([[feats[k]for k in FEATURE_NAMES]], dtype=np.float32)1415 logits = session.run(None,{16"input_ids": enc["input_ids"].astype(np.int64),17"attention_mask": enc["attention_mask"].astype(np.int64),18"features": fv,19})[0]2021 probs = np.exp(logits)/ np.exp(logits).sum(axis=1, keepdims=True)22 pred =int(np.argmax(probs))23return{24"label":["NON_SENSITIVE","SECRET"][pred],25"confidence":float(probs[0][pred]),26"is_secret": pred ==1,27}2829# Usage30predict("PORT=3000")31# {'label': 'NON_SENSITIVE', 'confidence': 0.9991, 'is_secret': False}3233predict("STRIPE_API_KEY=sk_live_51Nzabc123...")34# {'label': 'SECRET', 'confidence': 0.9847, 'is_secret': True}
PyTorch / SafeTensors
python
1from transformers import AutoTokenizer, AutoModel
2import torch
34model = KeiZen1.from_pretrained("keizen1")# see notebook for class definition5tokenizer = AutoTokenizer.from_pretrained("keizen1")
Files
File
Size
Description
keizen1_int8.onnx
4.3 MB
Recommended — quantized, fastest on CPU
keizen1.onnx
16.8 MB
Full precision ONNX
keizen1/model.safetensors
16.8 MB
SafeTensors (HuggingFace ecosystem)
keizen1/config.json
1 KB
Model config & feature names
keizen1/tokenizer.json
712 KB
BERT tokenizer
Training
Synthetic Data (24K .env lines)
|
v
Feature Engineering (29 features + tokenizer)
|
v
Train/Val Split (80/20 stratified)
|
v
Fine-tune (8 epochs, LR=3e-5)
|
v
Best checkpoint (F1=0.995)
|
+---> SafeTensors (16.8 MB)
+---> ONNX FP32 (16.8 MB)
+---> ONNX INT8 (4.3 MB)
The model was trained on 24,000 synthetic .env lines (12K SECRET + 12K NON_SENSITIVE):
Secrets: 100+ API key patterns (Stripe, AWS, GitHub, OpenAI, etc.), JWT tokens, passwords, private keys, DB connection strings, high-entropy strings
KeiZen 1
|
+---------+-------+-------+---------+
| | | |
v v v v
CI/CD Pre-commit Code Review Container
Pipeline Hook Bot Scanner
| | | |
v v v v
Block .env Local git PR comment Docker inspect
push if hook scans flags env variables
secrets before commit exposed keys
found
CI/CD pipelines: Scan .env files before git push
Code review: Detect secrets in pull requests
Secret scanning: Audit configuration files
Pre-commit hooks: Block accidental secret commits
Container scanning: Check environment variables in Docker configs