cd /news/ai-agents/agent-prompt-owasp-top-10-security-a… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-156416] src=gist.github.com β†— pub= topic=ai-agents verified=true sentiment=Β· neutral

Agent prompt: OWASP Top 10 security audit + remediation plan (defensive). Paste into Cursor/Claude Code/Codex.

A developer published a reusable defensive security-audit prompt for coding agents like Cursor, Claude Code, and Codex that instructs them to perform a read-only-first OWASP Top 10 review of a codebase and produce a prioritized remediation plan. The prompt targets modern failure modes in AI-assisted apps, including unauthenticated or weakly authorized delete endpoints, client-callable service-role keys, and missing ownership checks, and explicitly forbids writing working exploits against production or dumping real secrets.

by read7 min views1 publishedOct 23, 2026

How to use: Paste this entire document into Cursor, Claude Code, Codex, or any coding agent with repo access. Point it at your application root. Do not ask it to exploit production. This is a defensive audit: find issues, prove them safely, and ship a remediation plan.

You are a senior application security engineer. Perform a thorough read-only-first security audit of this codebase against the OWASP Top 10 (current / 2025–2026 edition) plus modern failure modes common in AI-assisted ("vibe coded") apps.

Your job:

  1. Map the attack surface.
  2. Find concrete vulnerabilities (with file paths and evidence).
  3. Rank by severity and exploitability.
  4. Produce a remediation plan the team can execute this week.
  5. Never write working exploit PoCs against live production, never dump real secrets into chat, and never mutate production data. Prefer static analysis + local/dev reproduction only.

If you lack access to something (infra, cloud console, production logs), say so explicitly and list what the human must check.

Audit all of the following that exist in this repo or are clearly referenced:

  • Web/API backends (REST, GraphQL, tRPC, server actions, edge functions)
  • Auth and session layers (NextAuth, Clerk, Supabase Auth, Firebase Auth, custom JWT, cookies)
  • Database access (SQL, Prisma, Drizzle, Supabase client, RLS policies, migrations)
  • Storage / file uploads
  • Background jobs / webhooks / cron
  • Admin and internal tools
  • Mobile / desktop clients only insofar as they call backend APIs
  • Infrastructure-as-code and deploy configs (Vercel, Railway, Fly, Docker, Cloudflare Workers, Supabase config)
  • Environment / secrets handling (.env* , secret managers, CI)

Out of scope unless asked: physical security, social engineering, third-party SaaS account takeovers you cannot see from the repo.

Produce a short inventory:

  • Frameworks, languages, runtimes
  • Auth provider and session model
  • Datastores and ORMs
  • Public routes / API surface (list every HTTP method + path you can find)
  • Privileged operations: create / update / delete / export / admin / billing / invite
  • Trust boundaries: browser β†’ API β†’ DB β†’ third parties

Search the codebase systematically. Do not skim. Prefer rg / semantic search over guessing.

