# Secure Code Review for AI-Written Code

> Eight agent skills and two scanners that find and fix the authz, injection, SSRF, XSS, secret-leak and supply-chain bugs AI agents write, mapped to OWASP 2025.

Secure Code Review for AI-Written Code is a paid AI agent skill on Agensi by Abdalkader Alhamoud, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $29 (one-time purchase)
- Creator: [Abdalkader Alhamoud](https://www.agensi.io/creators/abdalkaderdev)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/secure-code-review-for-ai-written-code
- Tags: security, code-review, owasp, owasp-top-10, asvs, cwe, appsec, nextjs

## About this skill

AI agents write code that works and ships with the same holes every time: Server Actions anyone can POST to because the page checked auth, invoice lookups by id with no owner condition, `update(req.body)` that lets a user set their own role, a Stripe secret key behind `NEXT_PUBLIC_` because the browser said "undefined", `jwt.decode` where `verify` was needed, `fetch(userUrl)` for link previews, model output in `dangerouslySetInnerHTML`, `|| 'dev-secret'` fallbacks, and package names that do not exist until an attacker registers them.

This pack gives your agent a review method and the exact fixes, checked against OWASP Top 10 2025, ASVS 5.0, the OWASP LLM Top 10 2025, CWE 4.20 and current framework docs and advisories:

- **secure-code-review**: entry point with pre-flight, attack-surface mapping, severity rubric, and a finding format with evidence, fix and regression test for every issue.
- **access-control-review**: IDOR, missing authorization on Server Actions and API routes, a data access layer pattern, tenant isolation, mass assignment, CSRF, CORS, rate limits behind proxies.
- **auth-session-review**: JWT verification (jose, jsonwebtoken, PyJWT) that rejects `none`, key confusion, wrong audience and missing `exp`; cookies, sessions, password hashing, reset tokens, OAuth callbacks.
- **injection-review**: SQL, NoSQL, command, template injection, SSRF with a tested guard, path traversal, open redirects, XSS in React 19 and Next.js, deserialization, uploads.
- **framework-hardening**: Next.js 16 (proxy.ts, CSP nonces, image optimizer, every 2025-2026 high and critical advisory with fixed versions), Express 5, Fastify 5, Django 6, FastAPI, Supabase RLS.
- **secrets-exposure**: env prefixes per framework, client bundles, logs, and a leak response runbook.
- **supply-chain-review**: npm 12 `allowScripts`, pnpm `allowBuilds`, release-age gates, hallucinated and typosquatted packages, provenance, trusted publishing.
- **llm-app-security**: prompt injection, tool permissions with user-scoped authorization and confirmation, output handling, RAG filters, limits.

Two zero-dependency Node scripts: `scan-code.mjs` (45 rules for JS/TS and Python, each finding with file:line, CWE and fix hint) and `check-build-secrets.mjs` (provider keys, connection strings, `.env` files, source maps and your own server env values in production build output). Both only read files.

Every helper in the pack was typechecked and run against bypass inputs; SQL against PostgreSQL 18; Python against Django 6.1 and FastAPI 0.143; Next.js patterns in a real 16.4 build. Defensive scope: it reviews code you own and writes no exploits.

## Requires

- Python
- @next/codemod
- Node.js

## Known limitations

Scripts need Node.js 20+. scan-code.mjs covers JavaScript/TypeScript, Python and Django/Jinja templates with 45 pattern rules; it is a first pass, and the guides drive the manual review that finds logic flaws a scanner cannot. Release-age settings were confirmed for npm, pnpm and Yarn; Bun and pip/uv flags are from their docs.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Secure Code Review for AI-Written Code skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Why not just ask my agent to review its own code?

Agents review for style and miss the classes of bugs they introduce: missing ownership checks, server actions without auth, secrets in client bundles, SSRF through fetch. The pack gives a workflow mapped to OWASP Top 10 2025 and ASVS 5.0, a severity rubric, a finding format with evidence and a test, and two scanners.

### Which stacks does it cover?

Next.js 16, Express 5, Fastify 5, Django 6 and DRF, FastAPI, plus Supabase RLS pointers. Snippets were run against these versions.

### What is in the zip?

One entry skill with seven guides (access control, auth and sessions, injection, framework hardening, secrets exposure, supply chain, LLM app security) and two zero-dependency Node scripts: scan-code.mjs and check-build-secrets.mjs.

### Does it fix the issues too?

Yes. Each finding comes with a fix and a test that proves it, and the guides cover verifying the fix, as in the demo.

### Is it safe to run on a client's code?

The scripts only read files and never send anything anywhere. Secret values they find are masked in the output.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
