nuxt-security

nuxt-security is a cursor rule for Cursor from YuDefine/nuxt-supabase-starter. It costs 0 tokens per session (3,982 once invoked), scanned A, original, MIT.

A shared security baseline for Nuxt applications that use the nuxt-security module. It standardizes browser security headers, content rules, and related settings while allowing documented app-specific exceptions.

In plain words
What is it for?
It helps teams configure Content Security Policy, browser headers, CSRF-related settings, and per-application security exceptions consistently.
Why use it?
Without a common baseline, separate applications can slowly adopt different security settings and leave gaps in protections such as content restrictions, request origins, or form actions.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions Codex.

Good fit It helps teams configure Content Security Policy, browser headers, CSRF-related settings, and per-application security exceptions consistently.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/nuxt-security
Install

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.

Clone the repo
git clone --depth 1 https://github.com/YuDefine/nuxt-supabase-starter

Made for: Cursor.

Wrote 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.

agentmods badge for nuxt-security

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/nuxt-security/github.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/nuxt-security)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/nuxt-security"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/nuxt-security/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.

agentmods 80×15 button for nuxt-security

Your own site · 80×15
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/nuxt-security"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/nuxt-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03982
Opus 5 $0.00000 $0.01991
Sonnet 5 $0.00000 $0.00796
Haiku 4.5 $0.00000 $0.00398

Measured yesterday against content hash 117e3b2aa124, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

nuxt-security scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

對應不上 = 該 endpoint 對外 POST **必定** HTTP 403。建議部署後立刻 `curl -X POST` 一次驗收。
template/.cursor/rules/nuxt-security.mdc · 330 lines

How it starts

The opening of the file, as written. The whole thing — 330 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Nuxt Security Baseline

本 rule 適用於有裝 nuxt-security 模組的 Nuxt consumer。目的:把 4+ 個 consumer 重複出現的 CSP / headers / CSRF baseline 統一規範化,避免各 consumer 漂移;保留 per-consumer 必然差異(connect-src / script-src / csurf 例外)讓專案各自宣告。

Baseline(必對齊欄位)

security 區塊MUST 包含以下 baseline。禁止修改值(除非有書面 ADR 記錄理由):

security: {
  rateLimiter: false,                        // CF Workers 相容;自架 Nitro 也建議走 reverse proxy 做 rate limit
  headers: {
    crossOriginEmbedderPolicy: false,        // 避免擋 SSR images
    contentSecurityPolicy: {
      'base-uri': ["'none'"],
      'font-src': ["'self'", 'https:', 'data:'],
      'form-action': ["'self'"],
      'frame-ancestors': ["'none'"],
      'img-src': ["'self'", 'data:', 'https:'],
      'object-src': ["'none'"],
      'script-src-attr': ["'none'"],
      'style-src': ["'self'", "'unsafe-inline'"],
      'upgrade-insecure-requests': true,
      // ⬇ 以下四條 per-consumer 必填或選填,見下節
      // baseline 預設含 'self' + 'https://cloudflareinsights.com'(CF Web Analytics beacon report endpoint)
      'connect-src': ["'self'", 'https://cloudflareinsights.com', /* per-consumer extend */],
      // 'script-src': [...],   // 選填;若啟用 MUST 同時含 'https://static.cloudflareinsights.com'(CF beacon CDN)
      // 'frame-src': [...],    // 選填
      // 'worker-src': [...],   // 選填(用到 Web Worker / blob worker 時)
    },
    xFrameOptions: 'DENY',
  },
  csrf: true,
}

Per-consumer 必填欄位

connect-src

每個 consumer MUST 明列 connect-src,至少包含:

'connect-src': [
  "'self'",
  'https://cloudflareinsights.com',     // baseline — CF Web Analytics beacon report endpoint(見 § Cloudflare Web Analytics beacon)
  // 視 consumer 額外加:
  // 'https://api.iconify.design',         // 用 @nuxt/icon 且未切 server-bundle 時 dev mode 會打 iconify CDN
  // 'https://accounts.google.com',        // Google OAuth / Google Identity Services
  // 'https://*.supabase.co',              // Supabase managed
  // 'https://<your-self-hosted-supabase>',// Supabase self-hosted(明列 host,不要 wildcards)
  // 'https://*.ingest.sentry.io',         // Sentry SaaS
  // 'https://*.ingest.us.sentry.io',      // Sentry SaaS(US region)
  // 'https://*.line.me',                  // LINE LIFF / Login
],

Read the full file on GitHub · 330 lines

Changes

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.

  1. yesterday Changed · -5 lines 117e3b2aa124
  2. 4d ago Changed · +1 lines ef6283d9ad56
  3. 8d ago First seen · 334 lines · 0 tokens per session scan A 9558c774f886

Subscribe to this mod's changes

nuxt-security is a cursor rule published in the GitHub repository YuDefine/nuxt-supabase-starter (45 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,982 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.