feat(guardrails): propose, apply accepted fixes, re-pass to prove them
After the report the skill proposes fixes (plan phase), stops for the user's acceptance, applies accepted ones via bugfixer and the verify-secure gates, then re-scans. scan.py gains --assert-absent (contract oracle, positive control) and --baseline (no new hit).
This commit is contained in:
1 parent
b17de15c22
commit
73c25d759e
14 files changed
+382
-29
No files matched your search
+1
-1
@@ -7,7 +7,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- **Secure-by-default guardrails**: `rules/secure-by-default.md` (always on) makes five domains baseline on every project, plus systematic API and access hygiene (auth on every route, CORS, secrets, passwords hashed with argon2id or bcrypt, never compared in clear, logged or hardcoded): hosting (rate limit, CDN and firewall, hard spend cap), accessibility (keyboard, visible focus, alt text, field labels), Supabase (RLS on every table, owner-scoped policies, no service role key client-side), SMS and email (recorded consent, unsubscribe, STOP), cloud functions (no self-trigger, instance cap, budget stop). `/guardrails` audits them: a stdlib Python scanner (`skills/guardrails/scripts/scan.py`, FAIL / WARN / MANUAL, exit 1 on FAIL) then judgment, report in `.claude/audits/GUARDRAILS.md`. The security-auditor gate runs the scanner's `api` and `supabase` domains and blocks on FAIL. Items only a provider dashboard can set stay MANUAL, never claimed done. An optional read-only live probe (`skills/guardrails/scripts/probe.py`, `--live`) confirms a finding from outside on a target the user owns and names: anon-read, cross-user, no-auth route, CORS reflection and a capped rate-limit burst, verdicts OPEN / CLOSED / SKIPPED / ERROR. It sends GET, HEAD and OPTIONS only (one opt-in POST burst, capped at 25), requires `--authorized`, takes secrets from the environment never the command line, never follows a redirect to another host, and stops at a request budget. Suites: `lib/tests/guardrails-scan.test.sh` (clean fixture plus one mutant per rule) and `lib/tests/guardrails-probe.test.sh` (probe logic against a localhost fixture server).
|
||||
- **Secure-by-default guardrails**: `rules/secure-by-default.md` (always on) makes five domains baseline on every project, plus systematic API and access hygiene (auth on every route, CORS, secrets, passwords hashed with argon2id or bcrypt, never compared in clear, logged or hardcoded): hosting (rate limit, CDN and firewall, hard spend cap), accessibility (keyboard, visible focus, alt text, field labels), Supabase (RLS on every table, owner-scoped policies, no service role key client-side), SMS and email (recorded consent, unsubscribe, STOP), cloud functions (no self-trigger, instance cap, budget stop). `/guardrails` audits them: a stdlib Python scanner (`skills/guardrails/scripts/scan.py`, FAIL / WARN / MANUAL, exit 1 on FAIL) then judgment, report in `.claude/audits/GUARDRAILS.md`. The security-auditor gate runs the scanner's `api` and `supabase` domains and blocks on FAIL. Items only a provider dashboard can set stay MANUAL, never claimed done. An optional read-only live probe (`skills/guardrails/scripts/probe.py`, `--live`) confirms a finding from outside on a target the user owns and names: anon-read, cross-user, no-auth route, CORS reflection and a capped rate-limit burst, verdicts OPEN / CLOSED / SKIPPED / ERROR. It sends GET, HEAD and OPTIONS only (one opt-in POST burst, capped at 25), requires `--authorized`, takes secrets from the environment never the command line, never follows a redirect to another host, and stops at a request budget. After the report, `/guardrails` proposes fixes (plan phase, so Fable when the router can switch), applies only the ones the user accepts through the `bugfixer` executor and the `lib/verify-secure-loop.md` gates, then re-scans: each accepted fix is a contract criterion whose oracle is the scanner (`--assert-absent RULE:path`, marker `GUARDRAILS-CLEAR`), and a full pass against the pre-fix baseline (`--baseline`, marker `GUARDRAILS-NO-NEW`) catches regressions; a live probe replays on the user's go; two rounds at most, residuals reported open; `--report-only` keeps the audit alone. Suites: `lib/tests/guardrails-scan.test.sh` (clean fixture plus one mutant per rule, check modes, `gates.sh` integration) and `lib/tests/guardrails-probe.test.sh` (probe logic against a localhost fixture server).
|
||||
- **model-router mod**: `mods/model-router/`, a Claude Code mod (function-hooks plugin), routes every repo skill and agent from phase rows (`plan`, `reflect`, `orchestrate`, `escalate`, `judge`, `implement`, `write`, `verify`, `explore`, `apply`, `mechanical`; built-ins Explore on sonnet/medium, Plan on opus/xhigh). A typed skill routes the main loop to its row, and a best-tier row holds across turns in a run slot until `/route clear`, `/route off`, a user `/model` or a typed skill on a non-best row. Agents get their row's model at spawn (within the tier, upward only) and its effort on every step; explicit Agent params win. Orchestrators declare their phases through the `mcp__model-router__route` tool. `ultrathink` in a prompt sets the turn's minimum effort and `/route effort=max` holds until `/route clear`; the built-in `/effort` is not a lever inside a run. `/route show` names the run slot (`main: run <phase>`), and a `null` row in the override drops a default row. The model gets a `route` tool and the user a `/route` command (`show|clear|off|on|reload|pending|ask on|off|forget <name|all|projects>|<phase>|model=<alias|id> effort=<level>|switch on|off|verbose on|off`). Optional per-machine config `~/.claude/model-router.json`, where `"enabled": false` turns it off on that machine. The spinner suffix and the status line show the route in force. It loads in every session through the tracked symlink `skills/model-router` (`model-router@skills-dir`). `make doctor` gains a Mods section; suite `make test suite=lib/tests/mods.test.sh`. Known limits: a main-loop switch runs only while the cold read it costs (the context minus what the target model's prompt cache holds) fits `upgradeMaxTokens` (200000) or `downgradeMaxTokens` (120000), and a downgrade also needs `mainModelSwitch` (on by default, off on any non-boolean value); the hooks send full model ids, so the `models` table has to follow new versions.
|
||||
- **model-router first-use confirmation**: `mods/model-router/routing.json` (tracked) is the single source of the phase table and of every skill and agent row, and keeps the decisions: `confirmed`, `changed` (`from`/`to`), `projects` exceptions keyed by the origin remote reduced to `host/path` (credentials and local paths never stored), and `ask`. The first use of a rowed typed skill, a rowed agent spawn or a main-loop phase declared through the `route` tool opens a dialog with context: the skill's description (first sentence of its `SKILL.md` frontmatter) or the agent's, the phase with its `about` line (a new field on each of the 11 phases) and the model id and effort the next step really runs on. A row offers Later, Keep or Change; a main-loop phase Later or Keep. Change asks the model (fable, opus, sonnet, haiku with their tier), then the effort among those the phases of that model use (skipped when there is only one), then Everywhere or This project only; the pair maps to an existing phase (rows stay phase names, the same phase counts as Keep, a pair no phase offers is added by hand as a new phase). A skill-row change toasts the model and effort it now runs on, with the `/route switch on` hint when the main loop holds back a downgrade; a free-text answer counts as Later. One dialog at a time, never in headless (`-p`) runs or inside a sub-agent. Only a dialog answer, `/route ask on|off` or `/route forget` (which takes decisions back; a changed row returns to its shipped phase, the frontmatter floors stay yours to realign) writes the file (serialized, 64 KiB cap, never created when absent); each write asks you to commit it from the config repo. `/route pending` lists unconfirmed rows and phases. Layers: routing.json < `~/.claude/model-router.json` (its `ask` wins); a project's `.claude/model-router.json` is never read. Tests: `mods/model-router/hooks/register.test.ts`.
|
||||
- **Manual-push mode**: `git config gitflow.autopush false` (human-set) now stops every push the gitflow lib makes, not only the post-commit / post-merge hooks. `gitflow start` and `finish` branch, commit and merge locally and push nothing; `gitflow delete` leaves the `origin/` copy in place and prints `git push origin --delete <br>` for the user to run. `hooks/unpushed-guard.sh` stays silent at turn end in this mode and opens each session with one `ℹ manual push mode:` line counting the commits no remote holds across every local branch; an unparseable or unreadable `gitflow.autopush` value is treated as manual push mode too, and that line names it. `hooks/push-guard.sh` (PreToolUse, `Bash|Monitor`) refuses any `git push` Claude types while `gitflow.autopush` reads false in the session cwd or in a literal `-C`/`cd` directory the command names (global config counts outside a repo); the refusal tells the user to run it with `! git push`. It reads the mode through the same lib verb as every other reader and fails closed: an unparseable or unreadable value reads as manual, and an internal error, a missing `lib/gitflow.sh`, more than 20 distinct directory tokens in one command (capped before any token is classified), a `cd`/`-C` directory token mixing quoted and unquoted parts, or a payload jq cannot parse whose raw text looks like a push refuse the push (these pathological cases fire in auto mode too). Directory tokens are read as whole shell words, adjacent quoted segments and backslash escapes included. Once the text looks like a push, the command is split into simple commands (quotes, escapes, separators, heredoc bodies dropped) and a push must be git's own subcommand in one of them: `grep "git push"`, `git log -S "git push"`, `git config --get push.default`, `git stash push`, a heredoc quoting a push or a commit message naming one are allowed; `bash -c` scripts are re-checked, wrappers (`sudo`, `env`, `eval`, `xargs`, `timeout`, `git subtree`...) and assignments keep the text verdict. The misses listed in its header fall to a new `autoMode.soft_deny` rule that no request in the turn clears. The session banner adds `🔒 push : manual (autopush=false) — ! git push` when the key reads false, and `🔒 push : manual (autopush bad) — ! git push` when the value is invalid. Skills read the mode through a new lib verb, `bash ~/.claude/lib/gitflow.sh push-mode`: it prints `auto`, `manual` or `invalid` (rc 0) and names an invalid value on stderr (printable characters only, 64 at most). It is the one reader a skill may call, since the `git config` read of the key is denied to Claude. Skills push nothing on their own, except the `/release-candidate` tag in auto-push mode on an explicit go. Every "on origin" or "not pushed" line they print comes from `git rev-list --count origin/<br>..<br>` read after the fact, with the complete `! git …` command when something is left for the user to push. An invalid value (anything but unset, true or false, or a read that fails) is manual push mode for every reader and is named where it is read (see Fixed). Tests: `lib/gitflow-test.sh` T11b (push-mode verb), T18m and T18q blocks, `lib/tests/unpushed-guard.test.sh` T10-T16, `lib/tests/push-guard.test.sh` (98 checks).
|
||||
|
||||
@@ -228,7 +228,7 @@ a different package, ships its own conflicting `graphify` bin) — see
|
||||
| `/reconcile` | Confront declared status (TODO, registries) against real git/fs state — surface stale items |
|
||||
| `/pdf-translate` | Translate a PDF to another language, output as HTML (via Vision) |
|
||||
| `/explain-diff` | Explain a diff, commit, branch or PR as one self-contained HTML page (background, intuition, code walkthrough, 5-question quiz), saved outside the repo |
|
||||
| `/guardrails` | Audit the five baseline guardrails (hosting, a11y, Supabase RLS, SMS/email consent, cloud functions) plus API hygiene (auth, CORS, secrets, password storage): deterministic scanner, then judgment, report in `.claude/audits/GUARDRAILS.md`. `--live <url you own>` adds a read-only probe that confirms a hole from outside |
|
||||
| `/guardrails` | Audit the five baseline guardrails (hosting, a11y, Supabase RLS, SMS/email consent, cloud functions) plus API hygiene (auth, CORS, secrets, password storage): deterministic scanner, then judgment, report in `.claude/audits/GUARDRAILS.md`. Then proposes fixes, applies the ones you accept and re-scans to prove each one. `--live <url you own>` adds a read-only probe that confirms a hole from outside |
|
||||
| `/close` | End-of-session ritual — alias for `/capitalize --ritual` (dedup + TODO reconcile + 3-question reflection) |
|
||||
| `/harden` | Web hardening audit — HTTPS/TLS, HSTS, CSP, security headers |
|
||||
| `/web-validate` | W3C HTML/CSS validity + WCAG 2.1 accessibility audit |
|
||||
|
||||
@@ -120,7 +120,7 @@ Tu veux...
|
||||
| Livraison client finale | `/client-handover` |
|
||||
| Traduire un PDF | `/pdf-translate` |
|
||||
| Comprendre un changement pas suivi | `/explain-diff` |
|
||||
| Auditer garde-fous (RLS, a11y, consentement, fonctions, mots de passe) | `/guardrails` |
|
||||
| Auditer garde-fous (RLS, a11y, consentement, fonctions, mots de passe) puis corriger | `/guardrails` |
|
||||
| Sonder le projet en direct (lecture seule, cible à toi) | `/guardrails --live <url>` |
|
||||
| Changer profil skills | `/profile` |
|
||||
| Audit/polish design (anti-slop) | `/impeccable` |
|
||||
@@ -165,7 +165,7 @@ Tu veux...
|
||||
| `/client-handover` | Livraison client | Audits finaux + livrable brandé |
|
||||
| `/pdf-translate` | Traduire un PDF vers une autre langue | Sortie HTML fidèle (images, layout, style préservés) |
|
||||
| `/explain-diff` | Comprendre un commit, une branche ou une PR qu'on n'a pas suivis | Page HTML autonome hors du repo : contexte, intuition, code, quiz de 5 questions |
|
||||
| `/guardrails` | Vérifier hébergement, a11y, Supabase RLS, consentement SMS/email, fonctions cloud, stockage des mots de passe | Scanner déterministe puis jugement ; rapport `.claude/audits/GUARDRAILS.md` ; `--live <url à toi>` sonde en lecture seule |
|
||||
| `/guardrails` | Vérifier hébergement, a11y, Supabase RLS, consentement SMS/email, fonctions cloud, stockage des mots de passe | Scanner déterministe, jugement, rapport `.claude/audits/GUARDRAILS.md`, propositions de correction à valider, re-passe qui prouve chaque correction ; `--live <url à toi>` sonde en lecture seule |
|
||||
| `/impeccable` | Audit/polish design + détecteur anti-slop déterministe | 23 verbes ; `npx impeccable detect` (exit 0/2) |
|
||||
| `/tour` | Sweep groupé sur un ou plusieurs projets | Sécu + nettoyage + reconcile + doc, boucle jusqu'à un pass propre |
|
||||
| `/route` | Voir ou fixer la route du mod model-router | show / clear / off / on / reload / pending / ask on\|off / <phase> / model=… effort=… / switch on\|off / classify on\|off (classifieur de prompt) / verbose on\|off (transitions seules) |
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: bugfixer
|
||||
description: Bug-fix EXECUTOR — dispatched by /bugfix with a closed DIAGNOSIS + FIX PLAN + contract. Applies the fix and a regression test, runs the suite, reports. No investigation, no questions, no commit.
|
||||
description: Bug-fix EXECUTOR — dispatched by /bugfix (or /guardrails for accepted fixes) with a closed DIAGNOSIS + FIX PLAN + contract. Applies the fix and a regression test, runs the suite, reports. No investigation, no questions, no commit.
|
||||
tools: Read, Edit, Write, Bash, Grep, Glob
|
||||
model: sonnet
|
||||
effort: medium
|
||||
|
||||
@@ -114,7 +114,7 @@ Template:
|
||||
|
||||
```markdown
|
||||
# CONTRACT — <slug>
|
||||
- date: <YYYY-MM-DD> | flow: <ship-feature|feat|bugfix|hotfix|init-project|onboard> | branch: <branch>
|
||||
- date: <YYYY-MM-DD> | flow: <ship-feature|feat|bugfix|hotfix|init-project|onboard|guardrails> | branch: <branch>
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
|
||||
@@ -252,6 +252,66 @@ LAST_OUT=$(scan "$WORK/tx-bulk")
|
||||
check "a subscribers table makes the same senders fail" \
|
||||
"$(has FAIL MSG-NO-CONSENT-RECORD)" yes
|
||||
|
||||
echo "== check modes (contract oracle and re-pass baseline)"
|
||||
IMG="A11Y-IMG-ALT:$TSX"
|
||||
cp -R "$GOOD" "$WORK/cm"; edit "$WORK/cm/$TSX" 's/ alt="Company logo"//'
|
||||
out=$(scan "$WORK/cm" --assert-absent "$IMG"); rc=$?
|
||||
check "positive control: the oracle fails while the hit is there" "$rc" 1
|
||||
check "a failing oracle never prints the marker" \
|
||||
"$(printf '%s\n' "$out" | grep -c GUARDRAILS-CLEAR)" 0
|
||||
out=$(scan "$GOOD" --assert-absent "$IMG"); rc=$?
|
||||
check "the oracle passes once the hit is gone" "$rc" 0
|
||||
check "a passing oracle prints the marker" \
|
||||
"$(printf '%s\n' "$out" | grep -c '^GUARDRAILS-CLEAR 1$')" 1
|
||||
out=$(scan "$GOOD" --domain api --assert-absent "$IMG"); rc=$?
|
||||
check "an unscanned domain proves nothing" "$rc" 1
|
||||
check "the control failure is named" \
|
||||
"$(printf '%s\n' "$out" | grep -c '^ CONTROL ')" 1
|
||||
mkdir "$WORK/cm-empty"
|
||||
scan "$WORK/cm-empty" --assert-absent "$IMG" >/dev/null
|
||||
check "an empty tree proves nothing" "$?" 1
|
||||
scan "$GOOD" --assert-absent HOST-SPEND-CAP:. >/dev/null 2>&1
|
||||
check "a MANUAL rule cannot be asserted (exit 2)" "$?" 2
|
||||
scan "$GOOD" --assert-absent A11Y-IMG-ALT >/dev/null 2>&1
|
||||
check "an item without a path is a usage error" "$?" 2
|
||||
scan "$WORK/cm" --json > "$WORK/cm-before.json"
|
||||
out=$(scan "$GOOD" --baseline "$WORK/cm-before.json"); rc=$?
|
||||
check "baseline lists the fixed hit" \
|
||||
"$(printf '%s\n' "$out" | grep -c '^ FIXED A11Y-IMG-ALT ')" 1
|
||||
check "baseline with no new hit exits 0 with the marker" \
|
||||
"$rc:$(printf '%s\n' "$out" | grep -c '^GUARDRAILS-NO-NEW$')" "0:1"
|
||||
scan "$GOOD" --json > "$WORK/clean-before.json"
|
||||
out=$(scan "$WORK/cm" --baseline "$WORK/clean-before.json"); rc=$?
|
||||
check "baseline lists a new hit" \
|
||||
"$(printf '%s\n' "$out" | grep -c '^ NEW A11Y-IMG-ALT ')" 1
|
||||
check "baseline with a new hit exits 1 without the marker" \
|
||||
"$rc:$(printf '%s\n' "$out" | grep -c GUARDRAILS-NO-NEW)" "1:0"
|
||||
printf 'not json' > "$WORK/bad.json"
|
||||
scan "$GOOD" --baseline "$WORK/bad.json" >/dev/null 2>&1
|
||||
check "an unreadable baseline exits 2" "$?" 2
|
||||
|
||||
# contract <dir> <file>: a fix contract whose oracle is the scanner itself
|
||||
contract() {
|
||||
cat > "$2" <<EOF
|
||||
# CONTRACT — guardrails-oracle-test
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. every image in the contact form has an alt
|
||||
CHECK: python3 -B '$SCAN' '$1' --assert-absent '$IMG'
|
||||
EXPECT: GUARDRAILS-CLEAR
|
||||
EVIDENCE: pending
|
||||
## FILE SCOPE
|
||||
$TSX
|
||||
EOF
|
||||
}
|
||||
contract "$WORK/cm" "$WORK/c-unfixed.md"
|
||||
bash "$ROOT/lib/gates.sh" run "$WORK/c-unfixed.md" >/dev/null 2>&1
|
||||
check "gates.sh: the oracle is UNMET before the fix" "$?" 2
|
||||
contract "$GOOD" "$WORK/c-fixed.md"
|
||||
bash "$ROOT/lib/gates.sh" run "$WORK/c-fixed.md" >/dev/null 2>&1
|
||||
check "gates.sh: the oracle is MET after the fix" "$?" 0
|
||||
check "gates.sh writes the evidence back" \
|
||||
"$(grep -c 'EVIDENCE: pending' "$WORK/c-fixed.md")" 0
|
||||
|
||||
echo "== cli"
|
||||
scan "$WORK/does-not-exist" >/dev/null 2>&1; check "bad path exits 2" "$?" 2
|
||||
scan --domain nope "$GOOD" >/dev/null 2>&1; check "bad domain exits 2" "$?" 2
|
||||
|
||||
@@ -14,6 +14,7 @@ BUG="$REPO/agents/bugfixer.md"
|
||||
BSK="$REPO/skills/bugfix/SKILL.md"
|
||||
HOT="$REPO/agents/hotfixer.md"
|
||||
HSK="$REPO/skills/hotfix/SKILL.md"
|
||||
GSK="$REPO/skills/guardrails/SKILL.md"
|
||||
HSKL="$REPO/skills/hotfix/SKILL.md"
|
||||
PASS=0; FAIL=0
|
||||
|
||||
@@ -69,6 +70,15 @@ tf "bug uses shared include" "$BSK" "lib/verify-secure-loop.md"
|
||||
tf "bug gate0 floor" "$BSK" "GATE 0 — deterministic floor"
|
||||
tf "bug dispatches bugfixer" "$BSK" 'subagent_type="bugfixer"'
|
||||
|
||||
echo "── skills/guardrails/SKILL.md (fix loop reuses the bugfix circuit) ──"
|
||||
tf "guardrails contract include" "$GSK" "lib/contract-interview.md"
|
||||
tf "guardrails uses shared include" "$GSK" "lib/verify-secure-loop.md"
|
||||
tf "guardrails dispatches bugfixer" "$GSK" 'subagent_type="bugfixer"'
|
||||
tf "guardrails scanner is the oracle" "$GSK" "EXPECT: GUARDRAILS-CLEAR"
|
||||
tf "guardrails positive control" "$GSK" "Positive control"
|
||||
tf "guardrails approval gate" "$GSK" "Nothing is applied without the user's explicit acceptance"
|
||||
tf "guardrails re-pass baseline" "$GSK" "GUARDRAILS-NO-NEW"
|
||||
|
||||
echo "── agents/bugfixer.md (bugfix executor — sonnet, no Agent) ──"
|
||||
tn "bugfixer lacks Agent tool" "$BUG" "Agent"
|
||||
tf "bugfixer model sonnet" "$BUG" "model: sonnet"
|
||||
|
||||
@@ -9,8 +9,8 @@ has() { if grep -qF "$2" "$R/$1"; then ok; else ko "$1 missing: $2"; fi; }
|
||||
lacks() { if grep -qF "$2" "$R/$1"; then ko "$1 must NOT contain: $2"; else ok; fi; }
|
||||
fm_lacks() { if awk 'NR<=10' "$R/$1" | grep -qF "$2"; then ko "$1 frontmatter must NOT contain: $2"; else ok; fi; }
|
||||
|
||||
# 1) gate wired in the 15 reflection skills (orchestrators + /analyze)
|
||||
for s in ship-feature init-project feat bugfix onboard seo geo web-validate harden audit-delta tour code-clean hotfix client-handover analyze; do
|
||||
# 1) gate wired in the 16 reflection skills (orchestrators, /analyze, /guardrails)
|
||||
for s in ship-feature init-project feat bugfix onboard seo geo web-validate harden audit-delta tour code-clean hotfix client-handover analyze guardrails; do
|
||||
has "skills/$s/SKILL.md" 'lib/model-gate.md'
|
||||
done
|
||||
# 2) gate NOT wired in the pure-execution/read-only skills (exclusion list)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Verify + secure loop — shared orchestrator include (feat, bugfix)
|
||||
# Verify + secure loop — shared orchestrator include (feat, bugfix, guardrails)
|
||||
|
||||
Runs in the ORCHESTRATOR MAIN LOOP after the dev step completes. Turns a
|
||||
finished diff into a verified, security-cleared change through two fresh
|
||||
|
||||
@@ -5,7 +5,7 @@ a cloud function or a UI. Applies at design, scaffolding, implementation and
|
||||
review. A request that breaks one of these gets flagged, not silently done.
|
||||
What only a provider dashboard can set (spend cap, WAF, budget alert) is
|
||||
never claimed done: write it as a manual step in the project's deploy notes.
|
||||
`/guardrails` audits all of it.
|
||||
`/guardrails` audits all of it and fixes what the user accepts.
|
||||
|
||||
## Every API and every access
|
||||
- Default deny. Authentication and authorization checked server-side on every
|
||||
|
||||
+153
-11
@@ -1,26 +1,36 @@
|
||||
---
|
||||
name: guardrails
|
||||
effort: high
|
||||
description: 'Use when auditing a project against the baseline guardrails: hosting (rate limit, CDN and firewall, spend cap), accessibility (keyboard, visible focus, alt text, field labels), Supabase (RLS on every table, owner-scoped policies, no service_role key client-side), SMS and email (recorded consent, unsubscribe, STOP), cloud functions (no self-trigger, instance cap, budget stop), plus API and access hygiene (auth on every route, CORS, secrets, password storage). Runs a deterministic scanner, judges each hit, writes .claude/audits/GUARDRAILS.md. Optional read-only live probe confirms a hole from outside on a target the user owns and names. Triggers: "guardrails", "garde-fous", "RLS activée ?", "audit supabase", "consentement sms", "plafond de dépense", "mots de passe en clair ?", "teste la sécurité de base du projet", "teste-le en conditions réelles", "sonde le projet en direct". Headers and TLS → /harden; secrets, CVE, OWASP → /cso; full WCAG → /web-validate.'
|
||||
argument-hint: '[project path] [--domain api,hosting,a11y,supabase,messaging,functions] [--exclude paths] [--live <url you own>]'
|
||||
description: 'Use when auditing a project against the baseline guardrails and fixing what fails: hosting (rate limit, CDN and firewall, spend cap), accessibility (keyboard, visible focus, alt text, field labels), Supabase (RLS on every table, owner-scoped policies, no service_role key client-side), SMS and email (recorded consent, unsubscribe, STOP), cloud functions (no self-trigger, instance cap, budget stop), plus API and access hygiene (auth on every route, CORS, secrets, password storage). Runs a deterministic scanner, judges each hit, writes .claude/audits/GUARDRAILS.md, then proposes fixes, applies only the ones the user accepts (bugfixer executor, fresh verifier and security gates) and re-scans to prove each one fixed. Optional read-only live probe confirms a hole from outside on a target the user owns and names. Triggers: "guardrails", "garde-fous", "RLS activée ?", "audit supabase", "consentement sms", "plafond de dépense", "mots de passe en clair ?", "teste la sécurité de base du projet", "corrige les garde-fous", "teste-le en conditions réelles", "sonde le projet en direct". Headers and TLS → /harden; secrets, CVE, OWASP → /cso; full WCAG → /web-validate.'
|
||||
argument-hint: '[project path] [--domain api,hosting,a11y,supabase,messaging,functions] [--exclude paths] [--live <url you own>] [--report-only]'
|
||||
---
|
||||
|
||||
# /guardrails
|
||||
|
||||
Checks a project against `rules/secure-by-default.md`. A scanner reads the
|
||||
tree as data and finds what text can prove. This skill then judges the hits,
|
||||
covers what text cannot prove, lists what only a dashboard can set, and, on
|
||||
request, probes a running target the user owns to confirm a hole from outside.
|
||||
Checks a project against `rules/secure-by-default.md`, then fixes what the
|
||||
user accepts and proves each fix. A scanner reads the tree as data and finds
|
||||
what text can prove. This skill judges the hits, covers what text cannot
|
||||
prove, lists what only a dashboard can set and, on request, probes a running
|
||||
target the user owns. It then proposes fixes, applies the accepted ones and
|
||||
runs the scan again until every accepted fix is proven.
|
||||
|
||||
The scanner proves absence of a protection, never presence of security. A
|
||||
clean scan means "no static finding", and the report says exactly that. A
|
||||
live probe proves the opposite direction: that a door is actually open.
|
||||
|
||||
## MODEL GATE (blocking, before any other step)
|
||||
|
||||
Run `$HOME/.claude/lib/model-gate.md`. Judging hits and designing fixes
|
||||
requires Fable or Opus. Verdict `small` → STOP: the gate prints the remedy.
|
||||
ROUTING: follow `$HOME/.claude/lib/effort-shift.md` (phases via
|
||||
`mcp__model-router__route`); each step below names its phase.
|
||||
|
||||
## STEP 1: Scope
|
||||
|
||||
Work in the project the user names, else the current directory. Say in one
|
||||
line what you will scan. Domains: `api`, `hosting`, `a11y`, `supabase`,
|
||||
`messaging`, `functions`. The scanner skips the ones that do not apply.
|
||||
`--report-only` stops after STEP 7: audit, no fix.
|
||||
|
||||
## STEP 2: Run the scanner
|
||||
|
||||
@@ -86,7 +96,8 @@ never a third party.
|
||||
It sends GET, HEAD and OPTIONS only (the rate-limit burst is the one
|
||||
POST, opt-in in the plan, capped at 25 requests). It never writes data,
|
||||
never follows a redirect to another host, and stops at a request budget.
|
||||
Exit 1 means at least one OPEN verdict.
|
||||
Exit 1 means at least one OPEN verdict. Keep the plan file: STEP 11
|
||||
replays it.
|
||||
3. **Cross the verdicts with the static findings.** A verdict is an
|
||||
observation, not a conclusion: OPEN means the request returned data or a
|
||||
200, CLOSED means it was refused or empty. A static FAIL confirmed OPEN in
|
||||
@@ -112,9 +123,140 @@ Write `.claude/audits/GUARDRAILS.md`: one table per domain with status PASS,
|
||||
FAIL, WARN, MANUAL or N/A, the evidence, and the fix in one line. PASS means
|
||||
"no static finding". When a live probe ran, add a line for its verdict next
|
||||
to the matching static finding. Keep it short; no filler sections.
|
||||
`--report-only`, or nothing CONFIRMED and no OPEN verdict: reply with counts,
|
||||
the FAILs with file:line, any OPEN verdict and the MANUAL items, then stop.
|
||||
|
||||
## STEP 8: Hand over
|
||||
## STEP 8: Propose fixes
|
||||
|
||||
Reply with counts, the FAILs with file:line and a one-line fix each, any OPEN
|
||||
probe verdicts, and the MANUAL items. This skill audits; it does not fix. A
|
||||
fix goes through `/bugfix`, `/feat` or `/hotfix`.
|
||||
`mcp__model-router__route(phase="plan")`: designing a fix is the deepest
|
||||
thinking in this run, it goes to the plan row.
|
||||
|
||||
One proposal per CONFIRMED finding, grouped by rule and file; merge pairs
|
||||
that one change closes (one middleware closes HOST-NO-RATE-LIMIT for every
|
||||
route). FALSE POSITIVE and ACCEPTED RISK get no proposal. Each proposal:
|
||||
|
||||
- **number, rule, file(s)**, and the problem in one line;
|
||||
- **the fix**, concrete: file:line and the change, the SQL for a migration,
|
||||
the label text for a field. Root cause, never a mask: a missing RLS gets
|
||||
owner policies in the same migration, not a disabled check;
|
||||
- **choices the user sees** (label wording, CORS origins, owner column,
|
||||
rate-limit numbers), each with your proposed value, named so the user can
|
||||
change it;
|
||||
- **risk**: what it can break. `BREAKING` when it changes a contract a client
|
||||
relies on (RLS without policies blocks the app, a CORS allowlist drops an
|
||||
origin, a new required header). `DECISION` when no default is defensible
|
||||
(consent model, retention period): the user picks before it can apply;
|
||||
- **proof**: the scanner pairs that must disappear (`RULE:path`), the probe
|
||||
that must turn CLOSED, and a project test when one fits naturally.
|
||||
|
||||
MANUAL items stay user steps (STEP 6), never proposals. A live OPEN verdict
|
||||
with no static finding gets a proposal whose proof is the probe alone.
|
||||
|
||||
Save the proposals to `.claude/tasks/plans/<YYYY-MM-DD>-guardrails-<HHMM>.md`
|
||||
and append them to the report. In the reply, show them as a numbered list,
|
||||
one or two lines each, BREAKING and DECISION marked.
|
||||
|
||||
## STEP 9: Approval (gate, ends the turn)
|
||||
|
||||
Nothing is applied without the user's explicit acceptance. Ask once, then
|
||||
stop the turn:
|
||||
|
||||
```
|
||||
Which fixes do I apply? "all" (every proposal except DECISION ones),
|
||||
numbers ("1,3,5-7"), "none", or an amendment ("2 with the label 'Email'").
|
||||
A DECISION proposal needs its number plus your choice.
|
||||
```
|
||||
|
||||
On resume, `mcp__model-router__route(phase="reflect")`. "none" → stop,
|
||||
proposals stay in the report. An amendment rewrites that proposal in the plan
|
||||
file before anything else. Accepted set empty → stop.
|
||||
|
||||
## STEP 10: Apply
|
||||
|
||||
1. **Branch.** Not a git repository → stop: fixes need a diff to review.
|
||||
On `main`/`develop`, `bash ~/.claude/lib/gitflow.sh start bugfix
|
||||
guardrails-<YYYY-MM-DD>`; on a working branch, stay. Never `finish`.
|
||||
2. **Baseline**, before any edit:
|
||||
`python3 -B <scan.py> <root> --json > .claude/audits/.guardrails-baseline.json`.
|
||||
A derived file: never staged, never committed.
|
||||
3. **Contract** per `$HOME/.claude/lib/contract-interview.md` (STEP 4
|
||||
template, `flow: guardrails`). REQUEST = the user's acceptance verbatim
|
||||
plus the accepted proposals. One criterion per accepted proposal, its
|
||||
oracle the scanner itself:
|
||||
```
|
||||
1. <proposal 1 in one line>
|
||||
CHECK: python3 -B "$HOME/.claude/skills/guardrails/scripts/scan.py" '<abs root>' --assert-absent 'RULE:path,RULE:path'
|
||||
EXPECT: GUARDRAILS-CLEAR
|
||||
EVIDENCE: pending
|
||||
```
|
||||
Add one criterion for the project suite when one exists
|
||||
(`CHECK: <test command> && echo TESTS-GREEN`, `EXPECT: TESTS-GREEN`). A
|
||||
proof the scanner cannot run (probe, cross-user, manual SQL) is a
|
||||
criterion without CHECK: STEP 11 settles it. FILE SCOPE = the files the
|
||||
accepted proposals name. Paths go in single quotes; a path holding a
|
||||
single quote is named to the user, never written into a CHECK.
|
||||
4. **Positive control.** Run each oracle once on the unfixed tree: it must
|
||||
fail. An oracle that passes before the fix proves nothing; drop it, find
|
||||
why, and say so.
|
||||
5. **Dispatch the executor**, one fresh `bugfixer` for the accepted set
|
||||
(batches of 8 proposals at most, one after the other on the same branch):
|
||||
```
|
||||
mcp__model-router__route(phase="orchestrate") # send with the Agent call
|
||||
Agent(subagent_type="bugfixer")
|
||||
prompt: "CONTRACT: <path>
|
||||
DIAGNOSIS: <each accepted finding: rule, file:line, evidence, root cause>
|
||||
FIX PLAN: <the accepted proposals verbatim, with the user's choices; the
|
||||
regression check of each is its contract oracle, plus the project test
|
||||
the proposal names>
|
||||
BRANCH: <current branch>
|
||||
Apply to the letter. No commit, no branch ops, no security dispatch.
|
||||
Finish with the BUGFIX-EXEC REPORT."
|
||||
```
|
||||
`NEED-DECISION` routes per MID-RUN CLARIFICATION of the contract include:
|
||||
a visible, public-name or scope question goes to the user verbatim.
|
||||
`BLOCKED` → surface it, stop.
|
||||
6. **Gates** per `$HOME/.claude/lib/verify-secure-loop.md`, `CONTRACT` the
|
||||
path above, `DIFF` the executor's working-tree diff, `TEST` the suite.
|
||||
GATE 0 runs every scanner oracle (the per-fix proof), GATE 1 a fresh
|
||||
verifier, GATE 2 a fresh security-auditor. Loop caps and escalation are
|
||||
the include's; loop decisions stay in this main loop.
|
||||
|
||||
## STEP 11: Re-pass (prove it all)
|
||||
|
||||
`mcp__model-router__route(phase="reflect")`. The gates proved each accepted
|
||||
fix on its own; this pass proves the whole tree.
|
||||
|
||||
1. Full scan against the baseline:
|
||||
```
|
||||
python3 -B <scan.py> <root> --baseline .claude/audits/.guardrails-baseline.json
|
||||
```
|
||||
Every accepted pair must show `FIXED`, and the run must end on
|
||||
`GUARDRAILS-NO-NEW` (exit 0). A `NEW` hit is a regression the fix made.
|
||||
2. Live: when STEP 5 ran, replay the same plan on the same target once the
|
||||
user has reloaded or redeployed it and says go. A fix in code is not live
|
||||
until it runs. Each fixed proposal's probe must now read CLOSED.
|
||||
3. Settle the criteria without CHECK, by reading or by the user's answer for
|
||||
a manual step.
|
||||
4. Add an "after" column to `.claude/audits/GUARDRAILS.md`: proposal,
|
||||
before, after, evidence.
|
||||
|
||||
Anything not fixed, or a NEW hit → one more round from STEP 8, limited to
|
||||
those items. Two rounds at most: after the second, stop with the residuals
|
||||
open and say so plainly. Never report a fix the re-pass did not prove.
|
||||
|
||||
## STEP 12: Commit and hand over
|
||||
|
||||
1. **Commit gate.** Show files, `git diff --stat` and the message, wait for
|
||||
the user's go:
|
||||
```
|
||||
GUARDRAILS: READY TO COMMIT
|
||||
FILES : <list>
|
||||
MESSAGE : fix(security): <rules fixed, one line>
|
||||
```
|
||||
Then `git add <files touched>` (never `-A`, never the baseline file) and
|
||||
commit, project convention else 50 words at most.
|
||||
2. `mcp__model-router__route(phase="apply")` for the tail. Reply with: fixed
|
||||
and proven (proposal, rule, file), still open and why, MANUAL steps left
|
||||
for the user, the branch name. Merge waits for the user's explicit signal.
|
||||
3. Offer to capitalize a reusable lesson (a false-positive class, a fix
|
||||
pattern), entry pre-filled, written only on approval.
|
||||
@@ -204,3 +204,21 @@ because it can lock the user's own account; a redirect to another host is
|
||||
never followed, so a key never leaves the named host. Fuzzing, writes beyond
|
||||
the named login route, or probing a third party are out of scope: that is
|
||||
pentest, another contract.
|
||||
|
||||
## Fix loop: oracles and re-pass
|
||||
|
||||
Every accepted fix is proven by the scanner itself, never by the executor's
|
||||
word. Two check modes replace the report and its exit code:
|
||||
|
||||
| Mode | Passes when | Marker | Used by |
|
||||
|---|---|---|---|
|
||||
| `--assert-absent RULE:path,...` | none of these FAIL/WARN pairs remains, the domain was scanned, the tree is not empty | `GUARDRAILS-CLEAR <n>` | a contract `CHECK:` run by `lib/gates.sh` (GATE 0) |
|
||||
| `--baseline before.json` | no FAIL/WARN hit appeared since the earlier `--json` run | `GUARDRAILS-NO-NEW` | STEP 11 re-pass |
|
||||
|
||||
Pairs match on rule and file, not line: a fix moves lines. A MANUAL rule
|
||||
cannot be asserted (exit 2): no static scan proves a dashboard setting. An
|
||||
unscanned domain or an empty tree fails the assertion, because absence there
|
||||
proves nothing. Run every oracle once before the fix: it must fail.
|
||||
|
||||
The baseline lists `FIXED` and `NEW` pairs with their hit counts and a
|
||||
remaining total. A `NEW` hit after a fix is a regression the fix made.
|
||||
@@ -3,10 +3,17 @@
|
||||
|
||||
Reads a project tree as data and never executes it. Exit codes:
|
||||
0 no FAIL, 1 at least one FAIL, 2 usage error.
|
||||
|
||||
Two check modes replace the report and its exit code:
|
||||
--assert-absent RULE:path,... exit 0 and print GUARDRAILS-CLEAR only when
|
||||
none of these FAIL/WARN pairs remain (a fix contract's oracle);
|
||||
--baseline before.json compare with an earlier --json run, exit 0 and
|
||||
print GUARDRAILS-NO-NEW only when no FAIL/WARN hit appeared.
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from collections import Counter
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
@@ -22,6 +29,15 @@ DOMAINS = {
|
||||
"functions": functions,
|
||||
}
|
||||
SEVERITY_RANK = {"FAIL": 0, "WARN": 1, "MANUAL": 2}
|
||||
RULE_DOMAINS = {
|
||||
"API": "api", "HOST": "hosting", "A11Y": "a11y", "SB": "supabase",
|
||||
"MSG": "messaging", "FN": "functions",
|
||||
}
|
||||
MANUAL_RULES = {
|
||||
"HOST-WAF-DDOS", "HOST-SPEND-CAP", "SB-RLS-LIVE", "FN-CAP-UNVERIFIED",
|
||||
"FN-BUDGET-STOP",
|
||||
}
|
||||
GATED = ("FAIL", "WARN")
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -41,6 +57,12 @@ def parse_args(argv):
|
||||
"--exclude", default="",
|
||||
help="comma list of relative paths to skip (copies, vendored code)")
|
||||
parser.add_argument("--json", action="store_true", help="JSON output")
|
||||
parser.add_argument(
|
||||
"--assert-absent", default="", metavar="RULE:path,...",
|
||||
help="contract oracle: pass only when these pairs are gone")
|
||||
parser.add_argument(
|
||||
"--baseline", default="", metavar="JSON",
|
||||
help="earlier --json run: report fixed, remaining and new hits")
|
||||
return parser.parse_args(argv)
|
||||
|
||||
|
||||
@@ -101,24 +123,124 @@ def render_json(project, result):
|
||||
}, indent=2)
|
||||
|
||||
|
||||
def _usage_error(path, names):
|
||||
unknown = [n for n in names if n not in DOMAINS]
|
||||
def _rule_domain(rule):
|
||||
return RULE_DOMAINS.get(rule.split("-", 1)[0])
|
||||
|
||||
|
||||
def _pairs(value):
|
||||
"""'RULE:path,RULE:path' -> [(rule, path)]; a missing path stays ''."""
|
||||
return [tuple(p.strip() for p in item.partition(":")[::2])
|
||||
for item in _split(value)]
|
||||
|
||||
|
||||
def _assert_error(value):
|
||||
for rule, path in _pairs(value):
|
||||
if not path or not _rule_domain(rule):
|
||||
return f"bad --assert-absent item {rule}:{path}, want RULE:path"
|
||||
if rule in MANUAL_RULES:
|
||||
return f"{rule} is MANUAL: no static scan can prove it fixed"
|
||||
return ""
|
||||
|
||||
|
||||
def _hits(findings):
|
||||
return Counter((f.rule, f.path) for f in findings if f.severity in GATED)
|
||||
|
||||
|
||||
def _load_baseline(path):
|
||||
data = json.loads(Path(path).read_text(encoding="utf-8"))
|
||||
return Counter((f["rule"], f["path"]) for f in data["findings"]
|
||||
if f["severity"] in GATED)
|
||||
|
||||
|
||||
def _baseline_error(path):
|
||||
if not path:
|
||||
return ""
|
||||
try:
|
||||
_load_baseline(path)
|
||||
except (OSError, ValueError, KeyError, TypeError) as exc:
|
||||
return f"unreadable baseline {path}: {exc}"
|
||||
return ""
|
||||
|
||||
|
||||
def _usage_error(args):
|
||||
unknown = [n for n in _split(args.domain) if n not in DOMAINS]
|
||||
if unknown:
|
||||
return f"unknown domain {unknown}"
|
||||
return "" if Path(path).is_dir() else f"not a directory: {path}"
|
||||
if not Path(args.path).is_dir():
|
||||
return f"not a directory: {args.path}"
|
||||
return _assert_error(args.assert_absent) or _baseline_error(args.baseline)
|
||||
|
||||
|
||||
def _pair_status(hits, applicable, pair):
|
||||
rule, path = pair
|
||||
if _rule_domain(rule) not in applicable:
|
||||
return False, f" CONTROL {rule} {path}: domain not scanned, " \
|
||||
"absence proves nothing"
|
||||
if hits[pair]:
|
||||
plural = "s" if hits[pair] > 1 else ""
|
||||
return False, f" PRESENT {rule} {path} ({hits[pair]} hit{plural})"
|
||||
return True, f" CLEAR {rule} {path}"
|
||||
|
||||
|
||||
def assert_absent(project, result, pairs):
|
||||
"""Positive control first: an empty tree or an unscanned domain fails."""
|
||||
rows = [_pair_status(_hits(result.findings), result.applicable, p)
|
||||
for p in pairs]
|
||||
lines = [text for _, text in rows]
|
||||
if not project.files:
|
||||
lines.insert(0, " CONTROL no file scanned, absence proves nothing")
|
||||
ok = bool(project.files) and all(passed for passed, _ in rows)
|
||||
return ok, lines + ([f"GUARDRAILS-CLEAR {len(pairs)}"] if ok else [])
|
||||
|
||||
|
||||
def _moved(more, less):
|
||||
"""Pairs where `more` holds extra hits over `less`, with the surplus."""
|
||||
return [(key, more[key] - less[key]) for key in sorted(more)
|
||||
if more[key] > less[key]]
|
||||
|
||||
|
||||
def _rows(tag, moved, sign):
|
||||
return [f" {tag:<5} {rule} {path} ({sign}{n})"
|
||||
for (rule, path), n in moved]
|
||||
|
||||
|
||||
def baseline_report(before, result):
|
||||
after = _hits(result.findings)
|
||||
fixed, new = _moved(before, after), _moved(after, before)
|
||||
summary = (f"baseline: {sum(n for _, n in fixed)} fixed, "
|
||||
f"{sum((before & after).values())} remaining, "
|
||||
f"{sum(n for _, n in new)} new")
|
||||
lines = _rows("FIXED", fixed, "-") + _rows("NEW", new, "+") + [summary]
|
||||
return not new, lines + ([] if new else ["GUARDRAILS-NO-NEW"])
|
||||
|
||||
|
||||
def _check_modes(project, result, args):
|
||||
checks = []
|
||||
if args.assert_absent:
|
||||
checks.append(
|
||||
assert_absent(project, result, _pairs(args.assert_absent)))
|
||||
if args.baseline:
|
||||
checks.append(
|
||||
baseline_report(_load_baseline(args.baseline), result))
|
||||
return checks
|
||||
|
||||
|
||||
def _scan(args):
|
||||
project = Project(Path(args.path), _split(args.exclude))
|
||||
result = run_checks(project, _split(args.domain))
|
||||
render = render_json if args.json else render_text
|
||||
print(render(project, result))
|
||||
return 1 if any(f.severity == "FAIL" for f in result.findings) else 0
|
||||
checks = _check_modes(project, result, args)
|
||||
if not checks:
|
||||
render = render_json if args.json else render_text
|
||||
print(render(project, result))
|
||||
return 1 if any(f.severity == "FAIL" for f in result.findings) else 0
|
||||
for _, lines in checks:
|
||||
print("\n".join(lines))
|
||||
return 0 if all(ok for ok, _ in checks) else 1
|
||||
|
||||
|
||||
def main(argv):
|
||||
args = parse_args(argv)
|
||||
error = _usage_error(args.path, _split(args.domain))
|
||||
error = _usage_error(args)
|
||||
if error:
|
||||
print(f"usage error: {error}", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
{"id": 2, "prompt": "teste les garde-fous sur ce projet, il envoie des emails et des SMS de relance", "expected": "Scans messaging and api, checks consent record, unsubscribe link, List-Unsubscribe and STOP handling, traces the opt-out path from the provider webhook, lists the dashboard items as MANUAL"},
|
||||
{"id": 3, "prompt": "Audit my Firebase functions: can any of them loop on itself or run up the bill?", "expected": "Scans functions domain only, reports max instances status and any trigger that writes its own collection, MANUAL item for a budget alert wired to an automatic stop, no live call to the provider"},
|
||||
{"id": 4, "prompt": "est-ce que les mots de passe sont stockés en clair quelque part dans ~/Documents/zenquality ?", "expected": "Runs the scanner's api domain, reads every API-PASSWORD-* hit in context, traces the sign-up and password-change write points to the password_hash column by hand, names the hashing function found, reports with file:line, fixes nothing"},
|
||||
{"id": 5, "prompt": "teste les garde-fous sur ~/Documents/game puis sonde-le en direct, le dev tourne sur http://localhost:5173", "expected": "Runs the static scan first, then builds a probe plan from the findings, exports test keys from the environment, runs probe.py --authorized against the localhost target only, reports OPEN verdicts next to the matching static FAIL, never writes data, never probes a target the user did not name"}
|
||||
{"id": 5, "prompt": "teste les garde-fous sur ~/Documents/game puis sonde-le en direct, le dev tourne sur http://localhost:5173", "expected": "Runs the static scan first, then builds a probe plan from the findings, exports test keys from the environment, runs probe.py --authorized against the localhost target only, reports OPEN verdicts next to the matching static FAIL, never writes data, never probes a target the user did not name"},
|
||||
{"id": 6, "prompt": "corrige les garde-fous qui échouent sur ~/Documents/faunosteo, je veux valider chaque correction avant", "expected": "Scans and judges, proposes numbered fixes with risks and visible choices, stops for approval, applies only the accepted ones on a bugfix branch through a contract whose oracles are scan.py --assert-absent, runs the verify-secure gates, re-scans against the baseline, reports fixed and still open, waits for a go before committing"}
|
||||
]
|
||||
Reference in new issue
Block a user