agentleFS
sequant-iosequant-io/sequant/.claude/skills/security-review/SKILL.md

security-review

Skill1 starsChanged 3 months agoMITView on GitHub

Deep security analysis for sensitive features (auth, payments, admin, API routes, file operations).

192 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use linkerd-patterns, dependency-cve-sweep and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    linkerd-patterns

    Implement Linkerd service mesh patterns for lightweight, security-focused service mesh deployments. Use when setting up Linkerd, configuring traffic policies, or implementing zero-trust networking with minimal overhead.

    Also in 5 projects that use this

  • berntpoppSkill

    dependency-cve-sweep

    Use when handling Dependabot PRs, CodeQL/Trivy alerts, or doing a routine dependency/CVE sweep for this repo.

    Also in 12 projects that use this

  • berntpoppSkill

    fleet-standard-adoption

    Use when bringing this repo into compliance with a GeneFoundry fleet standard (tool-naming, response-envelope, container-hardening, versioning, MCP transport, or logging) or closing its tracking issue.

    Also in 12 projects that use this

  • HABUBUSSSkill

    project-guidelines-example

    Also in 16 projects that use this

  • niloykumarbarmanSkill

    agent-sort

    Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

    Also in 13 projects that use this

  • royaluniondesign-sysSkill

    configure-ecc

    Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.

    Also in 11 projects that use this

  • +2 more from berntpopp

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 167 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When invoked as /security-review, perform a comprehensive security analysis focused on the specific security domain of the feature being …

    line 29
  2. Very specific:

    Treat 123 as the GitHub issue number.

    line 50
  3. Distinctive:

    Read the GitHub issue for feature details

    line 75
  4. Distinctive:

    Run through the relevant security checklists, marking each item as:

    line 81
  5. Distinctive:

    When working on security-sensitive issues:

    line 274
  6. Distinctive:

    After completing review, log results:

    line 285
  7. Distinctive:

    After completing the security review, post results to the GitHub issue:

    line 295
  8. Distinctive:

    Verify rate limiting configuration

    line 334
  9. Distinctive:

    Check for timing vulnerabilities

    line 346

“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- sequant:local-override -->

Local overrides (read this first). Before following any instruction below, check whether .claude/.local/skills/security-review/overrides.md exists. If it does, read it and treat its contents as authoritative: its instructions take precedence over anything in this skill they conflict with. This is the supported way to tailor /security-review without forking it — overrides.md lives under .claude/.local/, which sequant update and sync never overwrite.

Security Review Command

You are the Security Review Agent for the current repository.

Purpose

When invoked as /security-review, perform a comprehensive security analysis focused on the specific security domain of the feature being implemented.

When to Use

Feature TypeUse /security-review?Focus Areas
Auth flowsYesSession handling, token security, password hashing
PaymentYesPCI compliance, data handling, error messages
Admin featuresYesPrivilege escalation, IDOR, access control
API routes (user data)YesInput validation, auth checks, rate limiting
File operationsYesPath traversal, file type validation, size limits
UI-only changesNoUse /qa security checks
Content updatesNoNo security surface

For lightweight security checks on every issue, use /qa instead.

Behavior

Invocation:

  • /security-review 123:
    • Treat 123 as the GitHub issue number.
    • Analyze the feature being implemented for that issue.
  • /security-review --domain auth:
    • Perform review focused on authentication domain.
  • /security-review --domain api:
    • Perform review focused on API security domain.
  • /security-review --domain admin:
    • Perform review focused on admin/authorization domain.

Process

1. Identify Security Domain

Analyze the feature being implemented to determine which security domain(s) apply:

Auto-detection signals:

  • Authentication: Issue mentions "login", "password", "session", "token", "auth", "logout"
  • Authorization: Files in app/admin/, mentions "role", "permission", "access control"
  • API Security: Files in app/api/, mentions "endpoint", "request", "validation"
  • Data Protection: Mentions "PII", "sensitive", "encrypt", "GDPR", "privacy"
  • Infrastructure: Mentions "env", "secret", "config", "headers", "CSP"
  • File Operations: Mentions "upload", "download", "file", "path"

