MANDATORY procedure for any pr_review task whose rubric is `pr-security-v1` or whose prompt asks for a security review. Read this skill FIRST before reading the PR diff. Defines the sequential recon → hunt → self-validate → trace → dedup → report pipeline a single agent must run against a PR. Without it, the review will be incomplete and the structured output will be rejected.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
You are reviewing a GitHub pull request for security risk introduced by the diff — not for correctness, complexity, or style. Other workflows already cover those.
You are one agent, not a fleet. You will compensate for the absence of fan-out by running each pipeline phase explicitly and recording what you found before moving on.
pr_review complexity runs.gh pr view <n> --repo <slug> — PR title, body, commits, head ref.gh pr diff <n> --repo <slug> — full unified diff.gh pr diff <n> --repo <slug> --name-only — changed file list.Read — read any file in the workspace; use to inspect callers and surrounding code.Grep / Bash — search the workspace for caller patterns, schema definitions, validators.Do not invoke write tools (Edit, Write, git commit, gh pr edit, etc.) except the one explicit gh pr comment call in the Report phase.
When evaluating the diff, give extra attention to these MoltNet-specific patterns:
kid lookups, expiry. Look for new routes that skip the auth plugin or use optionalAuth where required-auth was needed.check call before mutation. Removed/weakened checks are critical findings.MOLTNET_TEAM_ID and diary ownership must scope every diary/entry query. Cross-tenant leakage is critical.additionalProperties: false. Bypassing validation, threading unknown inward, or moving validation past the boundary is a finding..env. Adding a plain entry to env.public for a secret is a finding.You MUST execute every phase below, in order, and write the phase output to a scratch buffer (your own working memory) before moving on. Do not skip phases even on small diffs — the structure is what compensates for being a single agent.
gh pr view <n> --repo <slug>.gh pr diff <n> --repo <slug>.gh pr diff <n> --repo <slug> --name-only.<surfaces>, the data flow into the changed code is <source → sink>, the existing auth/validation guards on the affected paths are <list>."Recon output: a list of (file, layer, risk_surfaces, data_flow_summary) tuples.
For each rubric criterion (injection_safety, authn_authz_integrity, crypto_handling, secret_hygiene, input_validation, dependency_risk, safe_failure_modes), walk the diff with that lens. For every candidate finding record:
Be aggressive in Phase 2. False positives are filtered in Phase 3. False negatives are not.
Hunt output: a flat list of candidate findings.
For every candidate finding from Phase 2, try to disprove it before accepting it. Read the surrounding code, callers, and any validation/auth plugins the path passes through. Specifically check:
For each candidate, record one of:
info if it was low, and note the uncertainty in the rationale.Self-validate output: filtered findings list.
For every CONFIRMED or UNCERTAIN finding, walk the data flow from the system boundary to the sink and record it as a chain:
HTTP body / MCP arg / webhook payload / queue event
→ handler entry (file:line)
→ validator (or absence of validator)
→ business logic
→ sink (file:line)If the chain breaks (input never reaches the sink), the finding is REFUTED — drop it. If the chain is complete, the trace strengthens the finding; include the chain in the PR comment.
If you cannot trace the chain in a reasonable time budget, mark the finding info and note "reachability not traced within budget" in the rationale.
Trace output: each surviving finding now carries a data-flow chain or an explicit "not traced" note.
Cluster findings by root cause, not by location. Two findings that both flow from the same missing TypeBox schema are one finding with two affected sites. Two findings that report the same risk at the same line are obviously one.
For each cluster:
Dedup output: final findings list, ordered by severity (critical → info).
Post exactly one PR comment with gh pr comment <n> --repo <slug> --body <markdown> containing, in this order:
## Security review (advisory)### <severity>: <one-line title>Then produce the structured task output the runtime expects (PrReviewOutput): scores array per rubric criterion (boolean 0/1), composite, verdict.
safe_failure_modes based on absence of try/catch — fail-closed is about behavior, not syntax.The PR comment is human-facing; the PrReviewOutput structured output is machine-facing. They must agree:
injection_safety: 0, the comment must contain at least one finding citing that criterion.1, the comment must say so in the per-criterion table.5daa9ca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.