Security Audit
CloudflareOfficialPublished by Cloudflare
- Skill
- Review and audit
- Security
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a rigorous, defensive workflow for conducting security audits and vulnerability research. It operates in two modes: a guidance mode for focused investigations and a full audit mode for comprehensive, end-to-end reviews. The framework emphasizes sandboxed, local-only execution, requiring concrete evidence of a trust boundary violation to confirm a finding. It includes strict protocols for write isolation, budget management, and independent verification to ensure audit integrity and reproducibility.
What it does
- Performs structured security audits on codebases, APIs, and services.
- Validates vulnerabilities using sandboxed, local-only execution environments.
- Generates comprehensive audit reports including findings, evidence, and remediation guidance.
- Manages audit coverage through a deterministic ledger system.
- Enforces strict write isolation to protect target source and audit artifacts.
- Provides methodology for triage and investigation of specific security findings.
When to use it
- When performing a comprehensive, end-to-end security review of a codebase.
- When conducting vulnerability research on specific libraries or daemons.
- When seeking expert guidance on security methodology or triage.
- When a formal, documented security audit report is required.
- When investigating potential trust boundary violations in source code.
Advantages
- Ensures high-integrity results through independent verification phases.
- Minimizes risk by enforcing strict, sandboxed execution boundaries.
- Provides clear, evidence-based findings rather than generic hardening advice.
- Supports reproducible audits with structured metadata and coverage tracking.
- Prevents false positives by requiring concrete, observable boundary violations.
Usage examples
- “Perform a full security audit of this repository.”
- The agent initiates the six-phase audit workflow, starting with reconnaissance and ledger setup, followed by hunting waves and independent validation to produce a final security report.
- “I have a question about the authentication flow in this API; can you help me investigate?”
- The agent enters guidance mode, focusing on the specific authentication logic without triggering the full audit workflow or creating formal report artifacts.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/cloudflare/security-audit/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip security-audit.zip -d .agents/skills
Documentation by Cloudflare
Security Audit
Find vulnerabilities that violate a real trust boundary, then give owners the source evidence, safe reproduction, priority, and smallest effective fix. This is a defensive, source-first workflow. A candidate without a concrete affected principal, resource, or security outcome is not a confirmed finding.
Operating modes
This skill is guidance by default. Loading it does not authorize the complete audit workflow or file creation.
Guidance mode: For security questions, focused reviews, methodology, triage, or investigation of specific findings, use only the relevant parts of this skill. Do not automatically run all six phases, create an output directory, or write audit artifacts. You may launch focused agents when useful; they return results to the current task.
Full audit mode: Use the complete workflow when the user explicitly asks to audit or pen-test a codebase, asks for a full, comprehensive, or end-to-end security review, or requests report artifacts. Run all six phases and write the files defined below.
If the request could mean either mode, ask one focused question before creating files or starting the complete workflow.
Platform terminology
This skill is agent-neutral:
Parent is the agent that coordinates the run and owns shared state.
Task tool is the platform's delegation or sub-agent mechanism.
researchagent is a delegated agent for focused source exploration and factual verification.generalagent is a delegated agent for broad investigation and bounded local execution.subagent_type:in a heading names which of these two delegated agent roles runs that work.
Use equivalent platform capabilities while preserving role, write-isolation, prompt, and independence boundaries.
Universal execution safety
These rules apply in both operating modes. Source inspection is read-only. Run target-controlled builds, tests, processes, browsers, emulators, fuzzers, and fixture processing only inside an OS-enforced sandbox that provides all of these controls:
no external network; use only an isolated loopback namespace when the check needs local client/server traffic;
an empty environment populated from an explicit allowlist with safe values, with scratch-local
HOME, temporary directories, and caches;a read-only target and toolchain, with the target-controlled process able to write only inside its assigned
scratch/directory; andexplicit low CPU, memory, process, file-size, disk, and wall-clock limits.
The agent, outside the target-controlled process, may make a disposable source copy in an assigned scratch/ directory when a build must write beside source. In guidance mode, do not retain target-controlled files. In full audit mode, only trusted parent-side code may promote the minimum non-secret result to retained artifacts/ using the procedure under Write isolation. Never expose a retained output directory (other than the agent's own assigned scratch/), another agent's directory, the host home directory, credentials, sockets, or shared services to target code. Do not install dependencies or let builds fetch them. Use only tools and dependencies already available locally. If every control cannot be enforced, do not execute target code: report the missing sandbox capability as a needs-validation blocker and give a safe validation plan.
Use dummy principals, fixtures, and secrets. Do not probe deployed endpoints, external services, shared infrastructure, production identities, other users' data, or live control planes. Do not test availability against a live or shared process, publish artifacts, alter releases, spend paid API quota, or continue beyond the minimum local effect needed to establish a defect. If the decisive fact is outside source or the sandboxed fixture, report it as needing validation.
Full audit setup
In full audit mode, resolve these values before reconnaissance:
Skill directory: the absolute directory containing this
SKILL.md.Target: the absolute repository root under review.
Repo name: a stable repository identifier from the directory or local Git remote.
Output directory: a new writable directory outside the target, defaulting to
~/security-audit-skill/<repo-name>/run-<N>, where<N>is the next unused integer. Use a directory inside the target only when the user explicitly selects it and the parent verifies that version control ignores the whole directory. Otherwise stop and request an external path.Source ref: the reviewed commit and whether the worktree is dirty. Do not treat unreviewed generated or modified files as another revision.
Write isolation
The parent creates and is the only writer of shared run files:
run-metadata.jsonarchitecture.mdcoverage-ledger.jsonfindings.jsonREPORT.mdFINDINGS-DETAIL.mdNEEDS-VALIDATION.md
Each hunter or verifier receives a unique root under <output-dir>/agents/<agent-id>/, with separate scratch/ and artifacts/ directories. Canonical agent IDs match ^[a-z0-9][a-z0-9_-]{0,63}$ and must not equal a Windows device name such as con, prn, aux, nul, com1 through com9, or lpt1 through lpt9. Lowercase IDs prevent case-fold collisions. The agent and every target-controlled process may write only to scratch/; retained artifacts/ is parent-owned, is never exposed to the sandbox, and is writable only by trusted parent-side promotion code. Agents may not change shared files, target source, retained artifacts, or another agent's directory. Do not use /tmp or the host home directory as a writable fallback.
Before execution, the parent opens and retains trusted, non-inheritable directory descriptors for the agent's scratch/ and artifacts/ roots, and records an allowlist of expected scratch-relative artifact files plus explicit per-file and cumulative byte limits. Never pass those descriptors to the agent or sandbox. After the sandbox and all its processes terminate, trusted parent-side code promotes each allowlisted file separately:
Validate the declared relative path: reject absolute, empty,
.,.., or symlinked components.Walk each parent component from the retained scratch-root descriptor with no-follow directory-relative operations; never reopen by path.
Open the leaf no-follow and nonblocking.
Verify with
fstatthat it is a regular file with link count exactly one and within the recorded per-file and cumulative byte limits.Enforce those limits again while reading from that descriptor.
Copy exactly the verified size, repeat
fstat, and reject a changed identity, type, link count, or size.For the destination, walk every parent component from the retained artifacts-root descriptor with no-follow directory-relative operations; require each existing component to be a real directory, and create any missing directory exclusively before reopening and verifying it no-follow.
Create the leaf exclusively without following links, verify that the opened destination is a regular file with link count exactly one, and copy from the verified source descriptor without reopening either path.
Use equivalent race-safe APIs on non-POSIX systems.
Never recursively copy or glob scratch, extract an archive into artifacts, or open or promote a symlink, FIFO, socket, device, directory, hard-linked file, changing file, or file that exceeds its bound.
If any check is unavailable, cannot be enforced, or fails, discard the scratch entry; if it is decisive evidence, retain
needs_validationwith the exact promotion blocker.
HUNTING.md and VALIDATION-AND-REPORTING.md carry this procedure as one identical fenced block for hunter and verifier prompts; it states the same rules in the same order as this list.
For a reproduced check, record the command, exact test input, sandbox limits, and only the allowlisted environment variable names plus safe non-secret values needed to reproduce it. Never capture or copy the ambient environment, inherited variables, credential values, authentication state, or unrelated host paths. Launch from an empty environment rather than trying to redact one after execution.
Before delegation, the parent writes run-metadata.json with at least run_id, repo, target, source_ref, profile, scope_paths, budget (null if unset), execution_policy: "sandboxed-source-and-local-only", selected companion files, prior-run paths, shared-file owners, and run_status: "in_progress". Update metadata only when those facts change; candidate state belongs in the coverage ledger and findings.json.
Full audit planning
The coverage, prior-run, profile, and budget requirements in this section apply only in full audit mode.
Coverage and prior runs
No one pass is complete. Build a deterministic coverage plan before hunting and update it after every agent result. RECONNAISSANCE.md defines the stable coverage units and HUNTING.md defines coverage-critic waves. The parent alone updates the ledger.
If prior runs exist, read every compatible coverage-ledger.json and findings.json before planning the current run:
Compare the relevant current source with each prior record and unit. A prior source ref alone is not evidence that a path is unchanged.
Carry a prior
confirmedrecord into the current candidate set only when its relevant source and conditions are unchanged and its evidence still meets the current contract. Link it to a current ledger unit seededplanned, preserve its fingerprint, exclude only that carried root cause from hunters, and send the carried record through the current final verification path; the Phase 3 verifier that re-checks it becomes that unit's assignment owner and moves it tocandidate.When relevant source for a prior
confirmedrecord changed, create a current planned revalidation unit. Do not put that record on the hunter exclusion list. It remains confirmed only if current independent validation establishes the current path and result.Make prior
needs_validation,deferred,blocked,out_of_scope, and any changed-source unit current work. A still-externalneeds_validationrecord may be carried only after the current source trace is checked and linked by fingerprint to a currentplannedunit whose verifier re-check supplies its owner and evidence; the record keeps the unresolved blocker. These prior states never suppress a current unit.A prior same-source covered unit may inform priority, but it remains visible in the current ledger. A prior
rejectedrecord suppresses only the unchanged failed claim, not coverage of its unit; changed evidence creates current work.Read the prior profile and scope. A prior
quickor scoped ledger contributes only its recorded evidence and gaps, never an implied "rest is fine."
If no prior ledger exists, say so in the final coverage statement. Never imply that one run exhausts the target.
Run profiles and scope
During full audit setup, pick a profile from the user's request or propose one from the target's size and stakes. Record it in run-metadata.json (profile, scope_paths) and state it in the report. The default is standard.
quick— a bounded pass for small targets, re-runs, or a fast first look. Coarsen ledger units to surface × boundary × attack class (subsystem uses the fixed canonicalprofile/quick/all-in-scope-subsystemsidentifier), run exactly one hunter wave followed by exactly one final coverage-critic pass, and use one fresh verifier per candidate for both candidate validation and final record verification. Do not launch a follow-up hunter wave: record the critic's accepted discoveries and reassignments asdeferred.standard— the workflow as written.deep— for high-stakes or large targets. Split ledger units per subsystem and lifecycle mode, run critic waves to a clean pass, keep candidate validation and final record verification as separate fresh agents, and giveprior_covered_same_sourceunits an independent second pass.
A scoped run audits a subset: named paths, one subsystem, one companion domain, or the diff between two source refs. Seed ledger units only for in-scope surfaces and record everything else as out_of_scope — never as covered. A scoped or quick run must present itself as partial coverage.
Profiles change breadth and redundancy, never the evidence bar. Do not scale away the candidate gate, the source/local execution boundary, needs_validation discipline, schema validation, or independent verification of confirmed records.
Cost budget
The ledger makes spend countable: one unit is roughly one hunter assignment, and one surviving candidate is one or two verifier assignments depending on profile. When the user sets a budget — or the parent proposes one for a large target — record budget in run-metadata.json as a maximum number of agent invocations across all phases.
Apply the strict budget gate before launching any reconnaissance agent. Reserve the four baseline reconnaissance calls, one final post-wave critic for quick or one post-wave plus one distinct final-clean critic for standard/deep, and at least one verifier call. Add focused reconnaissance only after repeating this gate for each extra call. If the requested budget cannot fund that minimum, launch no agent: ask for a larger budget, narrower scope, or different profile. If the request remains unchanged, set run_status: "incomplete" with incomplete_reason: "budget_cannot_fund_reconnaissance_and_reserves" and report that no audit pass ran.
Spend it in this order:
Count reconnaissance, every post-wave critic, and the separate final-clean critic as agent invocations.
Reserve critics and validation before hunting. For
quick, reserve its one post-wave final critic. Before everystandardordeephunter wave, reserve one immediate post-wave critic plus one distinct final-clean critic. Also reserve verifier cost from the profile (about 1 or 2 agents per expected candidate; when in doubt reserve 30% of the balance after critic reservation). Never assign hunters into either reserve.Assign hunters to units in priority order until the hunting allowance is spent. Spend the reserved post-wave critic immediately after that wave; keep the final-clean and validation reserves intact.
Before a later wave, reserve its new post-wave critic again. If the remaining budget cannot cover the required critic calls and validation reserve, launch no hunters from that wave, mark its planned units
deferredwith reasonbudget_cannot_reserve_critics_and_validation, and use the retained final-clean critic to record the resulting gap.
Before wave 1, update the pre-recon estimate with seeded units, implied hunter count, mandatory critic calls, validation reserve, and whether the remaining budget covers the plan. If it clearly cannot, say so and propose either a tighter scope or a coarser profile instead of silently thinning evidence. If later facts consume the required final-critic reserve, launch no hunters, mark all planned work deferred, set the run incomplete with reason critic_budget_exhausted, and make no complete-coverage claim.
A strict total-agent budget can still be exceeded by an unexpectedly large candidate set or by a material Phase 5 replacement that needs another independent verifier. If the remaining budget cannot validate every candidate, stop hunting, validate candidates in fingerprint order while the budget permits, and set run_status: "incomplete" plus incomplete_reason: "validation_budget_exhausted". Keep each unvalidated fingerprint linked to a candidate ledger unit with that unresolved reason. Do not put an unvalidated candidate in findings.json, relabel it needs_validation, or report the run as complete. Phase 6 may produce a partial report only if its first section states that candidate validation is incomplete and lists the affected fingerprints and units. Never exceed a user-set strict budget silently.
Core principles
Require a boundary and result
For every candidate, name the lower-trust principal, accepted input or action, intended control, crossed boundary, affected principal or resource, and concrete observed or owner-observable result. Do not elevate a missing best practice, guessed deployment behavior, generic parser crash, or self-impact into a security finding.
Use bounded local evidence
Static analysis establishes the source path. Sandboxed local tests resolve behavior when all execution controls are available: a minimal function harness, existing unit test, small parser fixture, dummy-tenant integration test, locally rendered configuration, or bounded isolated-loopback client. Stop at a wrong return value, unauthorized dummy record, sanitizer finding, policy difference, or other minimum effect. Do not extend the local check beyond the minimum boundary result or produce persistence, post-fault, or concealment material.
Respect source visibility
Deployment controls, proxy behavior, provider settings, browser headers, identity policy, broker ACLs, packaging, and topology are real controls. If they are required and absent from the repository, do not assume either presence or absence. Use needs_validation with the exact missing fact and a safe owner-observed or local plan.
Separate priority from certainty
Only confirmed records receive severity. Likelihood and impact must reflect the demonstrated conditions and result; overall severity cannot exceed demonstrated impact. needs_validation means a specific source-grounded boundary hypothesis is blocked, not a low-confidence confirmed vulnerability, and it has no severity.
Calibrate overall severity with these anchors:
critical — an unauthenticated actor gains code execution, full data-store access, or takeover of arbitrary accounts.
high — an actor fully defeats an explicit security control with real consequences: authentication bypass, cross-tenant read or write, stored script execution affecting other users, authenticated code execution, or an unauthenticated remote stop of a shared service.
medium — a real boundary violation with limited blast radius, uncommon preconditions, or consequences confined to a narrow resource set.
low — disclosure of non-secret internals, or an effect requiring sustained effort for minimal gain.
informational — a confirmed but minimal-impact observation, useful mainly as a prerequisite inside a larger finding.
The high/medium discriminator: does the demonstrated result fully defeat an explicit control for an action with real consequences, or only weaken it? If you cannot state the concrete damage, the severity is lower than it feels.
Recommend the smallest effective source fix
For each confirmed finding, identify the invariant the code must enforce and the narrowest source change that enforces it at the last trusted decision point. Prefer specific repository-relative changes and regression tests over generic hardening advice. The audit describes fixes; it does not modify target source.
Full audit workflow
In full audit mode, follow all six phases in order:
Reconnaissance — map the source, trust boundaries, local build paths, companion selections, prior evidence, and initial deterministic coverage ledger with RECONNAISSANCE.md.
Coverage-led hunting waves — assign isolated hunters from the ledger and collect structured candidate results with HUNTING.md, ATTACK-CLASSES.md, and the selected domain companions.
Candidate validation — consolidate fingerprints and give every candidate to a fresh source verifier as defined in VALIDATION-AND-REPORTING.md.
Structured output — write all final
confirmed,needs_validation, andrejectedrecords tofindings.json; validate it withreport-schema.jsonandvalidate-findings.cjs, and validate the coverage claim withvalidate-coverage-ledger.cjs.Independent record verification — use fresh agents to verify final source claims and reconcile corrections or state changes.
Target-neutral report — derive
REPORT.md,FINDINGS-DETAIL.md, andNEEDS-VALIDATION.mdfrom the final records, with no live-probe instructions.
Do not end the run before one of exactly two terminal states: (a) all Phase 6 artifacts are written and both validators pass, or (b) run_status: "incomplete" is recorded with its exact reason and the gap is disclosed in the report. Never stop mid-phase.
Anti-patterns
Checklist deviations presented as vulnerabilities.
Defense-in-depth advice with no reachable boundary violation.
Live or shared-environment testing where bounded local evidence is insufficient.
Guessing provider, proxy, browser, identity, or deployment behavior not present in source.
Treating intended same-principal authority or self-impact as a cross-boundary result.
Reporting a parser or runtime effect stronger than the observed effect.
Emitting prose-only hunter results that cannot be deduplicated or verified.
Re-reporting carried same-source prior confirmed records or using them as exemplars that anchor the hunt.
Assigning severity to
needs_validationrecords.Writing the report before independent verification or letting prose and JSON disagree.
Files
- AI-AND-LLM.md10.4 KiB
- ATTACK-CLASSES.md15.3 KiB
- ATTRIBUTION.mdAdded by AutoGineer885 B
- CLIENT-SIDE.md8.4 KiB
- CLOUD-AND-DEPLOYMENT.md8.1 KiB
- DATA-ISOLATION-AND-LIFECYCLE.md7.6 KiB
- DESKTOP-MOBILE-AND-LOCAL-IPC.md8.5 KiB
- HUNTING.md21.9 KiB
- LICENSELicence file added by AutoGineer1.1 KiB
- MEMORY-SAFETY-AND-BINARY.md10.3 KiB
- PROTOCOLS-RPC-AND-MESSAGING.md7.3 KiB
- RECONNAISSANCE.md15.5 KiB
- RESOURCE-EXHAUSTION-AND-AVAILABILITY.md7.3 KiB
- SKILL.md21.5 KiB
- SUPPLY-CHAIN-AND-RELEASE.md7.1 KiB
- VALIDATION-AND-REPORTING.md17.4 KiB
- WEB-PROTOCOL-AND-AUTH.md12.0 KiB
- report-schema.json14.2 KiB
- validate-coverage-ledger.cjsScript32.7 KiB
- validate-coverage-ledger.test.cjsScript27.8 KiB
- validate-findings.cjsScript28.1 KiB
- validate-findings.test.cjsScript25.8 KiB
HUNTING.md
Vulnerability Hunting
Phase 2: Run coverage-led hunting waves
The parent assigns planned ledger units to general agents. Use enough focused hunters to cover the units without combining unrelated boundaries. One hunter may own closely related units in one subsystem; no unit may be silently unassigned because of an agent-count limit — a unit the budget cannot reach is explicitly deferred with reason budget_cannot_reserve_critics_and_validation.
When a budget or profile caps hunter count, assign units in priority order and record the ordering rationale in the ledger. Rank by: (1) unauthenticated or lowest-trust entry surfaces before authenticated ones; (2) boundaries protecting the most valuable resources (credentials, cross-tenant data, code execution, release authority); (3) prior-run gaps, revalidation targets, and changed source before same-source re-passes; (4) units whose class historically yields confirmed findings for this target type over speculative ones. Ties break lexicographically by coverage_id so runs stay deterministic.
Before launch, the parent changes assigned units to in_progress, sets a canonical lowercase agent_id, and creates that agent's scratch/ and parent-owned artifacts/. Hunters read source and parent-provided context, write only to their unique scratch/, and return one structured result through the Task tool. They never write retained artifacts or edit target source, architecture.md, coverage-ledger.json, findings.json, or another agent's files.
Required hunter prompt
Every hunter prompt contains these parts in this order:
A two-sentence role preamble: the hunter's goal is to find source-grounded security invariant failures in its assigned units, and it must return exactly one JSON object matching the structured-result contract at the end of this prompt.
architecture.mdverbatim.Assigned coverage IDs, subsystem, boundary, repository-relative starting paths, and each unit's assignment block map from
coverage-ledger.json.The exact selected blocks, copied verbatim: each selected ordinary attack-class block from
ATTACK-CLASSES.md, and from each selected companion itsCore discipline, each chosen attack-class subsection,Universal moves, andValidation rules. Ordinary blocks are self-contained and carry no companion-styleCore discipline,Universal moves, orValidation rulessections. Do not send block or companion names alone.Explicit excluded ordinary and companion blocks with a reason for each exclusion.
The core hunting method below, followed by the promotion procedure block.
The core validation rules below.
Carried same-source prior confirmed exclusions, each limited to fingerprint, title, and root cause, plus peer-owned current coverage IDs that this hunter must not duplicate.
The unique scratch/artifact paths, safe agent ID, predeclared promotion allowlist and byte limits, and the structured-result contract, including the Structured hunter result block below and the
confirmedandneeds_validationbranches ofreport-schema.jsoncopied verbatim.
A prompt may select several companion blocks when the same path crosses several domains. Keep their constraints together. Scope is the hunter's coverage obligation, not permission to duplicate excluded work. If an unexpected different boundary appears, return it under uncovered so the parent creates a stable ledger unit and assigns it in the next wave.
Core hunting method — include in every hunter prompt
## Defensive vulnerability-finding method
Your goal is to find source-grounded security invariant failures and the smallest fix,
not to expand harm beyond the boundary result. Stay within source review and bounded local execution.
Do not contact deployed endpoints, provider APIs, registries, identity systems,
message brokers, shared services, or other users. Use local dummy data only.
READ THE CODE AT DEPTH. Follow each assigned input through parsing, identity,
authorization, normalization, state, derived copies, and the final sink. Read sibling,
legacy, batch, retry, cancellation, migration, and error paths that produce the same
effect. Compare sibling controls for equivalence, not only presence, and compare what
one component guarantees with what the next component assumes.
WORK FROM A CONCRETE INVARIANT:
1. Name the lower-trust principal and starting capability.
2. Name the accepted value, action, state transition, or resource selector.
3. Locate the control that should reject, bind, isolate, limit, or revoke it.
4. Trace the exact source path after that decision.
5. Stop at the smallest affected dummy record, wrong return value, process-integrity
effect, or locally observable shared-resource effect.
6. State a source-level change and regression case that enforce the invariant.
DEPTH BOUND: trace only paths that can reach your assigned boundary or whose
guarantees that boundary relies on. Stop a line of investigation as soon as the
invariant is settled either way, and record the result in your structured output —
a covered, candidate, or blocked disposition, or an `uncovered` entry — instead of
continuing to search.
TEST SAD PATHS AND DISAGREEMENTS. Check absent, empty, zero, negative, maximum,
over-limit, duplicate, mixed encoding, stale, revoked, reordered, concurrent,
partially migrated, failed dependency, and rollback state only where the interface
accepts them. Compare canonicalization and units at every parser or policy handoff.
For multi-step issues, treat each output as a prerequisite and do not assume a later
boundary. If any prerequisite is not established, record a blocker.
When a proposed high or critical candidate reveals a reusable root cause, search paths
owned by the assigned coverage IDs for lexical, structural, and logical variants.
Consolidate the same root cause, but establish each variant's conditions and impact
independently. Do not investigate peer-owned units. Return a variant with no current
coverage unit as `uncovered`.
USE THE NARROWEST LOCAL CHECK THAT SETTLES THE CLAIM. Target-controlled builds,
tests, processes, browsers, emulators, fuzzers, and fixture processing may run only
inside the parent-approved OS-enforced sandbox. It must disable external networking,
start from an empty allowlisted environment, expose target and tools read-only, permit
writes only to your scratch directory, and apply low CPU, memory, process, file-size,
disk, and wall-clock limits. Isolated loopback is allowed only for a local fixture.
If any control is unavailable, do not execute: return needs_validation with that exact
blocker. Prefer an existing unit test, minimal function harness, dummy-tenant service
call, small malformed fixture, deterministic race schedule, or locally rendered policy.
Do not install or fetch tools.
Record the exact input, command, limits, and minimum result. For the environment,
record only allowlisted variable names and safe non-secret values needed to reproduce
the check. Never capture the ambient environment, inherited variables, credentials,
authentication state, or unrelated host paths. The target-controlled process writes
only in scratch. After the sandbox and all its processes terminate, only trusted
parent-side code may promote predeclared scratch-relative files, following the
promotion procedure block included verbatim in this prompt. You and target code never
write retained artifacts. If promotion is unavailable or fails for decisive evidence,
return needs_validation with the exact promotion blocker.
Never stress availability, invoke a live target, use a real credential, publish an
artifact, or continue past the minimum observed effect.
A deployment, browser, provider, broker, OS, proxy, package, secret, or identity fact
outside source is not proof either way. If one such fact is decisive, return a
needs_validation record with the exact missing observation and safe owner-observed check.Promotion procedure — copy this promotion procedure verbatim into every hunter prompt
Artifact promotion procedure (trusted parent-side code only):
Reference only for you: the parent performs these steps; you never perform them.
Before execution, the parent opens and retains trusted, non-inheritable directory
descriptors for the agent's scratch/ and artifacts/ roots, and records an allowlist
of expected scratch-relative artifact files plus explicit per-file and cumulative
byte limits. Never pass those descriptors to the agent or sandbox. After the sandbox
and all its processes terminate, trusted parent-side code promotes each allowlisted
file separately:
1. Validate the declared relative path: reject absolute, empty, `.`, `..`, or
symlinked components.
2. Walk each parent component from the retained scratch-root descriptor with
no-follow directory-relative operations; never reopen by path.
3. Open the leaf no-follow and nonblocking.
4. Verify with `fstat` that it is a regular file with link count exactly one and
within the recorded per-file and cumulative byte limits.
5. Enforce those limits again while reading from that descriptor.
6. Copy exactly the verified size, repeat `fstat`, and reject a changed identity,
type, link count, or size.
7. For the destination, walk every parent component from the retained
artifacts-root descriptor with no-follow directory-relative operations; require
each existing component to be a real directory, and create any missing directory
exclusively before reopening and verifying it no-follow.
8. Create the leaf exclusively without following links, verify that the opened
destination is a regular file with link count exactly one, and copy from the
verified source descriptor without reopening either path.
9. Use equivalent race-safe APIs on non-POSIX systems.
10. Never recursively copy or glob scratch, extract an archive into artifacts, or
open or promote a symlink, FIFO, socket, device, directory, hard-linked file,
changing file, or file that exceeds its bound.
11. If any check is unavailable, cannot be enforced, or fails, discard the scratch
entry; if it is decisive evidence, retain `needs_validation` with the exact
promotion blocker.Core validation rules — include in every hunter prompt
## Candidate gate
1. A candidate needs a complete repository-relative source trace and evidence for the
claimed root cause, including the strongest source-visible control.
2. A proposed confirmed record needs a bounded local observed result, meaningful impact
across a stated boundary, complete conditions, and no visible preventing layer.
3. Do not strengthen a crash into code execution, ordinary work into shared availability,
or a same-principal action into privilege gain.
4. If a required fact is not source-visible or locally observable, use
needs_validation. Name exact blockers; do not give it severity or speculative completion.
5. A missing best practice with no affected principal/resource is excluded or hardening,
not a finding. A candidate disproved by source is not needs_validation.
6. Use the same source-derived fingerprint for the same root cause in every state.
It must match `^[A-Za-z0-9][A-Za-z0-9._:/@+-]*$` and must not include a line,
wave, agent, severity, or verdict.
7. Return an empty candidate array when nothing survives these gates.Local validation boundaries
Local execution is for confirmation, not impact expansion:
Allowed only in the required OS sandbox: offline builds with present dependencies; isolated-loopback processes using dummy state; unit and integration tests; small fixture processing; sanitizers; bounded fuzz/regression tests; deterministic concurrency checks; local browser/emulator tests with dummy accounts; rendered manifests and policy evaluation with dummy identities; mocked external or paid calls.
Disallowed: live or deployed traffic; requests to services not started for this isolated check; network dependency installation; real accounts or credentials; production data; shared queues, cloud resources, runners, registries, signing or release services; publishing; stress, saturation, or cost generation; any work after the minimum dummy-data boundary result.
The sandbox starts with an empty environment, gives target code no external network or host writable path, and enforces explicit low resource and time limits for every check, not only checks expected to be expensive. Scratch output remains target-controlled after exit. Promote it only with the no-follow, path-confined, regular-file, bounded-size host procedure in SKILL.md. Missing any sandbox or promotion capability does not erase a source-grounded candidate; represent the exact blocker in needs_validation.
Structured hunter result
Return exactly one JSON object, with no surrounding prose:
{
"units": [
{
"coverage_id": "one assigned ID",
"disposition": "covered|candidate|blocked",
"reviewed_paths": ["repo/relative/path"],
"checks": [
{
"agent_id": "canonical owner of this check",
"reviewed_paths": ["repo/relative/path owned by this check"],
"invariant": "specific control checked for this unit",
"method": "source|local",
"result": "what source or the bounded check established",
"artifact": "agents/<agent-id>/artifacts/file for local, null for source"
}
],
"candidate_fingerprints": [],
"unresolved": []
}
],
"candidates": [],
"hardening": ["concrete non-finding note"],
"uncovered": [
{
"surface": "...",
"boundary": "...",
"subsystem": "...",
"attack_class": "...",
"starting_paths": ["repo/relative/path"],
"reason": "why this needs its own deterministic coverage unit"
}
]
}Each candidates entry is schema-shaped except that it uses proposed_verdict in place of verdict:
proposed_verdict: "confirmed": include every field required by theconfirmedbranch ofreport-schema.jsonother thanverdict:fingerprint, title, description,root_cause,intended_behavior, orderedtrace,evidence,conditions, target-neutralexecution,remediation,severity, andconfidence. The execution instructions describe only the bounded local check already performed.payloadsholds the minimum test input, fixture, or native invocation.observed_resultrecords actual local output. Overall severity must not exceed observed impact.proposed_verdict: "needs_validation": include every field required by that schema branch other thanverdict:fingerprint, title, description,claimed_root_cause, orderedtrace,evidence, nonemptyblockers, andvalidation_planwith at least one applicablelocalordeploymentstep. Do not invent an inapplicable context. Do not include severity, execution, remediation, reason, or a confirmedroot_cause.deploymentis an owner-observed check, not a request to probe a live target.
Every assigned coverage ID appears exactly once in units. A covered unit needs an owner, nonempty reviewed_paths and checks, no unresolved fact, and no candidate. A candidate unit has the same owned evidence and is the only state that carries linked fingerprints. A blocked unit is an owned partial review with nonempty paths, checks, and unresolved facts but no fingerprint. All source paths are repository-relative, never absolute or traversal paths. A trace with several entries begins at entrypoint, ends at sink, and labels intermediate steps propagation. Every check has its own canonical lowercase agent_id and nonempty reviewed_paths; the unit-level list is exactly the union of those owned paths. A source check uses artifact: null. A local check uses one successfully parent-promoted regular file beneath agents/<check.agent_id>/artifacts/; this permits a verifier to add independently owned evidence without taking ownership from the hunter. Never link scratch, an output-root file, or another check owner's artifact.
Parent consolidation and ledger update
The parent validates each unit result, maps it to exactly one assigned coverage_id, and updates only that ledger unit. Reject duplicate or absent IDs, unsafe unit or check agent IDs, source checks with artifacts, and local artifacts that trusted parent-side code did not promote into the check owner's artifacts subtree. Copy the unit's reviewed_paths, its checks into the unit's local_checks, linked artifact paths, candidate fingerprints, and unresolved facts into the ledger. Retain each hunter's hardening list in a parent bookkeeping field on the relevant units (outside the semantic fields) so Phase 6 can report it. A failed, malformed, or unsupported conclusion leaves that unit planned for reassignment. Untouched budget/profile units become unassigned deferred units with empty evidence and a reason; do not hide partial evidence in deferred. Run validate-coverage-ledger.cjs after the update; an invalid ledger cannot drive another assignment. This per-unit contract allows one hunter to close one unit while returning a candidate or blocker for another.
Consolidate candidate entries by fingerprint and then by root cause. One root cause that exposes several entry paths or effects is one candidate with the strongest complete trace. Related but independent missing controls use separate fingerprints. Record duplicate fingerprints in the relevant ledger unit and do not send duplicate candidates to validation.
Coverage-critic waves
Immediately after each hunter wave, spend the reserved invocation on one fresh research post-wave coverage critic. It receives architecture.md, the full coverage ledger including each assignment block map, current candidate fingerprints and states, and the prior-ledger gap summary. It reads source but does not write or run targets. Require exactly this JSON:
{
"missing_units": [
{
"surface": "...",
"boundary": "...",
"subsystem": "...",
"attack_class": "...",
"starting_paths": ["repo/relative/path"],
"selected_companion_blocks": ["FILE.md#section"],
"excluded_blocks": [{"block": "FILE.md#section", "reason": "..."}],
"reason": "source-backed coverage gap"
}
],
"reassign_ids": ["existing-id-that-did-not-close"],
"resolved_prior_leads": ["fingerprint"],
"stop": false
}The critic checks for unmapped entry points, unchecked parallel paths, missing lifecycle modes, selected companion classes without a unit, unjustified exclusions, units closed without paths/checks, and prior needs_validation or changed-source gaps that no unit addresses. It proposes coverage, not findings. stop is the critic's own assessment: true only when it accepts no missing_units and no reassign_ids; the parent's loop condition below, not stop alone, decides whether another wave runs. For each fingerprint in resolved_prior_leads, the parent marks the linked unit or prior-lead entry resolved and records the critic's source-backed reason.
The parent rejects proposed units outside the review scope or source/local boundary, derives canonical IDs for accepted units, and deduplicates them against current units. A prior same-source completed unit may supply evidence; prior deferred, blocked, out_of_scope, or changed-source units become current work and never suppress an accepted unit. Fail rather than merge a canonical ID collision. For each legitimate reassign_id with live blocked, covered, or candidate evidence, append that exact terminal record to the unit's attempts with the critic's source-backed reassignment_reason. Preserve its owner, checks, artifacts, fingerprints, and unresolved facts in that archive. Increment the live wave; the next hunter must be a fresh owner and receives an in_progress unit with empty live evidence. The hunter's terminal result writes only its new evidence into the live fields. Never copy an archived owner's checks or artifacts into the new live attempt. Sort IDs and validate the ledger before another assignment. In standard and deep, when the post-wave critic reports no accepted missing_units or legitimate reassign_ids and no planned units remain, spend the separately reserved invocation on a distinct final-clean critic. Complete coverage only when that critic also returns no accepted work. If it finds work, queue it and repeat the wave, post-wave critic, and final-clean process. If time or resources force an early stop, mark every untouched unit deferred, preserve the critic's reason, and disclose the gap in the report. Never use a silent wave or agent cap as evidence of complete coverage.
The run profile bounds this loop. A quick run has exactly one hunter wave followed by exactly one final critic pass. Add each accepted missing_unit to the current ledger and mark it deferred with reason quick_profile_final_critic. For each legitimate evidence-bearing reassign_id, archive the live terminal state in attempts, increment wave, and set the live state to unassigned deferred with empty evidence and reason quick_profile_final_critic. Do not launch a second hunter wave or another critic. In a scoped run, the critic still reports out-of-scope gaps it notices, but the parent records them as out_of_scope with the critic's reason instead of assigning them. The early-stop rule above is the same mechanism: quick is a pre-declared early stop, not evidence of complete coverage.
A budget bounds it the same way. Before assigning each wave, compare remaining budget against its hunter count, the validation reserve, the immediate post-wave critic, and the retained final-clean critic (quick reserves only its single final post-wave critic). Shrink the hunter wave to fit, taking units in priority order. If those mandatory reserves do not fit, launch no hunter from that wave and mark its planned units deferred with reason budget_cannot_reserve_critics_and_validation. Critic-proposed units enter the same ranked queue rather than extending the budget. If surviving candidates exceed the validation reserve, follow the incomplete-run rule in SKILL.md: stop hunting, validate in fingerprint order, retain unvalidated units as unresolved candidates, and never present them as findings.
Requirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Names Claude Code tools, Needs Node.js
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Cloudflare
- Publisher
- Cloudflare (Official)
- Source
- cloudflare/security-audit-skill · skills/security-audit · commit c1c8a8c
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Cloudflare.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download security-audit.zip