All skills
bitwarden avatar

/perform-security-review

@44659bd official
by bitwardenbitwarden/ai-plugins155 stars
20

Performs a security-focused code review by launching multiple specialized agents and a verification agent to ensure comprehensive coverage and accurate findings. Use this skill when the user asks for a "perform-security-review", "bitwarden-security-review", "execute a security review", "run a comprehensive security audit", "perform an end-to-end security assessment", or needs to coordinate multiple security checks across code, dependencies, secrets, and configurations. The skill manages the workflow, delegates tasks to specialized agents, and presents final findings to the user.

Use this Skill: https://skilld.dev/gh/bitwarden/ai-plugins/perform-security-review

This session only. Nothing lands on disk.

referencesbase-ref-resolution.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Why Base-Ref Resolution Looks Like That

Background for sub-step A2 of perform-security-review. The procedure itself lives in SKILL.md; this file explains why each gate is there, so the steps can stay short.

Never key on the output of git rev-parse

git rev-parse --abbrev-ref origin/HEAD exits 128 when origin/HEAD is unset — and still prints the literal string origin/HEAD on stdout, with the fatal: going to stderr. A check that captures the output and looks for something ref-shaped therefore succeeds on failure, and hands the rest of the run a base ref that resolves to nothing. The exit status is the only reliable signal.

Keep the origin/ prefix

origin/main and main are different refs. main is whatever the local branch last pointed at, which on a machine that has not pulled in a week is not the base anyone means. Stripping the prefix silently reviews against stale history.

Why origin/HEAD is not enough on its own

refs/remotes/origin/HEAD is a convenience symbolic ref, and plenty of checkouts never create it. actions/checkout is the common case: it does git init, adds the remote, and fetches a single ref pattern that creates refs/remotes/origin/<branch> without ever writing origin/HEAD. So the repository's default branch has to be asked for by name as a second candidate.

Naming it is not the same as having it. A default actions/checkout fetches one refspec at fetch-depth: 1, so on a feature-branch build refs/remotes/origin/main is absent too, and candidate 2 fails check 2 in exactly the environment it was added for. Passing --base-ref origin/main fails the same check for the same reason. Branch comparison mode needs the base ref to be present locally, which in CI means fetch-depth: 0 on the checkout step, or an explicit git fetch origin <base> before the review runs. Without one of those the run reaches the abort — which is the designed outcome, not a silent wrong answer, but the abort has to name the prerequisite or the caller cannot act on it.

Why a resolving ref is still not enough

git rev-parse --verify proves a ref name resolves to an object. It does not prove that object shares history with HEAD. In a shallow clone the boundary can cut above the point where the two branches diverged, leaving a ref that resolves and a git merge-base that fails.

That distinction has teeth, because of how the diff is written:

git diff <base-ref>...HEAD > /tmp/security-review-<identifier>.diff

The shell performs the redirection before running the command, so the file is created and truncated whatever happens next. A three-dot diff with no merge base exits 128 having written nothing, which leaves a zero-byte file that looks exactly like "no changes found". Four agents then review it and report clean. The merge-base gate exists so a resolvable-but-disconnected candidate falls through to the next candidate instead of reaching that state, and step 1B's exit-status and emptiness checks exist to catch it if it does anyway.

A non-zero exit can also leave a partially written diff, so step 1B clears the file's contents with Write on any failure rather than assuming it is empty. The step 1-A2 abort never creates one.

Why not a two-dot diff

git diff <base>..HEAD compares two endpoints, so commits that exist only on the base show up as reversed changes — deletions of code nobody deleted. Feeding that to security agents manufactures findings. Three-dot is the only correct form here, which is why an absent merge base is a stop rather than something to work around.

Why not repair the clone

Deepening or un-shallowing someone's working copy is a side effect a review skill has no business having, and git fetch writes to .git. When no candidate passes, the right move is to stop and point the caller at PR mode, which gets a correct merge-base diff from the API without touching the local repository at all.

Validating a branch name the user typed

