Upload folder using huggingface_hub
Browse filesFiles changed (3)
- README.mdAdded+79
- metadata.jsonAdded+29
- model.joblibAdded+3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879---license: otherlibrary_name: scikit-learnpipeline_tag: tabular-classificationtags: - cybersecurity - gatekeeper - decision-tree - scikit-learn - joblib---
# Agent 3 — Verdict Gatekeeper (Decision Tree)
Decision tree that turns two agent scores into a final verdict using aconsensus + fail-safe policy. Part of a three-agent DevSecOps auditor(metrics → transformer → gatekeeper).
> For a Hugging Face repo, upload this file as `README.md` alongside> `agent3_dt.joblib` and `agent3_dt.meta.json`.
## Files
| File | Contents ||---|---|| `agent3_dt.joblib` | `model`, `feature_cols`, `classes`, `policy`, `source_thresholds` || `agent3_dt.meta.json` | Policy, features, grid size, agreement, thresholds |
## Input
Four features per sample:
```a1_high_risk # 1.0 if agent1_score >= agent1_thresholda2_vulnerable # 1.0 if agent2_score >= agent2_thresholda1_risk_ratio # agent1_score / agent1_thresholda2_risk_ratio # agent2_score / agent2_threshold```
## Output
One of `PASS`, `REVIEW`, `FAIL`, with the tree's class probability as`confidence`. That confidence is **not** calibrated.
## Policy
| Agent 1 | Agent 2 | Verdict ||---|---|---|| low risk | not vulnerable | `PASS` || high risk | vulnerable | `FAIL` || high risk | not vulnerable | `REVIEW` || low risk | vulnerable | `REVIEW` || any error / missing / invalid input | | `REVIEW` |
The tree is trained on a synthetic grid labelled by this policy, so it encodesthe policy rather than learning from ground truth. The reference wrapper adds apost-check that forces `REVIEW` on any tree/policy mismatch — keep it if youdeploy this model.
## Usage
```pythonimport joblib
b = joblib.load("agent3_dt.joblib")
a1_high = a1_score >= a1_thresholda2_high = a2_score >= a2_thresholdx = [[float(a1_high), float(a2_high), a1_score / a1_threshold, a2_score / a2_threshold]]
proba = b["model"].predict_proba(x)[0]verdict = b["classes"][int(proba.argmax())]confidence = float(proba.max())```
## License
Not specified. Update the `license` field before publishing.1234567891011121314151617181920212223242526272829{ "policy": "consensus_fail_safe", "features": [ "a1_high_risk", "a2_vulnerable", "a1_risk_ratio", "a2_risk_ratio" ], "classes": [ "FAIL", "PASS", "REVIEW" ], "max_depth": 3, "seed": 42, "grid": { "ratio_min": 0.0, "ratio_max": 2.0, "ratios": 45, "rows": 8100 }, "policy_agreement": 1.0, "train_accuracy": 1.0, "source_thresholds": { "agent1": 0.3182926377275692, "agent2": 0.5099999999999998 }, "note": "Synthetic policy grid; the tree encodes the consensus policy, not ground-truth verdicts."}123version https://git-lfs.github.com/spec/v1oid sha256:f5508cbc56b41660f0fbc2e6eea7f9caf9612ae511084b956fd2c17eb179b083size 2244README.mdAdded+79
metadata.jsonAdded+29
model.joblibAdded+3