@bugb-technologies/bravos 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/dist/ci.js +1 -1
- package/dist/cli.js +271 -111
- package/dist/codegraph.js +21 -0
- package/dist/context.js +1 -1
- package/dist/doctor.js +20 -11
- package/dist/global.js +3 -3
- package/dist/graphbin.js +2 -0
- package/dist/guardlink.js +1 -1
- package/dist/guide.js +12 -10
- package/dist/help.js +45 -19
- package/dist/hooks.js +44 -21
- package/dist/install.js +2 -1
- package/dist/lock.js +1 -0
- package/dist/mcp.js +21 -5
- package/dist/palette.js +2 -2
- package/dist/plugin-release.js +2 -2
- package/dist/plugin.js +3 -3
- package/dist/prefs.js +66 -0
- package/dist/review-wait.js +76 -0
- package/dist/setup-route.js +37 -0
- package/dist/setup.js +3 -2
- package/dist/skills.js +1 -1
- package/dist/start/answers.js +36 -7
- package/dist/start/index.js +190 -69
- package/dist/start/repos.js +1 -1
- package/dist/start/ui.js +2 -2
- package/dist/upkeep.js +89 -0
- package/dist/watch-frame.js +1 -1
- package/dist/watch.js +1 -1
- package/docs/GUIDE.md +23 -11
- package/docs/UPGRADING.md +43 -1
- package/hooks/lib/autopilot.mjs +3 -18
- package/hooks/lib/briefing.mjs +93 -14
- package/hooks/lib/graph-autobuild.mjs +131 -0
- package/hooks/lib/legacy-skills.mjs +68 -0
- package/hooks/lib/palette.mjs +4 -4
- package/hooks/lib/prefs.mjs +108 -0
- package/hooks/lib/refresh.mjs +45 -1
- package/hooks/lib/setup.mjs +8 -8
- package/hooks/lib/snapshot.mjs +19 -1
- package/hooks/session-start.mjs +7 -2
- package/package.json +1 -1
- package/skills/bravos/SKILL.md +5 -4
- package/skills/bravos-annotate/SKILL.md +4 -4
- package/skills/bravos-cicd/SKILL.md +1 -1
- package/skills/bravos-codegraph/SKILL.md +1 -1
- package/skills/bravos-context/SKILL.md +6 -6
- package/skills/bravos-env/SKILL.md +2 -2
- package/skills/bravos-env/scope.example.yaml +2 -1
- package/skills/bravos-prove/SKILL.md +2 -2
- package/skills/bravos-recheck/SKILL.md +1 -1
- package/skills/bravos-resync/SKILL.md +1 -1
- package/skills/bravos-schedule/SKILL.md +1 -1
- package/skills/bravos-ship/SKILL.md +3 -3
- package/skills/bravos-templatize/SKILL.md +1 -1
- package/templates/review/review.html +1 -1
|
@@ -13,8 +13,8 @@ description: "Bring up a test target the user owns and prepare it for an authori
|
|
|
13
13
|
## Do
|
|
14
14
|
|
|
15
15
|
1. Read the current proving choice before target contact, login or auth verification. Use the owned local app named in the standing authorization or the target explicitly authorized for this invocation. The default is a loopback address (`127.0.0.1`, `localhost`, `[::1]`). Start it with the repo's own tooling (its compose file, dev server script or desktop build) and wait until it answers. In a bravos workspace each service has its own target: take the URLs from `bravos workspace show` (set a missing one with `bravos workspace target <name> <service>=http://127.0.0.1:<port>`), bring up every service the test crosses, and list every service host in the reviewed scope's `host_allowlist`.
|
|
16
|
-
2. On loopback, a recorded proving preference (`.guardlink/proving.md`, `choice: auto`) is the person's go-ahead for its target: use the recorded target and start command. If the setup wizard left them empty, inspect the repository’s documented development command and listening address. When these match the app the person authorized, record the actual target and start command alongside their original words. Commit the policy and scope before automatic replay. Ask only if the target or authority is ambiguous. If the user names a non-loopback target, stop and get two things before going on: the host listed in a committed `scope.yaml` that has been through a reviewed PR, and the human's authorization typed by them in this session in their own words. Without both, the target is out of scope; say so and stay on loopback.
|
|
17
|
-
3. Write the scope. Copy `{{SKILL_DIR}}/scope.example.yaml` to `.guardlink/scope.yaml`, then narrow `url_allowlist` to the routes under test. `method_allowlist` is a strict bound: cxg refuses every method it does not list, even with `--destructive-ok`, so a test that needs PUT, PATCH or DELETE needs the target's owner to add them in the reviewed PR; never add them yourself. Leave that field for the human to fill. Commit it
|
|
16
|
+
2. On loopback, a recorded proving preference (`.guardlink/proving.md`, `choice: auto`) is the person's go-ahead for its target: use the recorded target and start command. If the setup wizard left them empty, inspect the repository’s documented development command and listening address. When these match the app the person authorized, record the actual target and start command alongside their original words. Commit the policy and scope before automatic replay, with the person's go-ahead (the briefing's `Commits:` line is their standing answer; with no such line, ask once per session unless they already asked for commits). Ask only if the target or authority is ambiguous. If the user names a non-loopback target, stop and get two things before going on: the host listed in a committed `scope.yaml` that has been through a reviewed PR, and the human's authorization typed by them in this session in their own words. Without both, the target is out of scope; say so and stay on loopback.
|
|
17
|
+
3. Write the scope. Copy `{{SKILL_DIR}}/scope.example.yaml` to `.guardlink/scope.yaml`, then narrow `url_allowlist` to the routes under test. `method_allowlist` is a strict bound: cxg refuses every method it does not list, even with `--destructive-ok`, so a test that needs PUT, PATCH or DELETE needs the target's owner to add them in the reviewed PR; never add them yourself. Leave that field for the human to fill. Commit it, with the person's go-ahead (the briefing's `Commits:` line is their standing answer; with no such line, ask once per session unless they already asked for commits); an automatic run needs it merged to the default branch, and any non-loopback run needs it reviewed in a PR first.
|
|
18
18
|
4. Seed test data with the repo's own fixtures, seed scripts or admin endpoints: the roles and users the threats need, such as two users of different tenants for an ownership check. Name any test that needs production-like data as such, and run it only where that data is synthetic.
|
|
19
19
|
5. Get a session. On loopback, do it yourself: create the test accounts through the app's own signup, seed script or admin endpoint, write their login identity and secret to a gitignored file under `.bravos/`, and log in with `cxg pentest auth --target <url> --profile <name> --creds-file <file> --login-path <login route>`, one profile per identity a check needs. For a bearer-token API, check `cxg pentest auth --help` for dynamic-login support. Add `--login-user-field username` and `--login-pass-field password` when names differ (dotted paths support nested JSON), `--login-encoding form` for URL-encoded login, or `--login-body` for extra JSON fields; credential paths override those fields. Omit `--login-token-source` to discover the token by shape from the login response and save an `Authorization: Bearer` header profile; steer discovery only when needed with `--login-token-source json:/access_token` or `--login-token-source header:Authorization`. Capture each identity separately; probes use these profiles instead of minting their own tokens. For SSO, MFA or other browser-only login, drive signup and login in your own browser tool and capture the session interactively with `cxg pentest auth --target <url> --profile <name>`. For an authorized non-loopback target, ask the human to capture the session in their own browser with the same command, or to paste a storage state you import with `cxg pentest auth import --storage-state <file> --profile <name> --target <url>`; CI uses the import with a session the human exported once.
|
|
20
20
|
6. Verify the target URL and scope against the current recorded policy before sending any request. For a fresh local build or launch from this repository, capture the matching worktree witness at that time with `bravos hook replay build <loopback-url>`. Pass that output to bravos-prove in BRAVOS_REPLAY_BUILD, recording the actual target and revision. A hash computed beside a previously running app does not establish which code it serves. If a remote or already-running service cannot be tied to this build, report observations without updating the current claim. Confirm each required session is live with `cxg pentest auth verify --profile <name>` before handing the target on, so a run never spends its budget unauthenticated.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# bravos starter scope for cxg scan — loopback only.
|
|
2
2
|
#
|
|
3
|
-
# Copy to .guardlink/scope.yaml
|
|
3
|
+
# Copy to .guardlink/scope.yaml and commit it. An automatic run needs it merged to the default
|
|
4
|
+
# branch; a run against a host that is not loopback needs it reviewed in a PR first.
|
|
4
5
|
# cxg reads it through `cxg scan --scope-file`; each field below is explained where it is set.
|
|
5
6
|
#
|
|
6
7
|
# This starter allows only the read-mostly methods, a small budget, and no disposable-host
|
|
@@ -13,13 +13,13 @@ description: "Prove a new or changed GuardLink claim, or replay it after a fix,
|
|
|
13
13
|
## Do
|
|
14
14
|
|
|
15
15
|
1. Check the preconditions from bravos-env before any traffic: authorization for this run, a target that answers, `.guardlink/scope.yaml` committed, each profile passing `cxg pentest auth verify --profile <name>`, and for any non-loopback target both a reviewed scope and the human's authorization typed in this session. If one is missing, stop and hand back to bravos-env. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. It sets a starting budget, not a limit; go beyond it when the work needs it and say why in one line. Starting budget — low: replay a matching kit; medium: also author the first missing test in this session; high: include affected callers and controls; max: cover the testable in-scope queue. A higher effort does not authorize spending on an external model.
|
|
16
|
-
2. Order what to test, then read how the person wants proving handled. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_untested_exposures` and `codegraph_untested_reach` rank untested exposures by reach; test the ones intent.md's Assumptions put in scope first, least privileged entry point first, and report exposures only an out-of-scope attacker reaches instead of running them. Without the graph, say "code graph unavailable; using guardlink hypothesis next order" and use that queue. Within that order, an exposure with a reachable SAST finding joined to it (`bravos sast candidates`) goes before one without, and its route goes into the run notes; with no SAST report or SAST unavailable, skip this. Then, for how the person wants proving handled: the briefing's `Proving:` line, from `.guardlink/proving.md`. If it is not set, ask them once, with a suggestion drawn from the repo (for example, "you have a docker-compose; I'd prove automatically on 127.0.0.1:8080"): prove automatically on their loopback target whenever new or changed exposures appear, ask each time, on a schedule (bravos-schedule's nightly), or not now
|
|
16
|
+
2. Order what to test, then read how the person wants proving handled. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_untested_exposures` and `codegraph_untested_reach` rank untested exposures by reach; test the ones intent.md's Assumptions put in scope first, least privileged entry point first, and report exposures only an out-of-scope attacker reaches instead of running them. Without the graph, say "code graph unavailable; using guardlink hypothesis next order" and use that queue. Within that order, an exposure with a reachable SAST finding joined to it (`bravos sast candidates`) goes before one without, and its route goes into the run notes; with no SAST report or SAST unavailable, skip this. Then, for how the person wants proving handled: the briefing's `Proving:` line, from `.guardlink/proving.md`. If it is not set, ask them once, with a suggestion drawn from the repo (for example, "you have a docker-compose; I'd prove automatically on 127.0.0.1:8080"): prove automatically on their loopback target whenever new or changed exposures appear, ask each time, on a schedule (bravos-schedule's nightly), or not now. Record their answer in `.guardlink/proving.md`: lines `choice: auto|ask|schedule|none`, `target: <loopback url>`, `start: <start command>`, `generation: no` (Bravos never uses cxg's model generation), their words quoted verbatim, and `— confirmed by <their name>, <date>`. Before offering or following `auto`, check that `git symbolic-ref --quiet refs/remotes/origin/HEAD` names an existing commit. If missing, warn: fetch the default branch, then `git remote set-head origin --auto` (or `git remote set-head origin <branch>`); use `ask` meanwhile. Then follow it: `auto` proceeds on that target with their quoted words as the attestation; `ask` asks now; `schedule` hands to bravos-schedule; `none` stops here and says so. When they change their mind, rewrite the file with their new words.
|
|
17
17
|
3. Read the affected claim from `guardlink hypothesis list --json`. Include a declared mitigation awaiting its first test and a previously confirmed claim now marked retest. Match its key to the logical source location in `guardlink sarif . --profile pentest -o whitebox/findings.sarif`; external annotations also have a physical declaration in a .gal file. Keep both locations. Record the tested source revision or worktree, application build, identity roles and intended oracle.
|
|
18
18
|
4. For a web claim, use its bound JavaScript kit in .guardlink/cxg-replay/. For a missing or mismatched kit, follow bravos-templatize in this session. A matching kit exercises the intended operation and includes a positive control for a claimed defense. Validate the kit and review its scope. Honor the recorded kit policy and the person’s stated limits. An automatic reviewed-only policy requires identical bound test bytes on the default branch. On a clone whose upstream has no testing policy, use `ask` with locally committed policy and scope and typed authorization for loopback `run-once`. The earlier wizard’s “only replay tests I approved” choice retains that restriction.
|
|
19
19
|
5. Pass the build witness that bravos-env captured at launch in BRAVOS_REPLAY_BUILD. Without fresh build provenance, retain the observation and leave the current-code claim pending. Under a recorded automatic loopback policy, run `bravos hook replay run <kit.js>`. For a one-time approved run under an ask policy, use `bravos hook replay run-once <kit.js>` with the target in BRAVOS_SCAN_TARGET and the person's exact words in BRAVOS_REPLAY_ATTESTATION for that invocation. Keep private identity state outside Git. A scheduled-only policy hands the kit to bravos-schedule. A disabled policy leaves the claim pending. The helper selects one file through plain CXG scan with model authoring disabled. Only evidence tied to the exact claim, tested source and kit is eligible for writeback.
|
|
20
20
|
6. Read the individual native CXG execution and ledger result. A reproduced exploit needs an engine-adjudicated confirmation. A held control needs observed denial and a working positive control. Missing roles, ambiguous tests, incomplete imports, a different target build or stale inputs stay pending with the reason. Exit 4 can include both a refusal and valid results from other probes. An ordinary scanner's template-reported match is a lead for a runtime test. Keep private HTTP and auth material out of reports and commits.
|
|
21
21
|
7. For workspaces, bind each hop to its own service URL and authorized scope. Every run is plain `cxg scan`, through the replay helper or directly with the same scope, attestation and identities: for Electron add `--target-type electron` with `--app-cmd` or `--app-binary` and the verified desktop profile; for Tauri's in-process proof add `--tauri-prove`. Ordinary network or local CLI scanner templates use the scanner contract and produce leads. Probes are written in this session by bravos-templatize, never generated by cxg. Use the reviewed scope, approved target and identities, and keep the native evidence separate. For an independently stamped result, the GuardLink import is `guardlink hypothesis confirm --from-scan <native-report.json> --write`; check every intended claim key and tested anchor, import only an uncontested exact match, and reread the ledger. A missing key, changed build or failed write is unrecorded. Boundary outcomes use GuardLink's boundary ledger.
|
|
22
|
-
8. Report which claims were confirmed or refuted, which still need testing and which were actually recorded. After a recorded engine confirmation, offer to promote the verified kit into `security/` (or `.guardlink/config.json`'s `security_tests_dir`) as a curated regression test. With the person's agreement, review its scope, stable oracle and runner, then retain only portable test code; keep credentials and raw run evidence outside Git. Confirmation alone never promotes a kit. Keep the run ID and replay kit for bravos-recheck.
|
|
22
|
+
8. Report which claims were confirmed or refuted, which still need testing and which were actually recorded. After a recorded engine confirmation, offer to promote the verified kit into `security/` (or `.guardlink/config.json`'s `security_tests_dir`) as a curated regression test, and say why: a promoted kit runs in every pre-PR check, so the fix cannot regress unnoticed. With the person's agreement, review its scope, stable oracle and runner, then retain only portable test code; keep credentials and raw run evidence outside Git. Confirmation alone never promotes a kit. Keep the run ID and replay kit for bravos-recheck.
|
|
23
23
|
|
|
24
24
|
## Never
|
|
25
25
|
|
|
@@ -36,7 +36,7 @@ description: "Keep findings from going stale after code changes: list the claims
|
|
|
36
36
|
- Every confirmed threat on a changed path was replayed, or you said why it was not.
|
|
37
37
|
- `guardlink diff <base> --fail-on-new --markdown` exits 0, or each new exposure it lists is reported as open.
|
|
38
38
|
- You named the three states for each claim you touched and what was not tested.
|
|
39
|
-
- If a dashboard was built earlier (the briefing's `Dashboard:` line, or one you opened this session), you
|
|
39
|
+
- If a dashboard was built earlier (the briefing's `Dashboard:` line, or one you opened this session), you rebuilt it with `bravos dashboard --no-open` and gave the path.
|
|
40
40
|
|
|
41
41
|
## What it leaves for the next skill
|
|
42
42
|
|
|
@@ -13,7 +13,7 @@ description: "Carry annotation work that never reached the base branch onto it,
|
|
|
13
13
|
## Do
|
|
14
14
|
|
|
15
15
|
1. Find the base: `git symbolic-ref -q --short refs/remotes/origin/HEAD` prints `origin/<base>` (if empty, use `origin/main`). Run `bravos resync --list` to see how far this checkout is behind and which idle branches carry `.guardlink/` work the base lacks. Tell the user what you found in two lines and ask before you move their checkout.
|
|
16
|
-
2. Make uncommitted work safe before anything else
|
|
16
|
+
2. Make uncommitted work safe before anything else. It holds the person's own code as well as annotations, so say what you are about to commit and ask once; then, on the old branch, commit it as it is with a message that says it is unreviewed work in progress (`git add -A` then `git commit -m "wip: unreviewed annotation drafts, kept for bravos resync"`). That commit is the only copy; a stash can be popped by another session, so never stash.
|
|
17
17
|
3. Start fresh from the base: `git fetch origin`, then `git switch -c resync/<old-branch> origin/<base>` (in a worktree when this checkout is shared with another session).
|
|
18
18
|
4. Preview: `bravos resync --from <old-branch>`. Read the counts: sidecars to carry, sidecars both sides have, definitions to carry, possible duplicates, and files changed since the claims were written. With inline annotations it copies nothing and says to bring the commits over with `git cherry-pick` or `git merge` instead; do that, then continue at step 7.
|
|
19
19
|
5. Apply: `bravos resync --from <old-branch> --apply`. It writes the sidecars and a marked block of carried definitions, runs `guardlink reanchor . --apply`, validates, and saves the full lists to `.bravos/resync/last.json`.
|
|
@@ -16,7 +16,7 @@ description: "Set up recurring security upkeep with each harness's own mechanism
|
|
|
16
16
|
|
|
17
17
|
1. If the user wants a goal reached in rounds with rests ("100% coverage", "every exposure", subagents per round), that is bravos-campaign; hand it over. Otherwise map the intent to one mechanism and say which: while this session is open → an in-session loop; while the laptop is closed, any harness → the nightly GitHub Actions workflow; while the laptop is closed, Claude Code with a cloud account → a cloud scheduled task the user creates.
|
|
18
18
|
2. In-session loop (Claude Code only): copy `{{SKILL_DIR}}/loop.md` to `.claude/loop.md`, adjust the steps to the user's request, and commit it. Tell the user to start it with a bare `/loop`, which reads that file; it runs only while the session is open, stops when it exits, and expires after seven days. Codex has no equivalent; offer the nightly workflow instead.
|
|
19
|
-
3. Nightly workflow: run `bravos
|
|
19
|
+
3. Nightly workflow: run `bravos setup --ci`, keep the variant for the team's harness (`bravos-nightly-claude.yml` or `bravos-nightly-codex.yml`) and delete the other. A team on GitHub Copilot uses `bravos setup --workflows nightly-copilot` instead: it opens an issue each night and assigns it to Copilot's cloud agent, which needs the secret `COPILOT_ASSIGN_TOKEN` (a Copilot user's personal access token) and `BRAVOS_LICENCE` as an Agents secret. Tell the user the secret it needs (`CLAUDE_CODE_OAUTH_TOKEN` for Claude Code, made once with `claude setup-token` so the run uses their Claude plan, or `OPENAI_API_KEY` for Codex) and to allow GitHub Actions to create pull requests in the repo settings.
|
|
20
20
|
4. Cloud scheduled task: a skill cannot create one. Give the user the prompt to paste into `/schedule`: follow bravos-annotate in slice mode on the next unannotated files, run its lint gate, and open one pull request whose body carries bravos-ship's Security gate section. Tell them the task clones the default branch and runs at most hourly.
|
|
21
21
|
5. State the spend before the user starts any of them: files per run (the default slice is five) times runs per day, and that each run spends model tokens.
|
|
22
22
|
6. For the Claude Code and Codex nightlies, select scheduled proving in the committed human policy and review the scope and exact target. Only checked-in, bound JavaScript kits are eligible. Configure BRAVOS_SCAN_TARGET and BRAVOS_APP_START for the disposable local build and the identities each kit requires. Keep session state in CI secrets. A disabled or ask-only policy skips the scan. Report missing prerequisites, partial executions and unrecorded results separately. Copilot schedules annotation only.
|
|
@@ -14,7 +14,7 @@ description: "The no-mistakes security gate before a pull request: validate the
|
|
|
14
14
|
|
|
15
15
|
**Plan check first.** The pre-PR gate is on the Team plan. Run `bravos licence --json` once per session (the briefing's `Plan:` line says the same); if `licensed` is false, tell the person in two sentences what this skill would do here and that it needs a Team licence — `bravos account activate` starts a 30-day trial with no card, or https://account.bugb.io/pricing — then stop, and do nothing else from this skill. A licence in grace still counts.
|
|
16
16
|
|
|
17
|
-
1. Find the base.
|
|
17
|
+
1. Find the base. The gate judges `HEAD`, so commit work in progress first, with the person's go-ahead (for Bravos's own files the briefing's `Commits:` line is their standing answer; for their code, or with no such line, ask once per session unless they already asked for commits); never stash, because another session can pop a stash. The default branch is `git symbolic-ref -q refs/remotes/origin/HEAD` (strip `refs/remotes/origin/`; if it prints nothing, use `main`). Run `git fetch origin <default>` so the merge-base is current (if the fetch fails, offline or with no `origin`, say so and continue with the local ref), then `<base>` = `git merge-base HEAD origin/<default>`. Every gate below is deterministic and spends no model. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. It sets a starting budget, not a limit; go beyond it when the work needs it and say why in one line. Starting budget — low: the deterministic gates (steps 2–4); medium: also the code-graph gaps; high: also SAST; max: also bravos-recheck on the changed paths.
|
|
18
18
|
2. Run `guardlink validate .` and fix what it reports.
|
|
19
19
|
3. Run `guardlink lint . --since <base> --json`. This judges every claim on the branch, not only yours. Apply an entry's `fix` only to a line this session wrote, and rerun until `summary.errors` is 0. For `accepts-written`, `entitles-written` or `confirmed-without-evidence` on any other line, do not touch it: stop and report it to the user.
|
|
20
20
|
4. Run `guardlink diff <base> --fail-on-new --markdown`. Exit 0 means no new unmitigated exposure. A non-zero exit lists new exposures with no `@mitigates`; an `@exposes` plus `@audit` written on this branch is new exposure and stays listed by design. Do not try to turn it green: report each listed exposure as open in the Security gate section and stop there for that exposure. Fixing the code or accepting the risk is the human's decision.
|
|
@@ -30,7 +30,7 @@ description: "The no-mistakes security gate before a pull request: validate the
|
|
|
30
30
|
design rules touched: <each INV id and threat id whose file this branch changed, with its status from `bravos rules --json`, or "none">
|
|
31
31
|
Not tested: <what no tool exercised, e.g. no live run, SAST not run>
|
|
32
32
|
If the user asked for a PR, open it with this section in the body; otherwise print the section and stop.
|
|
33
|
-
12. When the opt-in pre-PR hook is installed (`bravos
|
|
33
|
+
12. When the opt-in pre-PR hook is installed (`bravos setup --pre-pr-hook`), it reruns these gates on `gh pr create` and `gh pr ready` and blocks on lint errors, on a new exposure whose threat and asset ids are not both named in the PR body, on a confirmed claim on a changed file with no `@ticket` for it in that file, on a design rule that was holding when the branch changed a file it is enforced in after its last test and the PR body does not name it (its INV id or threat id; replaying its test with bravos-recheck clears it), and on any gate that fails to run (unknown); let it run. Before the PR exists, `node .bravos/hooks/pre-pr.mjs --check` runs the same gates by hand and lists the new exposures the body must disclose.
|
|
34
34
|
|
|
35
35
|
## Never
|
|
36
36
|
|
|
@@ -57,4 +57,4 @@ description: "The no-mistakes security gate before a pull request: validate the
|
|
|
57
57
|
|
|
58
58
|
- `docs/GUARDLINK_REFERENCE.md` — verbs, including `@ticket`.
|
|
59
59
|
- `.guardlink/README.md` — placement rules for this repo.
|
|
60
|
-
- `{{SKILLS_ROOT}}/guardlink-annotate-diff/SKILL.md` — the playbook for a change's gaps; `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` for the evidence bar. guardlink writes both under `.claude/skills/`, and `bravos
|
|
60
|
+
- `{{SKILLS_ROOT}}/guardlink-annotate-diff/SKILL.md` — the playbook for a change's gaps; `{{SKILLS_ROOT}}/guardlink-annotate-exploitable/SKILL.md` for the evidence bar. guardlink writes both under `.claude/skills/`, and `bravos setup` mirrors them into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook <id> "<scope>"` prints the same method.
|
|
@@ -20,7 +20,7 @@ description: "Turn the threat model's open exposures into correct, testable cxg
|
|
|
20
20
|
6. Record repo context for the probes you write. Copy `{{SKILL_DIR}}/operator-guidance.md` to `.guardlink/operator-guidance.md` if it is not there, and fill each section from the code: framework, auth shape, test identities, known false positives, out-of-bounds routes. Read it before writing each kit; cxg never generates probes for this repository.
|
|
21
21
|
7. For a first test or regression kit, write a single JavaScript probe in .guardlink/cxg-replay/. Include an exact `// @guardlink_threat: threat@logical/file:line`, `// @attach_scheme: path`, the required identity names, and a precise test with a positive control. Run `bravos hook replay bind <kit.js>` before executing it. The binding command associates the kit with the key of the current GuardLink exposure. Review that mapping when the claim is edited or moved. Leave native CXG identity stamps to the engine.
|
|
22
22
|
8. Apply the oracle rule: a vulnerability class cxg cannot judge from a response has no oracle. Record it in `.guardlink/cxg-templates/README.md` as unsupported, with the threat id and why, instead of writing a template that pretends to prove it. An invariant threat (`#inv-…`, from intent.md) maps to the cxg class that can judge it: another user's or tenant's data → `idor`; a role or permission gained → `privilege_escalation`; a field the caller should not set → `mass_assignment`; a check bypassed by concurrent requests → `race_condition`; a workflow step skipped or reordered → `business_logic`. Record each invariant's class in the README. A rule that holds has its `@exposes` beside a `@mitigates` (bravos-annotate step 5), and its kit is a regression test: sign in as the role or user the rule forbids, make the request the rule is about, and report a finding only when it succeeds; a refusal is the expected result and records the rule as held. Bind it to that `@exposes` like any other kit. If cxg cannot tell a refusal from a success for that request, record the rule as unsupported instead of writing a kit that always passes.
|
|
23
|
-
9. With the person's go-ahead (ask once per session unless they already asked for commits), commit the templates, the README and the filled guidance together, and hand the template ids and threat ids to bravos-prove.
|
|
23
|
+
9. With the person's go-ahead (the briefing's `Commits:` line is their standing answer; with no such line, ask once per session unless they already asked for commits), commit the templates, the README and the filled guidance together, and hand the template ids and threat ids to bravos-prove.
|
|
24
24
|
|
|
25
25
|
## Never
|
|
26
26
|
|
|
@@ -564,7 +564,7 @@ textarea.comment { min-height: 37px; }
|
|
|
564
564
|
|
|
565
565
|
$('done').addEventListener('click', async () => {
|
|
566
566
|
if (mode.kind === 'serve') { try { await api('/done', {}); } catch { /* already gone */ } }
|
|
567
|
-
status('Thanks.
|
|
567
|
+
status('Thanks. The agent reads everyone\'s answers now; if it does not carry on, tell it "done". You can close this tab.');
|
|
568
568
|
});
|
|
569
569
|
})();
|
|
570
570
|
</script>
|