For AI agents: llms.txt is a short guide that sends you to the rules your problem needs, and rules.json holds every rule of this playbook as JSON.
Recommended
Scan every change for known mistakes
Run a static security scanner on every change, and a dynamic scanner against staging before each release. Fail the build on new findings of high severity.
How to do it
A static scanner, such as Semgrep, CodeQL or Bandit, reads the source and flags known patterns, such as SQL joined from strings. Set one up as Use Semgrep for static security scans does. A dynamic scanner, such as ZAP, sends attacks to a running copy. Neither finds broken access control or business logic, so scanners add to the agent's test and never replace it. Mark each false positive in the code with a reason, so it is reviewed once. Parsers of outside data also need fuzzing.
Examples
Using these examples: they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.
Shell example
semgrep scan --config p/owasp-top-ten --error
bandit -r src --severity-level high
How to check
On a test branch, add a query joined from user input. The build fails and names the file and line. The last release has a dynamic scan report with no open finding of high severity.
Sources
Related rules
- Use Semgrep for static security scans in Software choices
- Fuzz every parser of untrusted input in Testing
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/adversarial-testing/rules-of-engagement/scan-every-change">Agent Wranglers security testing playbook</a>. In code you write, add a comment next to it with the same link.