Do cybersecurity review

From thermiteau/maverick · View interactive version

Do cybersecurity review is an AI agent skill from the GitHub repository thermiteau/maverick. Audit a codebase for security risks in one of two modes. In full-audit mode it scans the entire codebase and writes a findings report to docs/security-audit.md (run as part of do-init or on demand). In update mode it hands a diff to the independent agent-security-reviewer, which reviews the diff plu

How to use this skill

Skill file

Cybersecurity Review

Audit a codebase for security risks. Operates in two modes:

Refer to mav-bp-application-security for the standards each finding should be measured against. The skill surfaces risks; it does not modify code.

Preflight (mandatory)

Run this first. If it exits non-zero, halt and report the stderr output to the user verbatim. Do not proceed.

uv run maverick preflight do-cybersecurity-review

The check verifies the project is initialised and uv is on PATH.

Mode Selection

If $ARGUMENTS specifies a mode (full-audit or update), use it. If update is selected the caller must also pass a diff (via stdin or a file path); halt and ask for one if missing.

If no mode is specified, default to full-audit.

Full Audit Mode

1. Detect the project stack

Identify language, framework, and runtime so subsequent checks know what to look for. Use the same detectors as do-maverick-alignment: package.json, pyproject.toml, Dockerfile, etc.

2. Load the project's own security checklist and checks

Generic categories miss the rules that matter most in a given codebase.

Read every project skill under docs/maverick/skills/ whose name or

description concerns security, authorisation, tenancy, privacy,

personal data or compliance (e.g. application-security). Every rule

in them is an audit item: report each as PASS / WARN / FAIL / N/A in

the report's Project checklist section.

Then run the project's invariant checks and record the result:

uv run maverick checks run --base "$(uv run maverick git-workflow story-base)"

A failing check is a FAIL in the category it enforces.

3. Walk the audit categories

For each category below, search the codebase and assign one of:

2.1 Secret exposure

Scan tracked files for committed credentials, tokens, private keys, and connection strings. Patterns to check (extend per stack):

Also check .env* files (any tracked) and history (git log --all --full-history -- .env).

2.2 Dependency hygiene

| What | Where to look |

| --- | --- |

| Lock file present | package-lock.json, pnpm-lock.yaml, yarn.lock, uv.lock, poetry.lock, Cargo.lock, go.sum |

| Vulnerability scanning configured | npm audit in CI, pip-audit, safety, cargo audit, trivy, Dependabot, Renovate |

| Pinned versions | Direct deps pinned to a specific version or range |

| No supply-chain red flags | typosquats, abandoned packages, unfamiliar registries |

2.3 Authentication and authorisation
2.4 Input validation and output encoding
2.5 Transport, headers, and CORS
2.6 Data at rest
2.7 Logging, monitoring, and rate limiting
2.8 Container / infrastructure (if applicable)

4. Write the report

Create docs/security-audit.md (create docs/ if it doesn't exist). Use this structure:

# Security Audit

**Generated:** <ISO timestamp>
**Stack detected:** <e.g., Node.js + Express, Python + Django>

## Summary

<1-2 sentences. Highest-severity finding. Headline risk.>

| Category | Status |
| --- | --- |
| Secret exposure | PASS / WARN / FAIL / N/A |
| Dependency hygiene | ... |
| Authentication / authorisation | ... |
| Input validation / output encoding | ... |
| Transport, headers, CORS | ... |
| Data at rest | ... |
| Logging, monitoring, rate limiting | ... |
| Container / infrastructure | ... |

## Project checklist

| Rule (source skill) | Status | Evidence |
| --- | --- | --- |
| <rule> (`docs/maverick/skills/<name>`) | PASS / WARN / FAIL / N/A | `path:line` |

<"No project security skill found" if there is none — and recommend
writing one with do-upskill.>

Project checks: <n configured, n failed — list failing commands>.

## Details

### <Category> — <STATUS>

<Evidence: file paths, snippets, dependency names. Be concrete.>

<If WARN/FAIL: a one-paragraph recommendation with a concrete next step.>

<repeat per category>

## Recommendations (prioritised)

1. **<Severity: high/medium/low>** — <action>. <File or area>. <Why it matters>.
2. ...

## Proposed invariant checks

<For each finding that a script could catch every time (a forbidden
call, a missing declaration, a grant that must not exist), propose a
check command and what it asserts. Reviewers miss repeat cases; a check
in `checks.commands` never does.>

Use one-line citations (path/to/file:42) so a human (or a follow-up agent) can jump straight to evidence.

5. Surface the findings to the user

After writing the report, print:

6. Record the milestone

Once the report is written, record that the cybersecurity review has run on this project:

uv run maverick integration set cybersecurity_reviewed true

This commits the milestone into .maverick/config.json so other Maverick skills (and maverick integration get) can see it.

Update Mode

Diff-scoped review used as the mandatory pre-PR security gate. It is

performed by agent-security-reviewer, a read-only agent

with a fresh context: the review must not run inside the context that

wrote the code, or the author is checking their own work.

do-issue-solo and do-issue-guided dispatch

the agent directly. If you were invoked in update mode (for example by

a user typing the command), do the same:

  1. Build the diff (git diff origin/<base>...HEAD > <file>) if the

caller didn't pass one.

  1. Dispatch agent-security-reviewer with Mode: diff,

the diff path, the base branch and a one-paragraph spec. Do not

review the diff yourself.

  1. Return the agent's JSON result and its MAVERICK_SECURITY_VERDICT

line unchanged.

The agent's procedure (project checklist, invariant checks, impact set,

categories) and verdict semantics (PASS / FINDINGS / BLOCKING) are

defined in its own prompt. Update mode never writes to

docs/security-audit.md: its findings are transient and the caller

decides where they go.

Rules

Return Protocol (update mode)

When invoked from do-issue-solo Phase 7 (or any other

caller) in update mode, do-cybersecurity-review is a

subroutine of the calling workflow — not a terminal action.

Returning the structured verdict is a hand-back to the caller's next

numbered step, not a phase-complete signal (#106).

When you return from this skill, do not post a closing summary, do

not stop. The calling workflow still owns, in order:

  1. Closing the skill-dispatch interval that wrapped this invocation

(uv run maverick report end --auto … --outcome <success|failure|blocked>).

The outcome maps from the verdict: PASS → success,

FINDINGS → success (with the findings folded into the PR body

draft), BLOCKING → blocked.

  1. Acting on the verdict — halting on BLOCKING, folding findings

into the PR body draft on FINDINGS, or recording

Security review: no concerns. on PASS.

  1. Advancing to the next phase (open the PR) once the verdict has

been folded in.

If you find yourself drafting a final summary after returning here,

that is the signal: scroll back to the calling workflow and resume

from the step immediately after the

/do-cybersecurity-review dispatch.

<!-- maverick-plugin-version: 5.3.1 -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.