Repository navigation
docs: propose decision models as an escalate-only shell gate - #453
Merged
Merged
Conversation
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]>
5 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
docs/proposals/decision-models.md: a draft, evaluated proposal for an opt-in, escalate-only second opinion on shell commands thatcommand-riskratesSafe. 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
command-riskpassed 54/58 should-prompt bash commands and 26/29 should-prompt PowerShell/cmdcommands at the default threshold (scripts, piped installers, interpreters with-c, remote CLIs, persistence, exfiltration).provider.onlyhonoured,zdrnot narrowing), local Ollama/v1/systemone.Importantapproval mode.systemoneclient with per-endpoint adapters, fail-to-today's-behaviour, off by default, last human-authored request only, redaction (including URL-encoded values), UI surfaces (/decisiondialog, 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
🤖 Generated with Claude Code