agentleFS
dafaalzdafaalz/agent-skills/skills/security-audit/SKILL.md

security-audit

Skill2 starsChanged 2 months agoMITView on GitHub

Use when auditing codebases for security vulnerabilities, conducting threat modeling, reviewing auth boundaries, evaluating exploitability, or verifying security fixes. Don't use for feature development, code formatting, or routine dependency upgrades.

140 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use asset-spec, create-control-manifest 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.
  • cenconq25Skill

    asset-spec

    Generates per-asset visual specifications and AI-generation prompts from PRDs and the design bible. Produces structured spec files and updates a master asset manifest. Use after design bible is approved and a UX spec or PRD identifies assets to produce. Output: design/assets/<asset>.md plus design/assets/manifest.md.

    Also in 5 projects that use this

  • cenconq25Skill

    create-control-manifest

    Produces a flat, immediately-actionable rules sheet — do this, never do that, per system and per layer — extracted from accepted ADRs, technical preferences, and framework reference docs. More directly usable than ADRs for day-to-day implementation. Run after /architecture-review passes.

    Also in 5 projects that use this

  • +10 more from cenconq25

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When user intent between modes is ambiguous, ask one clarifying question before creating files or starting the full workflow.

    line 17
  2. Distinctive:

    No external network access.

    line 30
  3. Distinctive:

    Read-only target source and toolchain mounts.

    line 32
  4. Distinctive:

    Use dummy principals, fixtures, and tokens.

    line 35
  5. Distinctive:

    Follow these seven sequential phases in full audit mode.

    line 84
  6. Distinctive:

    Ask clarifying questions one at a time with concrete options and recommendations if scope boundaries or test harnesses require confirmation.

    line 102
  7. Distinctive:

    Wait for explicit user confirmation before proceeding.

    line 103
  8. Distinctive:

    Run a coverage critic wave after hunter execution to identify gaps or reassignments.

    line 112
  9. Very specific:

    Write all final records to findings.json.

    line 130
  10. Distinctive:

    Run a final verification pass across all confirmed records before reporting.

    line 138
  11. Distinctive:

    Only confirmed records receive severity ratings.

    line 156

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

Security audit

Find source-grounded vulnerabilities that violate a real trust boundary, then give owners source evidence, safe reproduction steps, priority calibration, and the smallest effective fix. This is a defensive, source-first workflow. A candidate without an affected principal, concrete resource, and observable security outcome is not a confirmed finding.

Operating modes

This skill operates in guidance mode by default. Loading it does not authorize unsolicited file creation or execution of the full audit workflow.

  • Guidance mode. For security questions, focused reviews, methodology checks, triage, or investigating specific findings, use only the relevant parts of this skill. Do not create run directories or audit report files. Launch focused subagents when helpful and return results directly to the active task.
  • Full audit mode. Use the complete workflow only when the user explicitly requests an audit of a codebase, asks for an end-to-end security review, or requests formal report artifacts. Run all phases in sequence and write the required artifacts.

When user intent between modes is ambiguous, ask one clarifying question before creating files or starting the full workflow.

Platform terminology and roles

This skill coordinates specialized agent roles:

  • Parent. The orchestrator that owns run metadata, directory setup, and shared state files.
  • Task tool. The platform delegation or subagent mechanism.
  • Research agent. A read-only subagent for source exploration and factual verification without disk modifications.
  • General agent. A delegated subagent for bounded investigation, sandboxed reproduction, and isolated verification.

Universal execution safety

These invariants apply across all modes. Source inspection is strictly read-only. Run target-controlled builds, tests, processes, browsers, and parsers only inside an OS-enforced sandbox providing:

  • No external network access. Use an isolated loopback namespace only when testing local client or server traffic.
  • An empty environment populated from an explicit allowlist with safe values, using scratch-local directories for temporary files and caches.
  • Read-only target source and toolchain mounts. Target-controlled processes may write only inside their assigned scratch directory.
  • Strict limits on CPU, memory, process count, file size, disk usage, and wall-clock duration.

