Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/brighton-labs/railguard-cursor-codingWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/brighton-labs/railguard-cursor-coding/nextjs-typescript-secure-no-railguard-available)<a href="https://agentmods.dev/rules/brighton-labs/railguard-cursor-coding/nextjs-typescript-secure-no-railguard-available"><img src="https://agentmods.dev/badge/rules/brighton-labs/railguard-cursor-coding/nextjs-typescript-secure-no-railguard-available/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/brighton-labs/railguard-cursor-coding/nextjs-typescript-secure-no-railguard-available"><img src="https://agentmods.dev/badge/rules/brighton-labs/railguard-cursor-coding/nextjs-typescript-secure-no-railguard-available.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00658 | $0.00658 |
| Opus 5 | $0.00329 | $0.00329 |
| Sonnet 5 | $0.00132 | $0.00132 |
| Haiku 4.5 | $0.00066 | $0.00066 |
Grade A, and why
nextjs-typescript-secure-no-railguard-available scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.
R: Risk First
- The goal of this rule is to ensure that all TypeScript and Next.js code is not only performant, but also secure, particularly across input handling, data fetching, rendering contexts, and client/server boundaries.
A: Anchored Constraints
- Never expose secrets or tokens in the client bundle.
- Never process authentication logic or sensitive tokens on the client side.
- Never trust user input without validation and sanitization.
- Avoid use of
dangerouslySetInnerHTMLunless explicitly sanitized. - Avoid the use of
anyandunknownin type declarations unless absolutely necessary and justified with a comment.
I: Interpretive Framing
- If generating an API handler, assume it may be hit by a malicious actor — include schema validation (for example, with
zod) and return standardized error responses. - If generating form components, treat all input as untrusted and encode output accordingly.
- If building routes, assume URL parameters may be altered with anything insecure. Apply
z.string().safeParse(...)or equivalent validation.
L: Local Defaults
- Use
zodorvalibotfor runtime validation of all inputs (form values, API payloads, URL params). - Use environment variables via
process.envonly inside server components or server actions. - Apply HTTPS and secure cookies (
HttpOnly,Secure,SameSite=Strict) in all auth flows. - Use
Content-Security-Policyheaders for enhanced front-end protection. - Always set
rel="noopener noreferrer"for links withtarget="_blank".
G: Generative Path Checks
- If working with input (forms, URL params, body): validate with a runtime schema before processing.
- If handling authentication or secrets: ensure logic remains on the server side.
- If displaying user-generated content: escape or sanitize output.
- If using 3rd-party packages: prefer well-maintained libraries with no known CVEs.
- Always explain in comments where secure handling occurs (for example,
// Validated input with zod).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 51 lines · 658 tokens per session scan A 58076af382ca
nextjs-typescript-secure-no-railguard-available is a cursor rule published in the GitHub repository brighton-labs/railguard-cursor-coding (13 stars, last pushed 1y ago), licensed MIT. It adds 658 tokens to every session, about $0.0033 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
state-management
Use the following stack. Do not introduce or recommend Redux or React Context for shared/global state.
mobx
Definitive guidelines for structuring MobX applications with React, focusing on predictable state management, optimal rendering, and modern best practices.
new-component
Workflow for creating new React components.
middleware-auth
Next.js middleware auth — prevents auth logic being placed in middleware instead of route handlers.
performance
Frontend performance optimization rules. Apply when optimizing UI or bundle.
frontend-architecture
Vite + React SPA architecture - directory layout, providers, bundle splitting. Tailwind styling in tailwind.mdc.