Back to skill

Security audit

Adversarial Code Review

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent AI code-review guide, with the main caution that its examples send repository diffs to Claude and can optionally post review comments to GitHub.

Install only if you are comfortable sending the reviewed diff to Anthropic through Claude CLI. For CI use, use least-privilege GitHub permissions, protect the Anthropic API key, and avoid running it on repositories or diffs containing secrets, regulated data, or code that cannot be shared with that provider.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 65)May include surrounding context.

Spawn a sub-agent with a system prompt that primes it for critical review. The key trick: tell the reviewer the code likely contains bugs.

bash
claude --print --append-system-prompt "You are a senior engineer reviewing code that was just generated by an AI coding agent. The agent has likely introduced subtle bugs, security issues, or logic errors. Your job is to find them. Do not be polite. Do not hedge. For every issue you find, assign:
- confidence: high | medium | low
- priority: high | medium | low
- category: bug | security | performance | logic | style

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

The meta-reviewer receives Agent 2's comments and filters them. Its job is to reject false positives, remove nitpicks that escaped the confidence filter, and validate that remaining comments are actionable.

bash
claude --print --append-system-prompt "You are reviewing a code review. The reviewer may have produced false positives, nitpicks disguised as bugs, or low-value comments. Your job is to filter ruthlessly. Keep ONLY comments that are:
1. Genuinely high-confidence issues (not speculative)
2. High-priority (would cause a bug, security hole, or data loss)
3. Actionable (the developer knows exactly what to fix)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CI example sends git diff content to an external model API via the claude CLI without any warning, consent gate, or guidance about data sensitivity. That can leak proprietary code, secrets accidentally committed in diffs, or regulated data to a third-party provider, especially when users copy the workflow verbatim into CI.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill is described as being for reviewing pull requests and critiquing code changes, which clearly justifies generating review output. However, the CI example goes further by using gh pr comment to publish comments to GitHub, a write action against a remote service that is not explicitly part of the core skill purpose of running adversarial agents to challenge findings.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.