2. Gather Context

  • Read the GitHub issue for feature details
  • Identify files changed (worktree or PR diff)
  • Determine which security checklists apply

3. Apply Domain-Specific Checklists

Run through the relevant security checklists, marking each item as:

  • Passed (verified secure)
  • Failed (security issue found)
  • Needs Manual Review (cannot verify automatically)
  • N/A (not applicable to this feature)

See references/security-checklists.md for detailed checklist by domain.

Security Checklists by Domain

Authentication (8 items)

#CheckHow to Verify
AUTH-1Password hashing uses bcrypt/argon2 with appropriate costLook for password handling in auth code
AUTH-2Session tokens are cryptographically randomCheck token generation method
AUTH-3Sessions expire appropriatelyCheck session TTL configuration
AUTH-4Logout invalidates session server-sideVerify session deletion on logout
AUTH-5Password reset tokens are single-use and expireCheck reset token handling
AUTH-6Rate limiting on login attemptsLook for rate limiter on auth endpoints
AUTH-7No timing attacks in password comparisonCheck for constant-time comparison
AUTH-8MFA implementation (if applicable)Review MFA flow if present

Authorization (6 items)

#CheckHow to Verify
AUTHZ-1Every endpoint checks authenticationReview middleware/guards on routes
AUTHZ-2Role-based access control properly enforcedCheck RBAC implementation
AUTHZ-3No IDOR vulnerabilities (direct object references)Review ID handling in queries
AUTHZ-4Horizontal privilege escalation preventedCheck user scoping in queries
AUTHZ-5Vertical privilege escalation preventedCheck role checks before actions
AUTHZ-6Admin actions logged for auditVerify audit logging exists

API Security (7 items)

#CheckHow to Verify
API-1Input validation on all parametersCheck validation schemas (Zod, etc.)
API-2Output encoding to prevent XSSReview response sanitization
API-3SQL injection prevention (parameterized queries)Check for raw SQL, string concat
API-4Rate limiting configuredLook for rate limiter middleware
API-5CORS properly configuredCheck CORS headers/config
API-6Error messages don't leak sensitive infoReview error responses
API-7File uploads validated (type, size, name)Check upload handling

Data Protection (5 items)

#CheckHow to Verify
DATA-1Sensitive data encrypted at restCheck database encryption settings
DATA-2Sensitive data encrypted in transitVerify HTTPS enforcement
DATA-3PII handling compliant with privacy policyReview data collection/storage
DATA-4Logs don't contain sensitive dataCheck logging statements
DATA-5Database queries don't expose unauthorized dataReview RLS policies, query filters

Infrastructure (5 items)

#CheckHow to Verify
INFRA-1Environment variables properly protectedNo hardcoded secrets in code
INFRA-2No hardcoded secretsgrep for API keys, passwords
INFRA-3Dependencies up to dateCheck for known vulnerabilities
INFRA-4CSP headers configuredReview security headers
INFRA-5Security headers set (HSTS, X-Frame-Options, etc.)Check Next.js config/middleware

Threat Modeling

For each security review, perform basic threat modeling:

1. Identify Threat Actors

Actor TypeDescriptionRelevance
Anonymous UserUnauthenticated visitorCan they access protected resources?
Authenticated UserLogged in with basic roleCan they escalate privileges?
Admin UserElevated privilegesCan they abuse their access?
Malicious InsiderHas valid credentialsCan they exfiltrate data?
External AttackerNo credentials, probing systemWhat attack surface is exposed?

2. Map Attack Surface

For the feature being reviewed, identify:

  • Inputs: What data does the feature accept? (form fields, URL params, headers)
  • Outputs: What data does the feature expose? (API responses, page content, logs)
  • State Changes: What does the feature modify? (database, files, sessions)
  • External Dependencies: What external systems does it interact with? (APIs, databases)

3. Document Attack Vectors

For each identified risk, document:

  • Attack Vector: How could this be exploited?
  • Impact: What's the worst case scenario?
  • Likelihood: How likely is this attack?
  • Mitigation: What controls are in place?

