Agent 3 β Verdict Gatekeeper (Decision Tree)
Decision tree that turns two agent scores into a final verdict using a consensus + fail-safe policy. Part of a three-agent DevSecOps auditor (metrics β transformer β gatekeeper).
Model details
| Field | Value |
|---|---|
| Version | 1.0.0 (initial release) |
| Artifact | model.joblib (bundle: model, feature_cols, classes, policy, source_thresholds) |
| Task | 3-class tabular classification |
| Classes | FAIL, PASS, REVIEW |
| Own threshold | None β uses the upstream agent thresholds |
| Upstream thresholds | Agent 1 0.3183, Agent 2 0.45 |
| Training data | Synthetic policy grid, seed 42 |
| Dataset version | Generator v1 β 45 ratios Γ 45 ratios Γ 4 quadrants = 8,100 rows |
metadata.json mirrors the policy, features, grid, and thresholds.
Input features
Four numeric features, in this exact order:
1. a1_high_risk # 1.0 if agent1_score >= 0.3183
2. a2_vulnerable # 1.0 if agent2_score >= 0.45
3. a1_risk_ratio # agent1_score / 0.3183
4. a2_risk_ratio # agent2_score / 0.45
Preprocessing
- Compute the two flags with the upstream thresholds above.
- Compute the two ratios as
score / threshold(1.0 = exactly at the boundary). - Keep the column order shown above; it must match
b["feature_cols"]. - On any error, missing value, or invalid score, output
REVIEWdirectly.
Output
Raw: predict_proba(x) returns probabilities for ["FAIL", "PASS", "REVIEW"]
(the bundle's classes order). Take argmax for the verdict and max for
confidence.
Reference wrapper output:
{"verdict": "FAIL", "confidence": 1.0, "status": "ok", "reason": "both agents flagged risk"}
confidence is the tree's class probability, 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 encodes
the policy rather than learning from ground truth. The reference wrapper adds a
post-check that forces REVIEW on any tree/policy mismatch β keep it if you
deploy this model.
Note: the saved source_thresholds fallback still lists Agent 2 as 0.51 from
an earlier run. Pass the current thresholds explicitly (0.3183 / 0.45).
Usage
import joblib
b = joblib.load("model.joblib")
a1_high = a1_score >= 0.3183
a2_high = a2_score >= 0.45
x = [[float(a1_high), float(a2_high),
a1_score / 0.3183, a2_score / 0.45]]
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.