secure-code-auditor
An open-source Agent Skill that makes AI coding assistants audit backend code for vulnerabilities and write secure-by-default code, with deep Django and Django REST Framework coverage.
- Role
- Author and maintainer.
- Years
- Since 2026
- Status
- Maintained
- Stack
- Agent Skills, Django, Django REST Framework, OWASP, Python, and Security
- Links
The problem
Backend security review is repetitive, and it is easy to do inconsistently. The high-risk areas are well understood: access control, injection, authentication and tokens, serializer exposure, secrets, and deployment settings. The knowledge behind them is spread across a lot of documentation, though, and it changes as Django ships security releases.
secure-code-auditor packages that knowledge as an Agent Skill, so an AI coding assistant applies it the same way every time.
What it does
It works in two modes, chosen from context.
- Review. Asked to review code, it returns findings ordered by severity. Each carries a location, a CWE and an OWASP mapping, the source-to-sink path it was confirmed on, the protection that failed, the impact, and a fix. The report ends with an account of what was examined and what was not, so a quiet report can be told apart from a clean one.
- Write. While it writes new code, it applies secure defaults as it goes: parameterized queries, scoped querysets, explicit serializer fields, correct cookie flags, and secrets from the environment. It closes with a short note on the security decisions it made.
How it is built
The OWASP Top 10 (2025) is the spine. Each category has two layers: a short explanation that holds for any backend stack, then a deep Django and Django REST Framework section with the actual settings, code, and pitfalls. Findings can also carry an OWASP ASVS 5.0 chapter, and agent and MCP tool surfaces follow the OWASP LLM Top 10 and the Agentic Top 10.
Every control is written twice: a review form that says what to flag in existing code, and a write-time form that says what to write before the code exists.
A review starts from an inventory of every way a request, a message, or a schedule reaches application code. Each finding then has to pass a verification gate before it is reported, so a pattern that only looks like a defect is dropped rather than reported with a hedge.
Three read-only scripts help with triage, and all of them parse Python with the ast module rather than matching lines. One lists every entry point and whether it declares its authorization, inherits it, or has none. One reads a whole settings package and names the module each value came from. One flags dangerous patterns.
Where it runs
The skill is plain Markdown, and nothing needs to be built. Claude reads it directly, and Codex CLI, Cursor, and Gemini CLI reuse the same content through their own discovery files. It is licensed under MIT.