/prodsec-skills-ge-core:ai-code-reviewfrom prodsec-skills-ge-core
Security-focused review checklist for AI-generated code, covering hallucinated APIs, plausible-but-wrong logic, and other AI-specific failure modes.
Ships in prodsec-skills-ge-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Security review checklist and methodology for code produced by AI coding assistants (Claude, Copilot, Cursor, Gemini, or any LLM-based tool). AI-generated code has characteristic failure modes that differ from human-written code and require specific review attention.
Assisted-by: or
Generated-by: attributionmodule/skills/differential-review/SKILL.md)module/skills/prompt-injection-mitigation/SKILL.md)module/skills/third-party-model-security/SKILL.md
or module/skills/file-protection/SKILL.md)AI code generation has characteristic error patterns that differ from typical human mistakes. Review for these specifically:
LLMs confidently generate calls to functions, methods, flags, configuration keys, or library features that do not exist. These compile or parse without errors but fail at runtime, or worse, silently do nothing.
Detection:
rg "function_name" — if
it only appears in the new code, it may be hallucinatedSecurity impact: A hallucinated security function (e.g., a
nonexistent sanitize_input() call) provides zero protection
while giving the appearance of safety.
AI generates code that reads naturally and appears correct but contains subtle logical errors — inverted conditions, off-by-one errors, wrong comparison operators, or incorrect state transitions. These are harder to catch than obviously broken code because they pass casual reading.
Detection:
< vs <=, == vs !=,
and vs orSecurity impact: An inverted authorization check
(if user.is_admin instead of if not user.is_admin) grants
access to everyone. The code reads plausibly either way.
AI generates code that follows general best practices but diverges from the specific patterns, idioms, and conventions of the project. This introduces inconsistency that makes the codebase harder to audit and may bypass project-specific security mechanisms.
Detection:
Security impact: Using a generic auth check instead of the project's custom auth decorator may skip logging, rate limiting, or additional validation that the project relies on.
AI often generates a working happy path but handles errors with generic catch-all blocks, swallowed exceptions, or missing cleanup. Error paths are where security vulnerabilities hide.
Detection:
try/catch, except, or error return: does
it handle the error meaningfully or just log and continue?Security impact: A swallowed authentication error may allow an unauthenticated request to proceed. A missing rollback may leave the system in an inconsistent state exploitable by a subsequent request.
AI training data has a cutoff. Generated code may use deprecated APIs, insecure defaults from older library versions, or patterns that were correct in a previous version but are now vulnerable.
Detection:
Security impact: Using a deprecated crypto API with known weaknesses, or relying on a default that changed from insecure to secure (or vice versa) between versions.
AI generates unfinished-work comments, placeholder implementations, commented-out code blocks, or "temporary" workarounds that are intended to be replaced but get committed as-is.
Detection:
todo, fixme, hack,
temporary, xxx markerschangeme,
a secret key assigned development)pass or return None stubsSecurity impact: A placeholder secret, a disabled validation, or a stub authentication function shipped to production.
For each AI-generated or AI-assisted change:
< vs <=, == vs !=)pass, return None, throw new NotImplementedException())For each finding:
| Field | Content |
|---|---|
| Category | Hallucinated API / Plausible-but-wrong / Pattern drift / Incomplete error handling / Stale dependency / Abandoned scaffolding |
| Location | File and line range |
| Finding | What is wrong or risky |
| Evidence | Why you believe it (missing symbol, inverted logic, project pattern not followed) |
| Severity | Critical / High / Medium / Low / Nit |
| Suggestion | Concrete fix |
module/skills/differential-review/SKILL.md — General security-focused code review.
This skill adds AI-specific failure modes on top.module/skills/fp-check/SKILL.md — When an AI-generated security finding is
itself suspect, use fp-check to verify it.module/skills/inconsistency-detection/SKILL.md — AI-generated code that drifts
from project patterns creates exactly the kind of inconsistency
this technique detects.What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/ai-systems-securitySecure AI-powered products and infrastructure. Use when integrating LLM APIs, deploying model-serving infrastructure, building agent workflows, connecting MCP servers, or reviewing AI system architecture for security gaps.
/authenticationEnforce standard authentication for external data source connections. Use when integrating, configuring, or reviewing connections from AI systems to external databases, APIs, or data services./container-hardeningHarden container images and runtime configuration. Use when building, reviewing, or auditing Containerfiles, Dockerfiles, container compose files, or Kubernetes pod security settings.
/dependency-vulnerability-auditSupply chain security audit using CLI vulnerability scanners, license compliance checks, and supply chain risk assessment. Use when auditing project dependencies for known CVEs, license concerns, and supply chain health.
/input-validation-injectionApply when reviewing or writing code that processes untrusted input, constructs queries or commands, or handles user-supplied data. Covers SQL, LDAP, OS command injection, prototype pollution, and general validation strategy.
/loggingEnforce logging of access to sensitive external data sources in AI systems. Use when designing, building, or reviewing audit and logging capabilities for AI systems accessing external databases or data services.npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills-ge-coreOther plugins' skills for the same job