Use dummy principals, fixtures, and tokens. Never probe deployed endpoints, external services, shared infrastructure, production identities, or live control planes. If a decisive fact cannot be evaluated locally or through source analysis, record it as needing validation.

Full audit setup

In full audit mode, resolve these configuration values before reconnaissance:

  • Skill directory. The absolute path to this skill directory.
  • Target. The absolute repository root under audit.
  • Repo name. A stable repository identifier from the directory or local git remote.
  • Output directory. A writable directory outside the target, defaulting to ~/security-audit-skill/<repo-name>/run-<N>, where <N> is the next unused integer.
  • Source ref. The reviewed commit hash and worktree status.

Write isolation

The parent agent creates and exclusively updates shared run files:

  • run-metadata.json
  • architecture.md
  • coverage-ledger.json
  • findings.json
  • REPORT.md
  • FINDINGS-DETAIL.md
  • NEEDS-VALIDATION.md

Each hunter and verifier receives an isolated workspace under <output-dir>/agents/<agent-id>/ with separate scratch/ and artifacts/ directories. Target-controlled processes write only to scratch/. The parent alone promotes allowlisted files to artifacts/ using descriptor-based no-follow traversal. Review references/hunting.md and references/validation-and-reporting.md for exact promotion procedures.

Progressive disclosure and domain guides

Consult specific reference guides on demand based on target architecture:

Domain or taskReference fileTrigger conditions
Attack classes and taxonomyreferences/attack-classes.mdBaseline injection, access control, SSRF, path traversal
Reconnaissance and scopingreferences/reconnaissance.mdMapping entry surfaces, trust boundaries, and ledger units
Hunter wave coordinationreferences/hunting.mdDispatching hunter waves and managing agent scratch spaces
Verification and reportingreferences/validation-and-reporting.mdIndependent verification, schema validation, and deliverables
Web and authenticationreferences/web-protocol-and-auth.mdHTTP framing, cookies, sessions, JWT, OAuth 2.1, OIDC, SAML
Client-side and browserreferences/client-side.mdDOM XSS, prototype pollution, Trusted Types, CSP, postMessage
Cloud and deploymentreferences/cloud-and-deployment.mdCloud IAM, Kubernetes, containers, IMDSv2, ingress, secrets
Credentials and secret hygienereferences/credentials-hygiene.mdSafe verification, token masking, zero exposure inspection
Supply chain and releasereferences/supply-chain-and-release.mdDependencies, CI workflows, SLSA provenance, build inputs
AI, LLM, and agentsreferences/ai-and-llm.mdPrompt assembly, RAG context, MCP servers, tool-call loops
Memory safety and binaryreferences/memory-safety-and-binary.mdC, C++, Rust unsafe, FFI, parsers, allocators, race conditions
Data isolation and lifecyclereferences/data-isolation-and-lifecycle.mdMulti-tenancy, BOLA, object links, soft deletion, retention
Desktop, mobile, and IPCreferences/desktop-mobile-and-local-ipc.mdDeep links, webview bridges, Electron, IPC daemons, helpers
Protocols, RPC, and messagingreferences/protocols-rpc-and-messaging.mdgRPC, Protobuf, GraphQL transports, webhooks, message queues
Resource exhaustionreferences/resource-exhaustion-and-availability.mdReDoS, amplification, memory leaks, queue starvation
BaaS and fullstack frameworksreferences/baas-and-fullstack-frameworks.mdNext.js, Supabase, Firebase, Convex, Prisma, Server Actions

Full audit workflow

Follow these seven sequential phases in full audit mode.

Phase 1. Reconnaissance

Map source structure, trust boundaries, entrypoints, local build paths, and initial coverage units.

  • Inspect project configuration, package manifests, route definitions, and permission decorators.
  • Select applicable domain companion guides from references/.
  • Seed the deterministic coverage ledger with initial units.
  • Consult references/reconnaissance.md for ledger schema and domain selection rules.

Completion criterion. An initial coverage-ledger.json seeded with all in-scope boundaries is written to disk.

