|
1 | 1 | # AGENTS.md |
2 | 2 |
|
3 | 3 | This repository is a backend security skill. Its canonical instructions live in |
4 | | -`SKILL.md`, which routes to the topic files under `references/`. Any agent |
5 | | -working in this repo should load `SKILL.md` first and then read only the |
| 4 | +`SKILL.md`, which routes to the topic files under `references/`. An agent that |
| 5 | +works in this repo should load `SKILL.md` first, and then read only the |
6 | 6 | `references/*.md` file(s) relevant to the task. |
7 | 7 |
|
8 | 8 | Primary integration: **Claude** (Anthropic Agent Skills). The files below let |
9 | | -other agents use the same content; they are pointers, not copies. If anything |
10 | | -here disagrees with `SKILL.md`, `SKILL.md` wins. The current version is recorded |
11 | | -in `SKILL.md` frontmatter (`metadata.version`). |
| 9 | +other agents use the same content. They are pointers, not copies. If anything |
| 10 | +here disagrees with `SKILL.md`, `SKILL.md` wins. The current version is |
| 11 | +recorded in `SKILL.md` frontmatter (`metadata.version`). |
12 | 12 |
|
13 | 13 | ## What this skill does |
14 | 14 | Reviews backend code for security issues and applies secure defaults while |
@@ -177,63 +177,65 @@ read differently because one calls `getlist` and the other subscripts the |
177 | 177 | - Review-time: audit existing code, produce prioritized findings (severity, |
178 | 178 | location, CWE + OWASP mapping, an optional ASVS 5.0 chapter, WSTG section, or |
179 | 179 | LLM/Agentic Top 10 entry token where the project is actually held to that |
180 | | - standard, the |
181 | | - shortest source-to-sink path the finding was confirmed on together with the |
182 | | - protection that failed, concrete fix). Read-only by default. Load |
183 | | - `references/01-audit-workflow.md` before any topic file; it owns the sweep |
184 | | - the findings are produced by, and the topic files answer the questions that |
185 | | - sweep generates. |
186 | | -- Write-time: apply the standing secure-default contract while generating code, |
187 | | - apply the secure default where it conflicts with the request and say so, and |
188 | | - close with a short security-decisions note rather than a findings report. The |
189 | | - rule for each generation moment sits beside the control it completes, in the |
190 | | - reference the router already sends you to, so opening a file for the concern |
191 | | - loads the rule for writing it. |
192 | | -Mode selection, both output formats, the severity rubric including how a race |
193 | | -and a surviving-personal-data failure are rated, the baseline severity table |
194 | | -that makes an ordinary finding class reproducible between runs while the rubric |
195 | | -keeps deciding the borderline one, the ASVS 5.0 chapter mapping with the |
196 | | -chapters this skill treats as non-goals, the conflict rule, and the convention |
197 | | -that every control is stated in a review form and a write-time form together |
198 | | -are defined in `references/00-methodology-and-severity.md`. |
| 180 | + standard, the shortest source-to-sink path the finding was confirmed on |
| 181 | + together with the protection that failed, concrete fix). Read-only by |
| 182 | + default. Load `references/01-audit-workflow.md` before any topic file. It |
| 183 | + owns the sweep that produces the findings, and the topic files answer the |
| 184 | + questions that sweep generates. |
| 185 | +- Write-time: apply the standing secure-default contract while you generate |
| 186 | + code. Apply the secure default where it conflicts with the request, and say |
| 187 | + so. Close with a short security-decisions note rather than a findings report. |
| 188 | + The rule for each generation moment sits beside the control it completes, in |
| 189 | + the reference the router already sends you to. A file opened for the concern |
| 190 | + therefore loads the rule for writing it. Mode selection, both output formats, |
| 191 | + the severity rubric including how a race and a surviving-personal-data |
| 192 | + failure are rated, the baseline severity table that makes an ordinary finding |
| 193 | + class reproducible between runs while the rubric keeps deciding the |
| 194 | + borderline one, the ASVS 5.0 chapter mapping with the chapters this skill |
| 195 | + treats as non-goals, the conflict rule, and the convention that every control |
| 196 | + is stated in a review form and a write-time form together are defined in |
| 197 | + `references/00-methodology-and-severity.md`. |
199 | 198 |
|
200 | 199 | ## How to use the content |
201 | 200 | 1. Read `SKILL.md` for the router, mode logic, and severity summary. |
202 | 201 | 2. At review-time, read `references/01-audit-workflow.md` next and run its |
203 | | - phases; the entry-point inventory decides which topic files are needed and |
| 202 | + phases. The entry-point inventory decides which topic files are needed, and |
204 | 203 | the coverage ledger records what each pass reached. That file also carries |
205 | | - the WSTG mapping at section granularity, which says which testing-guide |
206 | | - sections this sweep covers and which are declared non-goals rather than |
207 | | - gaps. |
| 204 | + the WSTG mapping at section granularity. That mapping says which |
| 205 | + testing-guide sections this sweep covers, and which are declared non-goals |
| 206 | + rather than gaps. |
208 | 207 | 3. Open the `references/*.md` file(s) for the concern in front of you. The |
209 | 208 | router is grouped — the OWASP Top 10:2025 spine, then cross-cutting |
210 | 209 | surfaces, then package decisions — so pick the group, then the row. |
211 | 210 | 4. Where two rows could both match, the "Ownership and boundaries" section |
212 | | - below the router names the single owning file for each contested topic, as a |
213 | | - table of topic, owner, and the distinction that decides a case near the |
214 | | - boundary; three splits keep a paragraph because a row would misstate the |
| 211 | + below the router names the single owning file for each contested topic. It |
| 212 | + is a table of topic, owner, and the distinction that decides a case near the |
| 213 | + boundary. Three splits keep a paragraph, because a row would misstate the |
215 | 214 | axis they turn on. Every other file cross-references the owner rather than |
216 | | - restating its rules, and each reference file repeats its own half of that |
| 215 | + restates its rules, and each reference file repeats its own half of that |
217 | 216 | rule in its opening paragraph. |
218 | 217 | 5. Optional read-only triage (standard library only, no network; `--json` on any |
219 | 218 | of the three is JSON Lines, one object per line, consumed a record at a time): |
220 | 219 | - `python scripts/entrypoint_inventory.py path/to/project --settings path/to/settings --json` |
221 | 220 | - `python scripts/settings_scan.py path/to/settings/ --json` |
222 | 221 | - `python scripts/dangerous_patterns.py path/to/project` |
223 | 222 | - `python scripts/dangerous_patterns.py path/to/project --json --min-severity MEDIUM` |
224 | | - - `python scripts/dangerous_patterns.py --selftest` |
225 | | -All three parse with the `ast` module rather than grepping lines, so a hit is a |
226 | | -structural match rather than a text one, every row names the reference file that |
227 | | -owns it, a `dangerous_patterns.py` hit additionally carries a stable rule |
228 | | -identifier, and a file that fails to parse is reported as unparsed rather than |
229 | | -skipped in silence. Every `--json` stream ends with one `kind: "summary"` |
230 | | -record, so an empty stream never occurs. The inventory enumerates the declared entry points the sweep |
231 | | -starts from — routes at their include-resolved prefix, routers and actions, |
232 | | -Ninja, GraphQL, gRPC, Channels, Celery, commands, signals, admin, middleware — |
233 | | -marking each HTTP-reachable row as declaring its authorization, inheriting it, |
234 | | -or having none, and the settings scan reads a whole settings package rather than |
235 | | -one module, naming which module each effective value came from. Treat script |
236 | | -output as leads to verify, not confirmed findings. |
| 223 | + - `python scripts/dangerous_patterns.py --selftest` All three parse with the |
| 224 | + `ast` module rather than match lines, so a hit is a structural match |
| 225 | + rather than a text one. Every row names the reference file that owns it. A |
| 226 | + `dangerous_patterns.py` hit also carries a stable rule identifier. A file |
| 227 | + that fails to parse is reported as unparsed rather than skipped in |
| 228 | + silence. Every `--json` stream ends with one `kind: "summary"` record, so |
| 229 | + an empty stream never occurs. |
| 230 | + |
| 231 | + The inventory enumerates the declared entry points the sweep starts from — |
| 232 | + routes at their include-resolved prefix, routers and actions, Ninja, |
| 233 | + GraphQL, gRPC, Channels, Celery, commands, signals, admin, middleware. It |
| 234 | + marks each HTTP-reachable row as one of three states: it declares its |
| 235 | + authorization, it inherits it, or it has none. The settings scan reads a |
| 236 | + whole settings package rather than one module, and names which module each |
| 237 | + effective value came from. Treat script output as leads to verify, not |
| 238 | + confirmed findings. |
237 | 239 |
|
238 | 240 | ## Tool-specific entry points |
239 | 241 | - Claude Code: `SKILL.md` (native Agent Skill). |
|
0 commit comments