git check-ref-format --branch is a ref-validity check, not a shell-safety check. It rejects whitespace and ~ ^ : ? * [ \, but accepts ;, &, |, $, backticks, and parentheses, all of which are legal in a ref name. Double-quoting does not help either: parameter expansion and command substitution both happen inside double quotes, so "main$(...)" runs the substitution and then passes validation, because what is left after expansion is just main.

An allowlist applied before the value reaches any command is the strongest control available here, and it is the control for this value: no allowed-tools rule can constrain a ref name that has already been interpolated into a command, which is why the check has to run before the value is placed. tool-grants.md covers the separate question of why the grants themselves are written the way they are. ^[A-Za-z0-9_][A-Za-z0-9._/-]*$ covers every branch name in normal use and admits none of the above. The leading character is pinned separately because a value beginning - is read as an option rather than a ref, and --local-env-vars is a legal branch name that a pattern allowing - anywhere would accept.

Source: SKILL.md on GitHub

1 warning14d3 checks · Risk SAFE
  • Gen Agent Trust Hub14d

    This skill coordinates a security code review by delegating tasks to specialized sub-agents. It includes instructions to bypass safety filters for the purpose of the audit and processes untrusted external data (git diffs), which presents a surface for indirect prompt injection.

  • Socket14d

    No alerts

  • Snyk14d

    Risk: MEDIUM · 1 issue

Signed by skilld at 44659bd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago
What it can do
Runs commands Reads files Edits files
MCP servers
plugin_aikido_aikido-mcp
All 15 allowed tools
Bash(gh pr diff:*)Bash(gh pr view:*)Bash(gh repo view --json defaultBranchRef:*)Bash(git branch --show-current:*)Bash(git diff:*)Bash(git log:*)Bash(git merge-base:*)Bash(git remote get-url:*)Bash(git rev-parse:*)Bash(printenv GITHUB_ACTIONS)ReadSkillTaskWritemcp__plugin_aikido_aikido-mcp__aikido_issues_list
Other metadata
argument-hint
[--output <chat|file|github>] [--output-dir <path>] [--model <model>] [--base-ref <ref>] [pr-number-or-url|commit-sha|duration]
  • security-review
  • code-review
  • vulnerability-assessment
  • bitwarden
  • multi-agent
  • github
  • secrets
  • dependencies
  • architecture
  • threat-modeling

README badge

README badge for bitwarden/ai-plugins/perform-security-review

Orchestrates a multi-agent security code review by delegating to specialized agents covering injection flaws and OWASP top risks, secrets and dependencies, security architecture and zero-knowledge invariant compliance, and threat modeling. Fetches GitHub scan evidence (code scanning, secret scanning, Dependabot) upfront and routes the diff and findings through a verification agent for triage and confidence rating before generating a classified report.

Generated from the current SKILL.md.

What security domains does this skill cover?
The skill coordinates four specialized agents covering code security (injection flaws, cryptography, OWASP A01-A05), secrets and dependencies (hardcoded credentials, vulnerable packages), security architecture (auth, encryption, zero-knowledge invariant), and threat perspective (data flows, privilege escalation, API abuse).
Can this skill review a GitHub PR, commit, or local changes?
Yes. The skill supports PR mode (PR number or URL), commit mode (commit SHA), time-based mode (duration like "last 48 hours"), local changes mode (unstaged/staged diffs), and branch comparison mode (current branch vs main).
Does this skill fetch GitHub Advanced Security scan results?
Yes. It pre-fetches code scanning, secret scanning, and Dependabot alerts from GitHub, then includes that evidence in agent prompts to triangulate and verify findings.
What output formats are supported?
The skill supports chat (inline), file (saved to disk with `--output-dir` option), and GitHub (posting results as a comment or check, if integrated).
Does this skill verify findings after the four agents report?
Yes. A fifth verification agent reviews all findings, applies the security-review-rubric severity/confidence matrix, and classifies each as Blocker, Improvement, Note, Strength, or Dismiss — but does not remove or introduce findings.

Generated from the current SKILL.md. These answers refresh after source changes.