Skip to content

docs: propose decision models as an escalate-only shell gate - #453

Merged
mrnasil merged 2 commits into
mainfrom
docs/decision-models-proposal
Nov 15, 2026
Merged

mrnasil merged 2 commits into
mainfrom
docs/decision-models-proposal

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds docs/proposals/decision-models.md: a draft, evaluated proposal for an opt-in, escalate-only second opinion on shell commands that command-risk rates Safe. Decision models (Cloudflare Clef, TypeSafe Jev, Perplexity decider, …) answer typed questions (noul / choice / score) with probabilities rather than text, so the gate compares a number against a threshold.

No code changes.

What the document covers

  • Gap: command-risk passed 54/58 should-prompt bash commands and 26/29 should-prompt PowerShell/cmd commands at the default threshold (scripts, piped installers, interpreters with -c, remote CLIs, persistence, exfiltration).
  • Accuracy: eleven models on a 124-command labelled corpus; out-of-sample recall 0.87–0.95 at ~3.5 % false escalation for the top models. Thresholds transferred to the PowerShell corpus without retuning.
  • Follow-ups: script bodies (decisive), prompt injection in script bodies (3 cases, no flip), Turkish requests (same outcomes), repeatability, long bodies (no truncation up to ~11.5k tokens), provider routing (provider.only honoured, zdr not narrowing), local Ollama /v1/systemone.
  • Real traffic: synthetic-corpus thresholds over-prompt roughly ten-fold on real shell traffic (Clef 5 % of calls). Phase 1 must calibrate on real traffic to a target prompt rate and run only in Important approval mode.
  • Design decisions: generic systemone client with per-endpoint adapters, fail-to-today's-behaviour, off by default, last human-authored request only, redaction (including URL-encoded values), UI surfaces (/decision dialog, reason in the permission dialog, footer status, picker guard).

Not yet verified

Direct Workers AI call (token returned 401) and real-traffic prompt rates for models other than Clef / Clef-flash. Listed in the document.

Test plan

  • Docs-only change; no Rust or manifests touched.
  • CI green.

🤖 Generated with Claude Code

Draft proposal, with live measurements, for an opt-in second opinion on
shell commands the deterministic command-risk classifier rates Safe.
Decision models (Clef, Jev, Perplexity decider and others) answer typed
questions with probabilities instead of text, so a gate can compare the
answer against a threshold.

The evaluation covers a labelled bash corpus and a PowerShell/cmd corpus
across eleven models, script bodies, prompt injection, Turkish requests,
repeatability, provider routing, a local Ollama backend, and real
session traffic. Main findings: command-risk passes most should-prompt
commands as Safe; models reach 0.87-0.95 recall at ~3.5% false
escalation on the corpus; thresholds calibrated on a synthetic corpus
over-prompt about ten-fold on real traffic, so phase 1 must calibrate on
real traffic and run only in Important approval mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mrnasil
mrnasil merged commit cb6b287 into main Nov 15, 2026
7 checks passed
@mrnasil
mrnasil deleted the docs/decision-models-proposal branch November 15, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant