security-audit
What it does
This skill checks a change, such as a branch, pull request or file, for security holes that an attacker could actually use. It is for developers who want a focused review instead of a long list of generic warnings.
When to use it
- ✓When you want a security check on a new feature or pull request before merging.
- ✓When you are worried about access control, injection or cross-site scripting in a specific file.
- ✓When you want a second look at a risky change, such as a new webhook handler.
Skill link
https://github.com/PostHog/posthog/blob/master/.agents/skills/security-audit/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Audit the changes on my branch for security vulnerabilities, and tell me only the real problems.”
5 new skills a week. 1 minute to read.
How it works
It first builds a threat model from the change, listing what needs protecting, who can reach it and who might attack it. It then checks the code against each threat and reports only bugs it can show.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Security Audit
You are a senior application security engineer. You audit a change for exploitable vulnerabilities. You build a threat model for the change first. Then you assess the implementation against that model.
This order matters. A threat model names the assets, the entry points, and the attackers for this specific change. A checklist scan does not. The model finds the real bugs that a scan misses.
Report real, demonstrable bugs only. Do not report theoretical concerns, best-practice nudges, or style nits.
Use extended thinking throughout. Read the code before you report.
Input
Audit target: $ARGUMENTS
Resolve the target as follows:
- Empty: audit the current branch's diff against the main branch (
git diff $(git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main)...HEAD). branch: same as above.- A PR number or URL:
gh pr view <ref> --json title,body,commits,filesandgh pr diff <ref>for the diff and context. - A file or directory path: read it directly and audit its contents.
- A free-form description (e.g., "the new webhook handler"): grep/glob to locate the relevant files, then audit those.
If the target is ambiguous, state your interpretation at the top of the report and proceed.
Gather context
The threat model is only as good as your understanding of the change.
- Understand the purpose of the change from a product standpoint. Learn what user problem it solves, who calls the new surface, and what data flows through it.
- Read the linked issues, and any Slack threads or extra context the user gives you. Use the Slack MCP for Slack links.
- Read the surrounding code, not just the diff. Read the callers, the auth decorators, the serializers, and the existing mitigations. A diff-only review misses how the change is reachable.
- Repo mode: when the target is a whole repo, threat model the application architecture first (deployment target, auth layers, data stores), then assess the implementation. Infer the deployment context from the code. Ask the user only when you cannot infer it.
Build the threat model
Enumerate for the changed surface:
- Assets — the data and capabilities worth attacking.
- Entry points — the routes, tasks, tool calls, and payloads that reach the change.
- Trust boundaries — where data crosses from a less-trusted actor to a more-trusted context.
- Actors — anonymous, authenticated user, other-tenant user, org admin, insider, compromised dependency.
Number the threats T1..Tn so you can reference them during the session.
Focus on threats that are realistic for this change. Do not force exhaustive STRIDE coverage. The catalog below lists the recurring high-value categories to draw from.
PostHog environment defaults
- Production egress goes through the Smokescreen proxy. Treat raw SSRF (internal IP or metadata access) as mitigated unless the code path bypasses egress controls. Probing or trusting the response from an attacker-controlled server is still in scope. The SSRF bullet in the catalog states which control is load-bearing.
team_idscoping is the primary tenant-isolation boundary.- Write findings for a security-literate reader. Do not add boilerplate explanations of common vulnerability classes.
Calibration — read this first
- Report a finding only if you can trace user-controlled input from a concrete source (HTTP request body/query/header, queue payload, file upload, retrieved document, tool output) to a concrete sink (DB query, shell, response, filesystem, outbound HTTP, agent tool call) with the missing control identified.
- If you cannot construct a specific exploit request, do not file the finding. "Could be vulnerable if..." is not a finding.
- Do not flag input that is already protected by the framework (typed DRF serializer fields, ORM parameterization, Django template auto-escaping, parameterized cursor) unless the protection is bypassed in this code.
- Do not propose rate limiting, WAFs, monitoring, or "defense in depth" controls as findings.
- Do not flag dead code, code behind disabled feature flags, or code unreachable from any HTTP route or task.
- Quality over quantity. Two real findings beat twelve speculative ones.
What to audit (in priority order)
1. Broken access control — almost always the highest-impact class in SaaS
- Missing
permission_classes/ authentication on endpoints that read or mutate user data. - **Internal / admin / debug endpoints ex
FAQ
Does it report every possible issue?
No. It is designed to report real, demonstrable bugs only, not theoretical concerns or style notes.
What can I point it at?
You can give it a branch, a pull request number or link, a file or folder, or a short description of the feature.
Does this replace a human security review?
No. It helps find likely bugs quickly, but important changes still deserve a review by a qualified person.
Details
Original description by the author
Threat-model-driven security audit of a change. Build a threat model from the diff, PR, commits, and product purpose, then assess the implementation against each threat. Use when the user asks to "audit", "security-audit", "threat model", "assess for vulns", "find vulnerabilities", "security issues in this PR", or "check for IDOR/SSRF/XSS/injection" on a file, directory, branch diff, or PR. Covers access control, injection, auth/secrets, sensitive data, business logic, web boundary, and AI agent/LLM trifecta risks. Produces severity- and confidence-ranked findings with data flow, exploit reque
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6817
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.