security-audit
Installation
SKILL.md
Security Audit
Examine code diffs and entrypoints for authorization flaws, race conditions, sensitive data leakage, and improper input validation.
security-audit acts as the third axis in code-review (alongside Standards and Spec) or runs independently over any diff between HEAD and a fixed point. When dispatched as a subagent, always start it with a fresh context window.
Inspection Checklist
Inspect every entrypoint in the diff (API routes, tRPC procedures, Server Actions, GraphQL resolvers, background job handlers, and webhook receivers) against four critical security areas:
1. Authorization and Object Ownership (AuthZ)
- Tenant and user scoping: Does every database query enforce ownership at the query level (for example:
where: { id, organizationId }), rather than fetching the object first and checking permissions in application memory? - Authentication context integrity: Is the actor identity derived securely from trusted server session context rather than from client-supplied parameters in request bodies or query strings?
- Privilege boundaries: Do admin-only procedures explicitly enforce role checks before executing business logic?