Phase 1b. Threat modeling and scoping gate

Align with the user on attack surface priority, trade-offs, and run profile before dispatching hunters.

  • Present the mapped trust boundaries, entrypoints, and sensitive assets discovered in Phase 1.
  • Formulate 2 to 3 distinct audit approaches with trade-offs. For example, compare a targeted auth and API sweep against deep data lifecycle analysis or a full-spectrum audit.
  • State the proposed run profile (quick, standard, or deep) and agent invocation budget.
  • Ask clarifying questions one at a time with concrete options and recommendations if scope boundaries or test harnesses require confirmation.
  • Wait for explicit user confirmation before proceeding.

Completion criterion. Explicit user approval is recorded for the selected audit approach, scope paths, and run profile.

Phase 2. Coverage-led hunting waves

Assign ledger units to focused hunter agents in waves.

  • Hunter agents inspect source invariants and run sandboxed local checks where safe.
  • Hunters output structured JSON candidates containing source traces, proof of concept inputs, and observed results.
  • Run a coverage critic wave after hunter execution to identify gaps or reassignments.
  • Consult references/hunting.md and references/attack-classes.md for hunting rules.

Completion criterion. All planned ledger units are resolved to candidate, covered, or deferred states with zero unassigned units.

Phase 3. Candidate validation

Subject every candidate vulnerability to independent verification.

  • Deduplicate candidates by unique vulnerability fingerprint.
  • Dispatch fresh, isolated verifier agents with clean contexts for each candidate.
  • Verifiers attempt independent reproduction and confirm source invariants.
  • Consult references/validation-and-reporting.md for verification protocols.

Completion criterion. Every candidate is evaluated by an isolated verifier and assigned a confirmed, needs-validation, or rejected verdict.

Phase 4. Structured output

Compile verified results into structured machine-readable format.

  • Write all final records to findings.json.
  • Validate findings with scripts/validate-findings.cjs.
  • Validate coverage claims with scripts/validate-coverage-ledger.cjs.

Completion criterion. Both validation scripts execute with exit code 0 against the generated output files.

Phase 5. Independent record verification

Run a final verification pass across all confirmed records before reporting.

  • Fresh agents re-verify that code references and line numbers match current target source.
  • Resolve any discrepancies or state changes.

Completion criterion. All confirmed records are verified against the exact target source revision.

Phase 6. Reporting

Generate human-readable audit deliverables from validated records.

  • Produce REPORT.md summarizing executive posture, methodology, and coverage metrics.
  • Produce FINDINGS-DETAIL.md documenting confirmed vulnerabilities with source traces and fixes.
  • Produce NEEDS-VALIDATION.md listing hypotheses blocked on external environment facts.
  • Exclude live probe instructions or exploit payloads targeting external systems.

Completion criterion. All three report markdown files are written to disk matching final validated JSON records.

Severity calibration

Only confirmed records receive severity ratings. Overall severity must not exceed observed impact:

  • critical. An unauthenticated actor gains code execution, full datastore compromise, or arbitrary account takeover.
  • high. An actor fully defeats an explicit security control with real consequences, including auth bypass, cross-tenant data access, or stored script execution affecting other users.
  • medium. A boundary violation with limited blast radius, uncommon preconditions, or impact restricted to narrow resources.
  • low. Disclosure of non-sensitive internal state or effects requiring disproportionate effort for minor impact.
  • informational. A confirmed observation with minimal standalone impact, useful as part of defense-in-depth.

Anti-patterns

  1. Presenting checklist omissions as security vulnerabilities without an exploitable boundary.
  2. Offering general hardening advice without a demonstrable breach of an invariant.
  3. Attempting network testing against external systems or production services.
  4. Guessing cloud provider, proxy, or browser behaviors not declared in repository source.
  5. Treating authorized same-principal actions as security boundaries.
  6. Skipping the Phase 1b scoping gate to launch unaligned hunting waves.
  7. Reporting prose-only findings that lack structured reproduction evidence.
  8. Modifying target repository code during the audit.

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.