security-sweep
Skill76 starsChanged 8 months agoApache-2.0View on GitHub
Graph-driven security sweep -- scan for dangerous sinks, then rank each finding by whether an entry point can actually reach it, and triage the rest into suppressions.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- paulocsb/worldcup-fifa-pooltheir own version, first seen Nov 8, 2026
- Bobagi/claude-skillstheir own version, first seen Oct 29, 2026
- archiforge/agent-crafttheir own version, first seen Oct 20, 2026
- sal1391/ai-app-workspacetheir own version, first seen Oct 11, 2026
- jleavers/codervistheir own version, first seen Sep 27, 2026
- SubliminalCoding/bilbroswagginz-skillstheir own version, first seen Sep 27, 2026
Used with
Projects with it also use test-first.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
claude-worldSkilltest-first
Drive one feature through a strict TDD Red-Green-Refactor cycle with checklists for each phase. Use when implementing new functionality test-first, or when the user runs /test-first.
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 1
- n24q02m/better-code-review-graph★ 76100% same
Edited · 0
None found.
Wrote their own version · 10
- oliwoodman/fable-skills★ 35same name
- eeshsaxena/agent-skills★ 2same name
- 0xmortuex/claude-code-skills★ 0same name
- archiforge/agent-craft★ 0same name
- Bobagi/claude-skills★ 0same name
- ccpowerpack/claude-code-skills★ 0same name
- jleavers/codervis★ 0same name
- paulocsb/worldcup-fifa-pool★ 0same name
- sal1391/ai-app-workspace★ 0same name
- SubliminalCoding/bilbroswagginz-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- build-graphSkill
- review-deltaSkill
- review-prSkill
- impact-auditSkill
- onboard-repoSkill
- refactor-checkSkill
- review-deltaSkill
- review-prSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Command surface: run the local CLI through the coding harness shell.
- Very specific: line 24
When the CLI is missing the command returns {"error": ..., "engine": "semgrep"} with a non-zero exit.
- Distinctive: line 25
Treat that as not run, never as clean.
- Distinctive: line 33
Read the matched line and the parameters of the enclosing function.
- Very specific: line 35
use crg query query --pattern callees_of --target "<node>" --repo-root "<path>" to confirm what the function actually invokes when the …
- Very specific: line 39
add --remove to reverse a suppression
- Distinctive: line 93
Reachability is graph reachability: Call sites reached over HTTP, RPC, a queue, reflection, or a plugin registry produce no edge, so a …
- Distinctive: line 98
Before exposing an internal service to a public network
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Sweep
Scan the codebase for dangerous constructs, then use the graph to answer the question a flat scanner cannot: can untrusted input actually reach this? A medium-severity finding in a request handler outranks a critical one in dead code, and only the call graph can tell them apart.
Command surface: run the local CLI through the coding harness shell. Examples
use the installed crg command; from a source checkout,
prefix it with uv run. No MCP mapping is required.
Steps
- Make the graph current with
crg graph build --base HEAD --repo-root "<path>". Findings are attached to graph nodes, so anything unindexed is unscanned. - Read the active ruleset with
crg security rule_list --engine heuristicbefore scanning, and check which languages each rule declares. This determines what a clean result is worth -- see Coverage Limits below. - Run the Tier 1 scan:
crg security scan --engine heuristic --repo-root "<path>". It returnstotal,by_severity,by_rule,tags_by_node, andsuppressed_count. Tier 1 is regex matching over the source of function, class, and method nodes -- fast, no external tool, no data-flow analysis. - Run Tier 2 when it is available:
crg security scan --engine semgrep --repo-root "<path>". Semgrep is an opt-in extra and is not installed by default.- When the CLI is missing the command returns
{"error": ..., "engine": "semgrep"}with a non-zero exit. - Treat that as not run, never as clean. Report Tier 2 as unavailable instead of silently reporting Tier 1 numbers as the whole picture.
- When the CLI is missing the command returns
- Rank findings by reachability -- the step that makes this a graph sweep rather than a grep. For each tagged node, walk backwards toward the entry points:
crg query query --pattern callers_of --target "<node>" --repo-root "<path>"- Repeat on the callers, two or three hops, until you reach either an entry point (route handler, CLI command, worker, event consumer) or nothing.
- A node with no callers is either dead code or an entry point itself. Distinguish the two before ranking: an unreferenced HTTP handler is the most exposed code in the repository, not the least.
- Confirm the source-to-sink path before filing anything. Tier 1 matches text, not data flow, so a match proves a dangerous construct exists, not that untrusted input reaches it. For each candidate:
- Read the matched line and the parameters of the enclosing function.
- Establish where the tainted value originates. A
subprocesscall built from a hardcoded constant is not an injection; the same call built from a request field is. - use
crg query query --pattern callees_of --target "<node>" --repo-root "<path>"to confirm what the function actually invokes when the match is ambiguous.
- Triage the residue into suppressions. For rules that are structurally inapplicable to this codebase, or findings confirmed as false positives:
crg security suppress --rule-id "<rule_id>" --repo-root "<path>"-- persists to.code-review-graph/security-suppressions.json- add
--removeto reverse a suppression - Suppression is per rule, not per finding, so suppressing a rule hides every current and future match. Record the justification in the report; a suppressed rule that later becomes relevant is a silent regression.
- Export when the result feeds another system:
crg security report --format sarif --repo-root "<path>"returns SARIF v2.1.0; use--format jsonto re-emit the cached payload. Both replay the last scan rather than rescanning. Report:
## Security Sweep: <repo> ### Coverage - **Tier 1 (heuristic)**: N rules active, applicable to <languages> - **Tier 2 (semgrep)**: run / not installed - **Unscanned**: <languages present in the repo with no applicable rules> - **Suppressed rules**: <rule_id -- justification> ### Priority 1 -- Reachable from an entry point - **<rule_id>** (<severity>) at `<file>:<line>` in `<node>` - Reached by: <entry point> -> <caller> -> <node> - Tainted input: <where the value comes from> - Fix: <specific change> ### Priority 2 -- Reachable, input not confirmed untrusted - <finding, and what would have to be true for it to matter> ### Priority 3 -- Not reachable from any entry point - <finding, plus whether the code is dead or merely unreferenced here> ### Dismissed - <finding> -- <why it is not a vulnerability> ### Recommendation 1. <ordered, actionable>
Priority Matrix
Rank on reachability first, severity second. Severity alone over-reports.
| Reachability | CRITICAL / HIGH | MEDIUM | LOW |
| Entry point reaches it with untrusted input | Priority 1 | Priority 1 | Priority 2 |
| Reachable, input provenance unconfirmed | Priority 2 | Priority 2 | Priority 3 |
| No caller path from any entry point | Priority 3 | Priority 3 | Dismiss with note |
| Test fixture or example code | Dismiss with note | Dismiss | Dismiss |
Coverage Limits
State these in the report whenever they apply -- a sweep that hides them is worse than no sweep.
- Tier 1 is not uniformly multi-language. Most shipped rules declare a specific language; only the hardcoded-secret rule applies to every language. On a codebase whose main language has no applicable rules, a zero-finding result means not covered, not no vulnerabilities.
- No data-flow analysis. Tier 1 cannot distinguish a constant from user input; step 6 is mandatory, not optional.
- Only indexed code is scanned. Anything excluded by
.code-review-graphignore, or in a repository not federated into the graph, is invisible. - Findings attach to function, class, and method nodes. Dangerous constructs at module top level or in configuration files are outside this scan.
- Reachability is graph reachability. Call sites reached over HTTP, RPC, a queue, reflection, or a plugin registry produce no edge, so a finding can be reachable in production while the graph shows no path.
When to Use
- Reviewing unfamiliar or inherited code before putting it in front of untrusted input
- Before exposing an internal service to a public network
- Auditing a dependency or vendored subtree that has been indexed into the graph
- Periodically on a service that handles user-supplied data, to catch newly introduced sinks
Related Skills
onboard-repo-- index the codebase and identify entry points firstimpact-audit-- scope the blast radius of the fix once a finding is confirmedreview-delta/review-pr-- catch a new sink at review time rather than in a later sweep
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

