Downloads · 30 days
0
sarel/creditscope-hybrid-risk-engine
creditscope-hybrid-risk-engine is a machine learning model from sarel. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Three-layer runtime safety classifier wired into the CreditScope chat pipeline.
Downloads · 30 days
0
Access
Public
Updated Apr 23, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py59.4 KB · 95%
From the Hugging Face model README
Three-layer runtime safety classifier wired into the CreditScope chat pipeline.
| Layer | File | What it does |
|---|---|---|
| Feature | circuit_integration.py → _classify_safety() | LogReg on 4K SAE features (layer 39) |
| Intent | backend/agent/risk/pattern_rules.py | Rule-based evasion / roleplay / exploit-tail / pure-financial detectors |
| Response | backend/agent/risk/response_guard.py | Pattern banks for bypass, concealment-fraud, procedural steps, secrets, injection |
| Blend | backend/agent/risk/risk_engine.py | Weighted sum + four rule overrides → 0-1 score + categorical verdict |
CLEAN · BORDERLINE · SUSPICIOUS · HIGH_RISK
circuit_integration.py::_run_fast_analysis() calls _classify_safety() (LogReg),
then immediately calls compute_final_risk() to produce the hybrid verdict.
The result replaces safety.verdict and safety.adversarial_probability in the
response the frontend reads — no frontend changes needed.
< 1 ms overhead (pure stdlib regex + weighted arithmetic).
Model inference performance is unaffected — the hook runs post-inference on CPU.
sarel/credit-cyber-4k-features — SAE checkpoints + trained LogReg classifiersarel/creditscope-circuit-models — circuit tracer models