Upload README.md with huggingface_hub
Browse files15 unmodified lines1617181920212223242526272829303132333435363738394041424344454610 unmodified lines575859606162636465666768697071727315 unmodified linesconsensus + 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 |## InputFour 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```## OutputOne of `PASS`, `REVIEW`, `FAIL`, with the tree's class probability as`confidence`. That confidence is **not** calibrated.## Policy10 unmodified linespost-check that forces `REVIEW` on any tree/policy mismatch — keep it if youdeploy this model.## Usage```pythonimport joblibb = 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())]15 unmodified lines1617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666710 unmodified lines787980818283848586878889909192939495969715 unmodified linesconsensus + 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 featuresFour numeric features, **in this exact order**:```1. a1_high_risk # 1.0 if agent1_score >= 0.31832. a2_vulnerable # 1.0 if agent2_score >= 0.453. a1_risk_ratio # agent1_score / 0.31834. 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 `REVIEW` directly.## OutputRaw: `predict_proba(x)` returns probabilities for `["FAIL", "PASS", "REVIEW"]`(the bundle's `classes` order). Take `argmax` for the verdict and `max` forconfidence.Reference wrapper output:```json{"verdict": "FAIL", "confidence": 1.0, "status": "ok", "reason": "both agents flagged risk"}````confidence` is the tree's class probability, **not** calibrated.## Policy10 unmodified linespost-check that forces `REVIEW` on any tree/policy mismatch — keep it if youdeploy this model.Note: the saved `source_thresholds` fallback still lists Agent 2 as `0.51` froman earlier run. Pass the current thresholds explicitly (`0.3183` / `0.45`).## Usage```pythonimport joblibb = joblib.load("model.joblib")a1_high = a1_score >= 0.3183a2_high = a2_score >= 0.45x = [[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())]
README.md+43-19