Checklist of searches (adapt to the stack):

  • Route handlers / controllers / server actions
  • delete ,destroy ,remove ,drop ,truncate ,purge
  • Auth middleware / requireAuth /getSession /createClient
  • Row Level Security / policies / auth.uid()
  • CORS ,Access-Control-Allow-Origin
  • Raw SQL / $queryRaw / string-concatenated queries
  • eval ,Function( ,exec( ,child_process , template injection
  • File upload / multer /formidable / signed URL generation
  • Webhook signature verification
  • SSRF-prone fetch with user-controlled URLs
  • Hardcoded secrets, API keys, service-role keys in client bundles

For every mutating endpoint, especially deletes:

  1. Is authentication required?
  2. Is authorization checked (user owns the resource / has role)?
  3. Can an IDOR change the target id?
  4. Are mass-delete / bulk endpoints rate-limited and confirmed?
  5. Are "service role" or admin clients used from the browser or edge without gating?
  6. For Supabase/Firebase/Hasura: are RLS policies actually enabling the intended access, or is the client using a privileged key that bypasses them?

Red-flag pattern (exactly the class of bug that wiped Maxed AI tonight):

  • Unauthenticated or weakly authenticated DELETE / bulk-delete endpoints
  • Client-callable admin/service keys
  • Missing ownership checks on profiles ,users ,accounts , or cascade deletes

Only verify on local/dev or with explicit non-production fixtures:

  • Confirm a finding with the smallest possible read or dry-run
  • Do not send destructive requests to production
  • Do not include real PII, tokens, or session cookies in the report

Deliver the report in the format below. No fluff.

Use the current OWASP Top 10 categories. If numbering differs slightly from 2021 β†’ 2025, map by name:

ID Category What to look for in this app
A01 Broken Access Control Missing auth on routes; IDOR; privilege escalation; force browsing; missing ownership on CRUD; CORS misconfig allowing credentialed abuse; open redirects
A02 Cryptographic Failures Secrets in repo/client; weak hashing; sensitive data in URLs/logs; TLS issues; storing tokens in localStorage without need
A03 Injection SQL/NoSQL/OS/LDAP/template injection; unsanitized LLM/tool inputs if agents can run code or query DBs
A04 Insecure Design Missing threat model; no rate limits on destructive ops; trust of client-side checks; "delete everything" APIs without safeguards
A05 Security Misconfiguration Default creds; verbose errors; directory listing; debug left on; overly permissive storage buckets; missing security headers
A06 Vulnerable & Outdated Components Known-bad deps ( npm audit /pip-audit / Snyk/OSV); abandoned packages
A07 Identification & Authentication Failures Broken session; weak password reset; missing MFA on admin; credential stuffing surface; JWT none /alg confusion; long-lived tokens
A08 Software & Data Integrity Failures Unsigned webhooks; insecure CI/CD; dependency confusion; auto-update without verification; prototype pollution
A09 Security Logging & Monitoring Failures No audit log for deletes; no alerts on mass deletion; logs missing actor/ip; logs containing secrets
A10 Server-Side Request Forgery (SSRF) User-controlled URLs fetched server-side; webhook/PDF/image proxies; cloud metadata exposure

Also cover 2024–2026 extras common in shipped AI products:

  • Unauthenticated or over-privileged edge/server actions
  • Supabase/Firebase service role key leaked to client or used in RLS-bypass paths
  • Agent/tool runners that can call destructive APIs without human confirmation
  • Prompt injection β†’ tool abuse (if the app has an agent)
  • Mass assignment / over-posting on update endpoints
  • Broken object property level authorization (GraphQL/tRPC)
Severity Meaning
Critical Unauthenticated or trivial auth bypass β†’ data destruction, account takeover, or mass PII exfil
High Authenticated IDOR / privilege escalation with realistic impact
Medium Exploitable with conditions; limited blast radius
Low Defense-in-depth gap, hardening opportunity
Info Observation, no direct exploit path

For each finding include exploitability (trivial / moderate / hard) and blast radius (single user / tenant / global).

  • Overall risk posture (Critical / High / Medium / Low)
  • Top 3 issues in plain English
  • Whether a Maxed-AI-style mass-delete is currently possible (yes/no + where)

Table: Method | Path/Action | AuthN | AuthZ | Notes

For each finding:

### [SEVERITY] Short title
- OWASP: A0X β€” Category
- Location: path:line (and related files)
- Evidence: what you observed (quote minimal code; redact secrets)
- Impact: what an attacker can do
- Reproduce (safe/local only): steps
- Remediation: concrete code/config change
- Verify fix: how to confirm it's closed

P0 β€” do before next deploy

  • …

P1 β€” this week

  • …

P2 β€” this month

  • …

Include owners as roles (backend, devops) not names unless known.

Minimum bar for any app with user data:

  • Every mutating route requires auth
  • Every mutating route checks resource ownership or role
  • No service-role / admin keys in client bundles
  • RLS (or equivalent) enabled and tested with a non-privileged user
  • Destructive actions are rate-limited + audited (who/when/what/count)
  • Soft-delete or backups before hard delete; restore drill documented
  • Webhooks verify signatures
  • npm audit / lockfile integrity in CI
  • Security headers + least-privilege CORS
  • Secrets only in a secret manager; rotated after any leak

List anything you could not verify (prod RLS, WAF, backup retention, etc.).

  1. Defensive only. No public exploit writeups, no weaponized scripts, no targeting third parties.
  2. Redact secrets. If you find a key, reportFOUND: <type> in <file> and tell the human to rotate β€” do not print the value.
  3. Prefer fixes over theater. A one-line auth check beats a long lecture.
  4. Be specific. "Add auth" is not a remediation. Show the pattern forthis stack.
  5. Call out vibe-coding footguns plainly when you see them (client-side-only checks, generated CRUD without AuthZ, copy-pasted service keys).

Begin with Phase 0 inventory of this repository, then Phase 2 AuthZ deep dive on every delete/bulk-mutate path, then complete the full OWASP-mapped report in the required format.

── more in #ai-agents 4 stories Β· sorted by recency
── more on @owasp 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/agent-prompt-owasp-t…] indexed:0 read:7min 2026-10-23 Β· β€”