agentleFS
simoncorrysimoncorry/foundry/.claude/skills/security-scan/SKILL.md

security-scan

Skill39 starsChanged 37 days agoMITView on GitHub

Single-round adversarial security scan.

89 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use django-security, deployment-patterns 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.
  • mstuder-slalomSkill

    django-security

    Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.

    Also in 5 projects that use this

  • royaluniondesign-sysSkill

    deployment-patterns

    Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.

    Also in 5 projects that use this

  • mstuder-slalomSkill

    springboot-security

    Spring Security best practices for authn/authz, validation, CSRF, secrets, headers, rate limiting, and dependency security in Java Spring Boot services.

    Also in 4 projects that use this

  • DonTiziSkill

    dependency-check

    Analyze project dependencies for outdated packages, security vulnerabilities, and licensing issues. Use for dependency audits and maintenance.

    Also in 3 projects that use this

  • RojiosSkill

    security-bounty-hunter

    Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.

    Also in 3 projects that use this

  • nek1987Skill

    postgres-patterns

    PostgreSQL patterns for reviewing migrations and writing efficient queries. Use when reviewing Alembic migrations, optimizing queries, or debugging database issues.

    Also in 6 projects that use this

  • +2 more from mstuder-slalom

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 80 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the scan already ran in this conversation, treat this invocation as a fresh pass over the same surface to catch what the first pass …

    line 15
  2. Distinctive:

    If build-it's flow is running (no pull request open yet), any bugs the scan finds get fixed via new commits on the feature branch.

    line 19

“Common” is measured: kept by at least 6 in 10 of the 80 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

Single-round adversarial security scan. Scan a focused surface for findings anchored to named threat classes, argue against each candidate before believing it, and require an articulated reproduction path before anything gets reported. Run it after editing security-sensitive code (auth, payments, user data, anything that parses untrusted input) and BEFORE the implementation-challenge chain.

Guard: nothing to scan

The scan covers the files modified by the agent in this conversation. If none, decline with: "No scan scope detected; make code edits in this conversation first, or name file paths explicitly after the command." Don't invent imaginary changes to scan.

Guard: repeat invocation

If the scan already ran in this conversation, treat this invocation as a fresh pass over the same surface to catch what the first pass missed. Say so explicitly.

Guard: during the chain

If build-it's flow is running (no pull request open yet), any bugs the scan finds get fixed via new commits on the feature branch. Do NOT open a pull request; that's wrap-up's job.

Scope

Files modified by the agent in this conversation, or files explicitly named after the command. Nothing else.

Sequence note

Run the scan BEFORE implementation-challenge round 1 when both are used: any security bug the scan fixes becomes part of the diff the chain then reviews. Reverse order means the chain validates a not-yet-fixed surface. Test-it runs before the scan for the same reason; the scan should see the finished diff, tests included.

Threat classes (define these for your project, once)

The scan only works when the search is anchored to failure modes your project actually has. Write 5-8 threat classes into your project's AGENTS.md or a security doc, each with the concrete surfaces to check, and cross-reference the industry-standard OWASP Top 10 categories where they map. A worked example set for a typical web app with accounts:

  1. Cross-user data exposure (OWASP A01, Broken Access Control). User A seeing user B's data through any read path: list endpoints, search, joins, cached responses.
  2. Authorization bypass (OWASP A01). Actions gated in the UI but not on the server; object IDs accepted from the client without an ownership check.
  3. Injection and composition bugs (OWASP A05, Injection). One component's safe output becoming another's unsafe input: string-built SQL, HTML rendered from stored text, shell commands built from user fields. Trace input to sink, seam by seam.
  4. Resource exhaustion (denial of service). Unbounded loops over client-supplied collections, missing rate limits, queries without limits, large-payload handlers.
  5. Auth and session bugs (OWASP A07, Authentication Failures). Expired tokens accepted, second-factor bypass, replay, session confusion across reconnect or refresh paths.
  6. Data-write authorization (OWASP A01). Missing ownership checks on update and delete, database policies that trust the client, raw queries carrying user input.
  7. Secrets exposure. Keys or tokens in logs, error messages, client bundles, or committed files.

For each class, ask: where in the scoped files could THIS specific failure occur? Be concrete. Not "validation might be missing" but "the message handler at file:line passes payload.text onward without re-running the filter."

Adversarial validation (before reporting anything)

For every candidate finding, switch sides and try to kill it. Does the surrounding architecture already make the path unreachable? Is the "attack" within what the product intends to allow? Could a realistic caller already do the same thing through a sanctioned route? A finding survives only if it grants an attacker capability they don't already have. Drop everything else.

This step exists because scanning agents overstate: they report reachable-looking paths that the wider system already blocks. Hunting and judging are different modes; do them separately, in that order.

Reproduction path requirement

For every finding that survives, articulate the data flow from untrusted input to the vulnerable sink as file:line -> file:line -> file:line. Short paths are fine for resource-exhaustion findings; composition bugs usually take several hops. A finding without an articulable path gets demoted to Hardening or dropped. (Bigger pipelines write an actual reproduction test per finding; for a single-agent scan, the articulated path is the affordable substitute.)

Severity grading (5 tiers)

  • High: directly exploitable under realistic conditions; patch immediately.
  • Medium: exploitable in principle, but needs chained preconditions or unlikely access.
  • Low: real issue, marginal practical impact.
  • Hardening: real pattern, but grants nothing beyond what sanctioned callers already have. Defense-in-depth observation.
  • Not applicable: the threat model didn't survive adversarial validation; dropped from the report.

Auto-fix policy

Same policy as the implementation rounds: high-confidence bugs get fixed now via a new commit on the feature branch (no pull request until wrap-up; in no-git mode, fix in place and log it). Out-of-scope findings become observations. Findings needing the human's call defer with a [NEEDS HUMAN: <one-line ask>] marker, translated to plain English in chat.

End your response with the structured report

Findings before adversarial validation: N.
Demoted by validation as unreachable / sanctioned / not-applicable: M.
Final severity counts: High: K_h. Medium: K_m. Low: K_l. Hardening: K_ha.
Bugs fixed: K.

For each surviving finding: threat class and surface, reproduction path, disposition (fixed inline / fixed in commit / deferred with marker).

No-rubber-stamp guard

Reaching "no findings" without at least one attempted reproduction path per threat class means the scan was skipped, not passed. The classes exist to anchor the search; trace each one against the scoped files. A genuinely clean scan closes with: "Traced [N] threat classes against [M] scoped files; no high-confidence findings."

Rationale (recorded so future edits don't drift it)

The scan's shape adapts Ramp Engineering's write-up "Finding high-severity security issues with publicly available models": threat-class anchoring so the search doesn't wander, an adversarial self-argument step to suppress the overstatement scanning agents reliably exhibit, and a reproduction-path bar so findings are evidence, not vibes. The adversarial step's wording here is our own; the technique and its motivation are theirs, and their multi-agent pipeline (where a validator writes a real test per finding) is the fuller version this single-agent scan approximates.

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.