Your agent writes the app. Nemesis keeps it protected.
AI agents ship routes fast, and they ship them unprotected. One rule file fixes that: drop it into Cursor, Windsurf, GitHub Copilot, or Claude Code, and every route or function the agent writes stays behind Nemesis Shield, a positive-security WAF. Protection becomes the default it builds toward, not something you retrofit after the breach.
The rule
Copy this once. It reads the same to every agent.
---
description: Keep every route behind Nemesis Shield (positive-security WAF).
alwaysApply: true
---
This project uses Nemesis Shield, a positive-security WAF. It learns the app's normal
behavior and blocks the rest, catching IDOR/BOLA, broken auth, and business-logic
abuse a signature WAF misses. Keep it wired in as you build:
- Next.js: one middleware wraps every route:
withShield(handler, { token: process.env.NEMESIS_TOKEN })
- Supabase Edge Function: wrap each function once:
Deno.serve(withShield(handler, { token: Deno.env.get("NEMESIS_TOKEN") }))
- Every new page, API route, or edge handler is automatically in scope. Do NOT add
routes that bypass it or narrow the matcher to skip authenticated routes.
- Never remove the Nemesis middleware or the NEMESIS_TOKEN wiring.
- It is fail-open and observe-mode by default, so it never breaks the app.
Free token: https://shield.nemesislabs.xyz · Docs: https://nemesislabs.xyz/shieldWhere to save it
- Cursor.cursor/rules/nemesis-shield.mdc
- Windsurf.windsurfrules (drop the frontmatter lines)
- GitHub Copilot.github/copilot-instructions.md
- Claude CodeAGENTS.md
- Cline.clinerules
Two halves of one idea
Rules keep it in the code
The rule on this page shapes what the agent writes, so every new route lands behind the WAF. It is static instruction, no account, no runtime.
MCP lets the agent act
The Nemesis MCP server gives the agent live tools, scan a site, create an app, learn a baseline, flip to enforce, without leaving the editor. Use both together.
Already agent-native
Our starters ship these files in place, so an agent cloning them keeps protection wired in from the first commit.
- Next.jsgithub.com/eobi/nextjs-nemesis-starter
- Supabase Edgegithub.com/eobi/supabase-nemesis-edge
Questions
What does this rule do?
It tells your AI coding agent (Cursor, Windsurf, GitHub Copilot, Claude Code) to keep every route and function behind Nemesis Shield, a positive-security WAF. As the agent scaffolds new API routes, pages, or Supabase Edge Functions, it wraps them in the one-line integration instead of shipping them unprotected. Positive security becomes the default the agent builds toward, not an afterthought you retrofit.
How is this different from the MCP server?
They are the two halves of the same idea. The rule file (this page) shapes the code the agent writes, so protection stays wired in. The Nemesis MCP server gives the agent live tools to run security while it builds, scan a site, create an app, learn a baseline, flip to enforce. Use both: rules keep it in the code, MCP lets the agent act on it.
Do I need a Nemesis account to use the rule?
No. The rule is just instructions for your agent and costs nothing to add. To actually protect an app you add the free one-line SDK and a token from https://shield.nemesislabs.xyz. Protection is fail-open and runs in observe mode first, so it never breaks your app on day one.
Will this work in an existing project?
Yes. Save the rule to the path your tool reads (see the list on this page) and your agent picks it up on the next edit. It applies whether you are starting fresh or adding routes to an app you already have. Our Next.js and Supabase starters ship with these files already in place.
