Agent Skill
Security review (Sentry)
Sentry's security code review skill: checks that input is really attacker-controlled before flagging it, and reports only the high-confidence findings.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkInstall
Commands are pinned to commit a582c51, the version we read, wherever the install method supports it.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill security-review -a claude-codeCopies the skill into .claude/skills/ in this project, pinned to the reviewed commit.
Plugin marketplace
/plugin marketplace add getsentry/skills
/plugin install sentry-skills@sentry-skillsRun inside Claude Code. Installs the whole sentry-skills plugin from its default branch, not the pinned commit.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill security-review -a codexInstalls to .agents/skills/, which Codex scans from the working directory up to the repo root.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill security-review -a cursorInstalls to .agents/skills/, one of the folders Cursor reads skills from.
gh skill
gh skill install getsentry/skills skills/security-review --pin a582c51ee29d0f35e6ac321340796f77d43da733 --agent github-copilotNeeds GitHub CLI 2.90.0 or later. Use --scope user to install for every repository.
npx skills
npx skills add getsentry/skills@a582c51ee29d0f35e6ac321340796f77d43da733 --skill security-reviewPinned to the commit we reviewed. The CLI asks which agents to install for; add -g to install for your user instead of this project.
What it does
Sentry’s security code review, built to keep false positives down. The key distinction is between what the agent reports on (only the file, diff or code you gave it) and what it researches (the whole codebase). Before flagging anything it must trace where the input comes from, look for validation elsewhere, check configuration and middleware, and account for framework protections. Findings are graded by confidence: high when a vulnerable pattern meets confirmed attacker-controlled input (reported with a severity), medium when the input source is unclear (listed under “needs verification”), and low, meaning theoretical or best practice, which is not reported at all. A “do not flag” list covers server-controlled values such as URLs from settings, and patterns the framework already handles. Language guides for JavaScript and Python, a Docker guide and 17 vulnerability references load only when relevant.
How it compares with differential-review
Trail of Bits’ differential review is built around a change: blast radius, Git history, test coverage of modified lines, and a written report scaled to the size of the codebase. This skill is built around confidence in individual findings. For a pull request, run differential review for breadth. For “is this module safe?”, or when your team is tired of noisy findings, this one is the better fit.
When to use it
Reviewing a file, endpoint or diff for injection, XSS, broken auth or authorisation, insecure crypto and leaked secrets, where you want a short list you can act on.
When to skip it
Threat modelling a whole system (security threat model), and dependency risk (supply chain risk auditor).
Try it
Security review app/api/orders/. Research the whole codebase to confirm
where each input comes from, report only high-confidence findings with
severity and a fix, and list anything uncertain under "needs verification".
What it can touch
- Bundles scripts
- No
- Pre-approved tools
- Read Grep Glob Bash Task
- Needs
- Nothing beyond the agent
- Client-specific fields
- None, spec fields only
Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.
allowed-tools pre-approves Read Grep Glob Bash Task in clients that honour it. Task lets it start subagents for research. It does not edit code. No scripts.
At commit a582c51 the SKILL.md is 304 lines long. Alongside it:
infrastructure/(1 entry)languages/(2 entries)references/(17 entries)LICENSESPEC.md
The vulnerability references are derived from the OWASP Cheat Sheet Series, which is licensed CC BY-SA 4.0; the bundled LICENSE file covers that material, and the skill otherwise sits in Sentry’s Apache-2.0 repository.
SKILL.md
The file exactly as published at the reviewed commit, reproduced under its Apache-2.0 licence.
---
name: security-review
description: Security code review for vulnerabilities. Use when asked to "security review", "find vulnerabilities", "check for security issues", "audit security", "OWASP review", or review code for injection, XSS, authentication, authorization, cryptography issues. Provides systematic review with confidence-based reporting.
allowed-tools: Read Grep Glob Bash Task
license: LICENSE
---
<!--
Reference material based on OWASP Cheat Sheet Series (CC BY-SA 4.0)
https://cheatsheetseries.owasp.org/
-->
# Security Review Skill
Identify exploitable security vulnerabilities in code. Report only **HIGH CONFIDENCE** findings—clear vulnerable patterns with attacker-controlled input.
## Scope: Research vs. Reporting
**CRITICAL DISTINCTION:**
- **Report on**: Only the specific file, diff, or code provided by the user
- **Research**: The ENTIRE codebase to build confidence before reporting
Before flagging any issue, you MUST research the codebase to understand:
- Where does this input actually come from? (Trace data flow)
- Is there validation/sanitization elsewhere?
- How is this configured? (Check settings, config files, middleware)
- What framework protections exist?
**Do NOT report issues based solely on pattern matching.** Investigate first, then report only what you're confident is exploitable.
## Confidence Levels
| Level | Criteria | Action |
|-------|----------|--------|
| **HIGH** | Vulnerable pattern + attacker-controlled input confirmed | **Report** with severity |
| **MEDIUM** | Vulnerable pattern, input source unclear | **Note** as "Needs verification" |
| **LOW** | Theoretical, best practice, defense-in-depth | **Do not report** |
## Do Not Flag
### General Rules
- Test files (unless explicitly reviewing test security)
- Dead code, commented code, documentation strings
- Patterns using **constants** or **server-controlled configuration**
- Code paths that require prior authentication to reach (note the auth requirement instead)
### Server-Controlled Values (NOT Attacker-Controlled)
These are configured by operators, not controlled by attackers:
| Source | Example | Why It's Safe |
|--------|---------|---------------|
| Django settings | `settings.API_URL`, `settings.ALLOWED_HOSTS` | Set via config/env at deployment |
| Environment variables | `os.environ.get('DATABASE_URL')` | Deployment configuration |
| Config files | `config.yaml`, `app.config['KEY']` | Server-side files |
| Framework constants | `django.conf.settings.*` | Not user-modifiable |
| Hardcoded values | `BASE_URL = "https://api.internal"` | Compile-time constants |
**SSRF Example - NOT a vulnerability:**
```python
# SAFE: URL comes from Django settings (server-controlled)
response = requests.get(f"{settings.SEER_AUTOFIX_URL}{path}")
```
**SSRF Example - IS a vulnerability:**
```python
# VULNERABLE: URL comes from request (attacker-controlled)
response = requests.get(request.GET.get('url'))
```
### Framework-Mitigated Patterns
Check language guides before flagging. Common false positives:
| Pattern | Why It's Usually Safe |
|---------|----------------------|
| Django `{{ variable }}` | Auto-escaped by default |
| React `{variable}` | Auto-escaped by default |
| Vue `{{ variable }}` | Auto-escaped by default |
| `User.objects.filter(id=input)` | ORM parameterizes queries |
| `cursor.execute("...%s", (input,))` | Parameterized query |
| `innerHTML = "<b>Loading...</b>"` | Constant string, no user input |
**Only flag these when:**
- Django: `{{ var|safe }}`, `{% autoescape off %}`, `mark_safe(user_input)`
- React: `dangerouslySetInnerHTML={{__html: userInput}}`
- Vue: `v-html="userInput"`
- ORM: `.raw()`, `.extra()`, `RawSQL()` with string interpolation
## Review Process
### 1. Detect Context
What type of code am I reviewing?
| Code Type | Load These References |
|-----------|----------------------|
| API endpoints, routes | `authorization.md`, `authentication.md`, `injection.md` |
| Django/DRF views, permission classes, object-level access | Use the `django-access-review` skill if available for access control; otherwise `authorization.md` |
| Frontend, templates | `xss.md`, `csrf.md`, `modern-threats.md` (DOM clobbering, prototype pollution) |
| File handling, uploads | `file-security.md` |
| Crypto, secrets, tokens | `cryptography.md`, `data-protection.md` |
| Data serialization | `deserialization.md` |
| External requests | `ssrf.md` |
| Business workflows | `business-logic.md` |
| GraphQL, REST design | `api-security.md` |
| Config, headers, CORS | `misconfiguration.md` |
| CI/CD, dependencies | `supply-chain.md` |
| Error handling | `error-handling.md` |
| Audit, logging | `logging.md` |
| Object merging/cloning, `__proto__`, DOM `id`/`name` lookups, WebSocket handlers, LLM prompt construction | `modern-threats.md` |
### 2. Load Language Guide
Based on file extension or imports:
| Indicators | Guide |
|------------|-------|
| `.py`, `django`, `flask`, `fastapi` | `languages/python.md` |
| `.js`, `.ts`, `express`, `react`, `vue`, `next` | `languages/javascript.md` |
For other languages there is no dedicated guide; rely on the `references/` files and verify framework protections directly in the codebase.
### 3. Load Infrastructure Guide (if applicable)
| File Type | Guide |
|-----------|-------|
| `Dockerfile`, `.dockerignore` | `infrastructure/docker.md` |
| GitHub Actions workflows | Use the `gha-security-review` skill if available; otherwise `references/supply-chain.md` |
| Other CI/CD pipelines, lockfiles, package manifests | `references/supply-chain.md` |
### 4. Research Before Flagging
**For each potential issue, research the codebase to build confidence:**
- Where does this value actually come from? Trace the data flow.
- Is it configured at deployment (settings, env vars) or from user input?
- Is there validation, sanitization, or allowlisting elsewhere?
- What framework protections apply?
Only report issues where you have HIGH confidence after understanding the broader context.
### 5. Verify Exploitability
For each potential finding, confirm:
**Is the input attacker-controlled?**
| Attacker-Controlled (Investigate) | Server-Controlled (Usually Safe) |
|-----------------------------------|----------------------------------|
| `request.GET`, `request.POST`, `request.args` | `settings.X`, `app.config['X']` |
| `request.json`, `request.data`, `request.body` | `os.environ.get('X')` |
| `request.headers` (most headers) | Hardcoded constants |
| `request.cookies` (unsigned) | Internal service URLs from config |
| URL path segments: `/users/<id>/` | Database content from admin/system |
| File uploads (content and names) | Signed session data |
| Database content from other users | Framework settings |
| WebSocket messages | |
**Does the framework mitigate this?**
- Check language guide for auto-escaping, parameterization
- Check for middleware/decorators that sanitize
**Is there validation upstream?**
- Input validation before this code
- Sanitization libraries (DOMPurify, bleach, etc.)
### 6. Report HIGH Confidence Only
Skip theoretical issues. Report only what you've confirmed is exploitable after research.
---
## Severity Classification
| Severity | Impact | Examples |
|----------|--------|----------|
| **Critical** | Direct exploit, severe impact, no auth required | RCE, SQL injection to data, auth bypass, hardcoded secrets |
| **High** | Exploitable with conditions, significant impact | Stored XSS, SSRF to metadata, IDOR to sensitive data |
| **Medium** | Specific conditions required, moderate impact | Reflected XSS, CSRF on state-changing actions, path traversal |
| **Low** | Defense-in-depth, minimal direct impact | Missing headers, verbose errors, weak algorithms in non-critical context |
---
## Quick Patterns Reference
### Always Flag (Critical)
```
eval(user_input) # Any language
exec(user_input) # Any language
pickle.loads(user_data) # Python
yaml.load(user_data) # Python (not safe_load)
unserialize($user_data) # PHP
deserialize(user_data) # Java ObjectInputStream
shell=True + user_input # Python subprocess
child_process.exec(user) # Node.js
```
### Always Flag (High)
```
innerHTML = userInput # DOM XSS
dangerouslySetInnerHTML={user} # React XSS
v-html="userInput" # Vue XSS
f"SELECT * FROM x WHERE {user}" # SQL injection
`SELECT * FROM x WHERE ${user}` # SQL injection
os.system(f"cmd {user_input}") # Command injection
```
### Always Flag (Secrets)
```
password = "hardcoded"
api_key = "sk-..."
AWS_SECRET_ACCESS_KEY = "..."
private_key = "-----BEGIN"
```
### Check Context First (MUST Investigate Before Flagging)
```
# SSRF - ONLY if URL is from user input, NOT from settings/config
requests.get(request.GET['url']) # FLAG: User-controlled URL
requests.get(settings.API_URL) # SAFE: Server-controlled config
requests.get(f"{settings.BASE}/{x}") # CHECK: Is 'x' user input?
# Path traversal - ONLY if path is from user input
open(request.GET['file']) # FLAG: User-controlled path
open(settings.LOG_PATH) # SAFE: Server-controlled config
open(f"{BASE_DIR}/{filename}") # CHECK: Is 'filename' user input?
# Open redirect - ONLY if URL is from user input
redirect(request.GET['next']) # FLAG: User-controlled redirect
redirect(settings.LOGIN_URL) # SAFE: Server-controlled config
# Weak crypto - ONLY if used for security purposes
hashlib.md5(file_content) # SAFE: File checksums, caching
hashlib.md5(password) # FLAG: Password hashing
random.random() # SAFE: Non-security uses (UI, sampling)
random.random() for token # FLAG: Security tokens need secrets module
```
---
## Output Format
```markdown
## Security Review: [File/Component Name]
### Summary
- **Findings**: X (Y Critical, Z High, ...)
- **Risk Level**: Critical/High/Medium/Low
- **Confidence**: High/Mixed
### Findings
#### [VULN-001] [Vulnerability Type] (Severity)
- **Location**: `file.py:123`
- **Confidence**: High
- **Issue**: [What the vulnerability is]
- **Impact**: [What an attacker could do]
- **Evidence**:
```python
[Vulnerable code snippet]
```
- **Fix**: [How to remediate]
### Needs Verification
#### [VERIFY-001] [Potential Issue]
- **Location**: `file.py:456`
- **Question**: [What needs to be verified]
```
If no vulnerabilities found, state: "No high-confidence vulnerabilities identified."
---
## Reference Files
### Core Vulnerabilities (`references/`)
| File | Covers |
|------|--------|
| `injection.md` | SQL, NoSQL, OS command, LDAP, template injection |
| `xss.md` | Reflected, stored, DOM-based XSS |
| `authorization.md` | Authorization, IDOR, privilege escalation |
| `authentication.md` | Sessions, credentials, password storage |
| `cryptography.md` | Algorithms, key management, randomness |
| `deserialization.md` | Pickle, YAML, Java, PHP deserialization |
| `file-security.md` | Path traversal, uploads, XXE |
| `ssrf.md` | Server-side request forgery |
| `csrf.md` | Cross-site request forgery |
| `data-protection.md` | Secrets exposure, PII, logging |
| `api-security.md` | REST, GraphQL, mass assignment |
| `business-logic.md` | Race conditions, workflow bypass |
| `modern-threats.md` | Prototype pollution, LLM injection, WebSocket |
| `misconfiguration.md` | Headers, CORS, debug mode, defaults |
| `error-handling.md` | Fail-open, information disclosure |
| `supply-chain.md` | Dependencies, build security |
| `logging.md` | Audit failures, log injection |
### Language Guides (`languages/`)
- `python.md` - Django, Flask, FastAPI patterns
- `javascript.md` - Node, Express, React, Vue, Next.js
### Infrastructure (`infrastructure/`)
- `docker.md` - Container securityRelated skills
Differential security review (Trail of Bits)
Trail of Bits' security-focused review of a PR, commit or diff that scales its depth to the change, measures blast radius and writes a Markdown report.
Find bugs (Sentry)
Reviews the changes on your current branch for bugs and security issues: gathers the full diff, maps attack surface, then runs a checklist per file.
False-positive check (Trail of Bits)
Verifies a suspected vulnerability and returns a true or false positive verdict with evidence. For checking findings, not hunting for new ones.
Guides and recipes that use Security review (Sentry)
- Security-review a pull request with an agent
Run an AI security code review of one pull request with Trail of Bits' differential-review skill, then test each finding with fp-check before anyone acts on it.
- AI code review
Using models to review pull requests, and reviewing AI-written code critically.