Bravos Annotate
ASecurityKeep the GuardLink threat model correct and growing, in this session: pick a budgeted slice of files (or go deep on request), follow guardlink's own playbook skill, write annotations that meet the evidence bar, run the lint gate until clean, and report the coverage delta. Use when asked to annotate, threat-model or cover code, after writing security-relevant code, when the briefing shows coverage or a worklist, and when asked to annotate deeply or run multiple rounds. A request to identify or...
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 12, 2026
Works with
Security analysis
100/100Pro scans all 3 files and shows the line behind each finding
npx -y skills add Bugb-Technologies/bravos-plugins --skill bravos-annotate --agent claude-codeAre you the author of Bravos Annotate?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/bugb-technologies-bravos-annotate-bravos-plugins)---
name: bravos-annotate
description: "Keep the GuardLink threat model correct and growing, in this session: pick a budgeted slice of files (or go deep on request), follow guardlink's own playbook skill, write annotations that meet the evidence bar, run the lint gate until clean, and report the coverage delta. Use when asked to annotate, threat-model or cover code, after writing security-relevant code, when the briefing shows coverage or a worklist, and when asked to annotate deeply or run multiple rounds. A request to identify or find all the threats is bravos-threat-hunt, which runs this skill after the code graph and SAST."
---
<!-- bravos:generated -->
> Paths that start with `SKILL_DIR/` are files in this skill's own folder, the folder that holds this SKILL.md.
# Bravos annotate: a budgeted slice of the threat model, gated
## When
- The user asks to annotate, threat-model or cover code, or to go deep / run several rounds.
- You just wrote or changed security-relevant code and its claims are missing or stale.
- The briefing's `Open exposures:` line shows low coverage or a non-empty worklist.
- bravos-ship or bravos-codegraph handed you gaps to annotate.
- The briefing has a `Background annotation:` line: one background pass this session. In Claude Code, start it with the Agent tool in the background (`run_in_background`), told to follow this skill for one slice at the default budget and report in one line; in a harness without subagents, offer it once instead. Tell the person in one line that it is running and go on with their request. The pass takes one slice (step 4 skips the person's current change) and writes annotations only, never code; it commits only as the briefing's `Commits:` line allows, and with no such line commits nothing and leaves its files for the person; when it ends, pass on its `+<files>, <p0>% → <p1>%` line. One per session: not again after a resume or compact, and none when the briefing has no such line (the person switched it off with `bravos prefs set annotate off`, or `BRAVOS_AUTO_ANNOTATE=off` is set).
## Do
1. Set up. You annotate in this session: guardlink supplies the method (its playbook skills), you supply the edits. `<base>` below is the base branch name, e.g. `main`; the briefing prints it as `base origin/<base>`, and without a briefing `git symbolic-ref -q --short refs/remotes/origin/HEAD` prints `origin/<base>` (if it prints nothing, use `main`). Run `git fetch origin <base>` before you use `origin/<base>`, so it is current; if the fetch fails (offline, no `origin`), say so and continue with the local ref. Record `git rev-parse HEAD` now as `<start>`: the lint gate judges only what this session writes. Definitions (`@asset`, `@threat`, `@control` with `#id`) live in `.guardlink/definitions.*`; reuse those ids and never redefine one. Read `.guardlink/intent.md`: its invariants (`INV-n`), intended-by-design items (`INT-n`), actors and crown jewels shape every claim below. Annotation never waits for the intake. If intent.md is missing and there is no SDR-0 (the application's own record), offer the person SDR-0 once (`bravos records new --app` writes it blank for the team to fill in; `SKILL_DIR/../bravos-records/SKILL.md` step 6) and annotate meanwhile; once approved, its rules bind every change. Run bravos-context's draft (its steps 2–4) only when the person asks for the intake page. If the briefing's `Intent:` line says nobody has confirmed it, annotate against the draft and ask the person once this session to confirm it on the intake page (`bravos review intent`); never confirm anything for them. If the person would rather go without, tell them what that costs (severities are not calibrated to the product, and a rule only a design states will not be found) and that they record it themselves with `bravos context decline --by "<their name>"`.
2. Run `guardlink ci -f json`. Note `summary.coverage.percent` as p0 and the worklist size from the briefing or `guardlink unannotated --json` (`summary.worklist`).
3. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. Starting budgets — low: the changed files only; medium: changed plus 5 from the worklist; high: 25 per round, then the `chains` playbook; max: rounds until the worklist is empty (bravos-campaign runs those with subagents). These are defaults, not limits: take more or fewer when the code calls for it, and say why in one line ("12 files, not 5: the auth path spans them"). For a large pick, tell the user the files and rounds before you start.
4. Run `node SKILL_DIR/scripts/slice.mjs --base origin/<base> --n <budget>` (`--deep` for no limit, `--batches <k>` to split the pick for parallel work, `--prefer <file>` for entry points `codegraph_entry_points` found). It prints one JSON object: `diff` (files changed from the merge base to disk, including staged, unstaged and untracked source), `coverage` (unannotated files to cover, entry points and trust code first, generated, test and CI files last), `coverage_detail` (`{path, tier, why}`), `batches`, `skipped` (`{path, reason}`), `coverage_before`, `notes`. The order is advice: if your reading of the code says a different file matters more, take it and say why. Tell the user which `skipped` files teammates have in flight. Report every `notes` entry to the user; if one says gh was unavailable, say in-flight PRs were not checked before you take the `coverage` files. Exit 1 means `guardlink unannotated --json` failed: report it and stop. Its `context` field says the intake's state (`none`, `draft`, `confirmed`, `declined`); while it is not confirmed, say once that severities are judged against the draft, and annotate the pick as usual. When the briefing's `SAST:` line shows a run, `bravos sast candidates` lists reachable findings not in the threat model yet: add their files to the pick as leads, open each, and annotate only what meets the evidence bar, as `@exposes` + `@audit` citing the rule and route, or an `@audit` naming a false positive. A static finding is never `@confirmed`. With SAST unavailable or no report, pick as usual.
5. When a Stop hook names files or lines, review those changes first, including already annotated files. Read the actual patch and both sides of a move or deletion. Open each affected handler, guard and caller. With a current graph, ask `codegraph_annotation_gaps` with explicit new-side file ranges for working edits or the merge base for committed changes. Inspect stale and unindexed files and read unsupported routes from source. An existing annotation in the file does not establish that it describes the new behavior. Record the changed threat, guard, or flow, recheck an affected existing claim, or finish the review quietly when the change has no security consequence. Keep ordinary turn-end review to the changed code. Pick the playbook: `diff` files → `diff`; `coverage` files → `coverage`. Deep rounds run `exploitable`, then `chains`, then `coverage`, then `verify`. Add a logic pass when intent.md lists invariants (always at high and max, or when guardlink offers a `logic` playbook use it): walk each user journey that touches an invariant — signup, invite, role change, checkout, refund, export — and at each step ask what it assumes about the caller and the step before: ownership, tenant, state, amount, rate. The sink of a logic claim is the state change (the write, the transfer, the grant); the absent control is the missing ownership or state check. Claim it against the invariant's threat, and make a rule that holds testable. At each place a rule is enforced write the pair: `@exposes <Asset> to #inv-…` and `@mitigates <Asset> against #inv-… using #<control>`. A replay kit binds to an `@exposes`, so a check recorded only as `@mitigates` can never be tested or shown to hold; the pair says where the rule could break and what stops it there (for an `#inv-` rule this is the one `@exposes` written beside a check that is present). Where the permission itself is granted in another file (a role table, a policy file), write a `@mitigates` there too, so a change to it is noticed. A check that is missing and meets the evidence bar is an `@exposes` with an `@audit` and no `@mitigates`; a doubt is an `@audit`. Keep `intent:` and `design:` references on the `@threat` definition only.
6. Open `.claude/skills/guardlink-annotate-<id>/SKILL.md` (guardlink writes it under `.claude/skills/`, and `bravos setup` mirrors it into `.agents/skills/` for Codex) and follow it. Otherwise call the MCP tool `guardlink_annotate` (server `guardlink`) with `prompt: "<scope>"` and `playbook: "<id>"`, or run `guardlink annotate --stdout --playbook <id> "<scope>"` (for the `diff` playbook, `guardlink annotate --stdout --playbook diff --since origin/<base> "<scope>"`, since `--since` defaults to HEAD and would list no changed files), and follow the prompt it returns.
7. Read the repository's annotation mode in `.guardlink/README.md` and its configuration. In inline mode write annotations in the file's comment syntax directly above the code. In external mode update its `.guardlink/annotations/<source-path>.gal` sidecar and anchor the block to the logical source line and symbol using the local GuardLink playbook. Couple the claims: every `@exposes` with its `@mitigates` or `@audit`, the `@flows` the data takes, and a `@comment` on what the code does. Each claim meets the evidence bar: it names the code, the threat and the control by id, and you could point at the line that makes it true.
Rate each `@exposes` by impact × reach × ease, within its threat's band, under intent.md's `## Assumptions` when it has them (the configuration baseline, deployment and attackers in scope; an exposure only an out-of-scope attacker reaches gets an `@audit`, not a severity): impact from the asset's `@handles` class and intent.md's crown jewels; reach from the boundary in front of it (public, then signed-in, then admin-only, then internal; with the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph), `codegraph_auth_boundary` for the route and `codegraph_reachable_sinks` for what the handler reaches; code `codegraph_entry_reach` or `codegraph_dead_code` shows no entry point reaches gets an `@audit` "not reachable per code graph", not a severity; without the graph, judge reach by reading the code and say the graph was unavailable); ease from its preconditions. Write the severity inline and the reason in the description ("high: reachable unauthenticated, touches payment records").
Intended? When the code does what an intent.md `INT-n` item says the product does on purpose, write no `@exposes`: write an `@audit` citing it ("by design per intent.md INT-2; check only admins reach it") and annotate the guard that should hold. When it looks intended but intent.md is silent, write an `@audit` asking "intended?" with your reason, and list it for the user. They answer with a fix, an intent.md line or their own `@accepts`; you never accept it. By design per a decision record? Before you write an `@exposes`, and for every existing one in the files you cover, run `bravos records intended <file>:<line> --threat <id> --json` (free, exact). When it matches, the capability is the product for that actor: write no `@exposes` for it; write an `@audit` citing the item ("by design per SDR-3 NB1; only #admin of the same organisation reaches it"), the `@mitigates` at the check its `holds if:` cites, and the attacker's questions as claims to test, each an `@exposes` paired with that control: someone other than the actor reaching it, the actor reaching another tenant's objects, a replayed or forged session. An existing `@exposes` that matches stays as it is; file its entitlement with `bravos records entitle <file>:<line> --threat <id> --capability <id> [--asset <id>]` and tell the person they accept it on `bravos review records` or at their own terminal (you never accept, reject or edit `.guardlink/entitlement-proposals.json`; the record guard refuses it). "no" with a note that the item reads like a kind but has no `kind:` is not by design: annotate as usual and tell the person what the note says. Who may act on whose object (another tenant, IDOR, missing authorization) is never by design. In a bravos workspace (the briefing's `Workspace:` line, or `.bravos/workspace/workspace.json`), define only this service's own assets, with ids prefixed by the service (`#orders-create`), never another service's; declare each call to another service as `@flows #<this>-<x> -> #<other>-<y> via http|grpc|queue -- "..."` with the other service's own id. Do not write the dotted `#repo.tag` form that guardlink's Workspace Context block suggests: cxg cannot chain it, so the cross-service attack is never tested.
If a patch changes a caller, destination, trust boundary or security control, trace who can reach it, the data crossing it, the guard and where it is enforced. Reconcile the specific `@flows`, `@boundary` and control claims with the new behavior. For tools the application gives an agent, review `@agents` or `@reaches` at registration, `@effects` where the action occurs and `@gates` where approval is enforced. For coding-agent configuration, run `guardlink lookup "unentitled coding-agent reach"` and inspect the changed configuration lines. GuardLink derives the agent's reach from those files. Propose a missing entitlement for the human's decision; report an unapproved capability and the evidence separately from an exploitable finding.
8. Gate: run `guardlink lint . --since <start> --json`. For each entry in `violations[]`, apply its `fix`. Repeat until `summary.errors` is 0. A violation on a line you did not write this session is not yours: leave the line as it is and report it to the user.
9. Run `guardlink validate .` and fix what it reports in the lines you wrote.
10. Run `guardlink ci -f json` again and report `+<files>, <p0>% → <p1>% (<annotated> of <source> files annotated), <errors> lint errors`. Deep only: repeat steps 4–10 once per round, and stop when `coverage` comes back empty or a round adds no claims.
11. On a normal coding turn keep annotations with the code change and preserve the user's staged and uncommitted edits. For a requested standalone coverage slice, 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 slice on its own: `git add` only the annotated files, message `annotate: <n> files, <playbook>`. Ship it as a small PR or on the feature branch, whichever the team does.
12. Read `guardlink hypothesis list --json`. Keep each changed exposure's stable key, source location, sidecar location when applicable, and tested state. Include untested claims with a declared mitigation. Hand new claims to bravos-templatize for a concrete kit; expired or previously tested claims go to bravos-recheck. Apply the recorded proving choice before execution: auto follows bravos-env and bravos-prove in its authorized scope; ask seeks a decision; schedule leaves the claim queued; none records that it was not tested. Evidence from a real run is required before marking a claim confirmed or refuted. Hand the change to bravos-ship before a PR.
When the threat you write is for a scanner finding (a lead from `bravos sast candidates --new`), add the finding's reference to the `@exposes` beside its CWE, as the queue prints it: `@exposes #asset to #threat [high] cwe:CWE-78 sast:bfid1:code:… -- "…"`. Only on an `@exposes` you are writing now: never add a `sast:` reference to, or change one on, an existing claim, because GuardLink keys a claim on its references and a tested claim would lose its result.
## Never
- Run `guardlink annotate` with an agent flag. Use `--stdout` and do the work here.
- Write `@accepts`, `@entitles` or `@confirmed`.
- Apply a lint `fix` to a line this session did not write. For `accepts-written`, `entitles-written` or `confirmed-without-evidence` on someone else's line, never remove or downgrade it: stop and report it to the user.
- Edit or delete an existing claim. If one looks wrong, write an `@audit` beside it saying why.
- Treat an intended-by-design match as an accepted risk, or drop an existing claim because intent.md or a decision record covers it.
- Write, accept or reject an `@entitles`, or edit `.guardlink/entitlement-proposals.json`: you propose (`bravos records entitle`), a person decides.
- Mark a draft intent item confirmed, or run `bravos context decline` for the person: confirming the intent, or going without it, is theirs to decide and to record.
- Open the design documents under `.bravos/context/sources/`. The rules they hold are in intent.md; only bravos-context reads the documents, with a person present.
- Annotate a file `guardlink unannotated` lists under `excluded`.
- Pad coverage with claims that fail the evidence bar. An honest `@exposes` plus `@audit` beats a guessed `@mitigates`.
## Done when
- `guardlink lint . --since <start> --json` reports `summary.errors` 0 and `guardlink validate .` exits 0.
- You reported the delta line from step 10, the files left in `skipped`, and any lint violation on a line you did not write.
- Each new `@exposes` carries a severity with its reason, and every "intended?" `@audit` is listed for the user.
- Each new claim's state is clear: open or mitigated (none accepted by you), untested (an annotation alone confirms or refutes nothing), and verified or stale per `guardlink ci`. Say what was not tested. Do not call the code clean; the lint gate judges annotations, not code.
- You rebuilt the dashboard from the code (`bravos dashboard`, run in the background): opened in their browser if it has not been opened this session, else with `--no-open` and its path given. A background pass only reports its line; the main agent does this and the next step.
- You ended with one recommended next step, said as a recommendation and not as a list of what testing needs: with untested exposures, "let's confirm the top three now", naming them, through bravos-prove on the recorded target, or, with none recorded, "let's set up a target first" through bravos-env (the person types their own authorization); then the next round, or a campaign on the Team plan.
## What it leaves for the next skill
- One commit of annotated files and the list of new `@exposes` ids and files, for bravos-ship.
## Go deeper
- `.claude/skills/guardlink-annotate-exploitable/SKILL.md` — the evidence bar (guardlink writes it under `.claude/skills/`, and `bravos setup` mirrors it into `.agents/skills/` for Codex; otherwise `guardlink annotate --stdout --playbook exploitable "<scope>"` prints the same method).
- `docs/GUARDLINK_REFERENCE.md` — verbs and syntax.
- `.guardlink/README.md` — placement rules for this repo.
Files in this skill
- SKILL.md
- scripts/lib/pick.mjs
- scripts/slice.mjs
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.