Report Format

Generate a security review report in this format:

## Security Review: [Feature Name]

**Issue:** #[number]
**Domain(s):** [Authentication | Authorization | API | Data | Infrastructure]
**Risk Level:** [Critical | High | Medium | Low]
**Files Reviewed:** [count]

---

### Threat Model Summary

**Attack Surface:**
- [List of inputs, outputs, state changes]

**Key Threat Actors:**
- [Relevant actors for this feature]

**Primary Attack Vectors:**
- [Top 3 attack vectors identified]

---

### Findings

#### Critical
_Issues requiring immediate attention before merge._

1. **[Finding Title]** (`file:line`)
   - **Issue:** [Description]
   - **Impact:** [Potential damage]
   - **Remediation:** [How to fix]

#### High
_Significant security concerns._

1. **[Finding Title]** (`file:line`)
   - **Issue:** [Description]
   - **Remediation:** [How to fix]

#### Medium
_Issues that should be addressed._

1. **[Finding Title]** (`file:line`)
   - **Issue:** [Description]
   - **Remediation:** [How to fix]

#### Low / Informational
_Best practice recommendations._

1. **[Finding Title]**
   - **Recommendation:** [Suggested improvement]

---

### Checklist Status

| Domain | Passed | Failed | Manual | Total |
|--------|--------|--------|--------|-------|
| Authentication | X | X | X | 8 |
| Authorization | X | X | X | 6 |
| API Security | X | X | X | 7 |
| Data Protection | X | X | X | 5 |
| Infrastructure | X | X | X | 5 |

---

### Verdict

**[SECURE | WARNINGS | ISSUES_FOUND]**

[Summary of overall security posture and recommended actions]

Verdicts

VerdictMeaningAction
SECURENo security issues foundSafe to proceed
WARNINGSMinor issues or items needing manual reviewReview warnings, may proceed
ISSUES_FOUNDSecurity issues requiring remediationFix before merge

Integration with Workflow

Standalone Usage (Manual)

/security-review 493
/security-review --domain auth

As Part of Workflow

When working on security-sensitive issues:

/spec 493    # Plan implementation
/exec 493    # Implement feature
/security-review 493  # Deep security analysis
/qa 493      # Final code review

Logging to workflow_runs

After completing review, log results:

  • Phase: security
  • Verdict: Maps to existing verdict types:
    • SECURE → pass
    • WARNINGS → pass_with_notes
    • ISSUES_FOUND → fail
  • Output Summary: Findings count by severity

Post Review: GitHub Issue Update

After completing the security review, post results to the GitHub issue:

gh issue comment <issue-number> --body "$(cat <<'EOF'
## Security Review Complete

[Include full report from above]

---
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

Examples

Example 1: Admin Feature Review

/security-review 180

Detection: Files in app/admin/, labels include "admin" Domains: Authorization, API Security Focus:

  • AUTHZ-1: Check admin middleware enforces authentication
  • AUTHZ-3: Check for IDOR in city configuration
  • API-6: Verify error messages don't leak city data

Example 2: API Route Review

/security-review --domain api

Focus: API Security checklist (all 7 items) Additional:

  • Review request validation schemas
  • Check response sanitization
  • Verify rate limiting configuration

Example 3: Auth Flow Review

/security-review --domain auth

Focus: Authentication checklist (all 8 items) Additional:

  • Trace session lifecycle
  • Review token handling
  • Check for timing vulnerabilities

Output Verification

Before responding, verify your output includes ALL of these:

  • Security Domain - Identified domains (Auth, API, Admin, Data, Infra)
  • Threat Model Summary - Attack surface, threat actors, attack vectors
  • Findings by Severity - Critical, High, Medium, Low/Informational
  • Checklist Status Table - Passed/Failed/Manual counts per domain
  • Verdict - SECURE, WARNINGS, or ISSUES_FOUND
  • GitHub Comment - Security review posted to issue

DO NOT respond until all items are verified.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.