security-policy

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

A locked structure for a repository’s SECURITY.md file, which documents public entry points, trust boundaries, identity rules, sensitive assets and security requirements. It also defines how security scan findings are interpreted.

In plain words
What is it for?
Use it to document APIs and routes, authentication and authorisation layers, important data and secrets, and the enforcement point for each security rule.
Why use it?
It gives automated security checks the context needed to tell an intended operation from a missing protection, instead of checking code syntax alone.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/yudefine/nuxt-supabase-starter/security-policy
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 security-policy

README.md
[![agentmods](https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/security-policy.svg)](https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/security-policy)
Your own site
<a href="https://agentmods.dev/rules/yudefine/nuxt-supabase-starter/security-policy"><img src="https://agentmods.dev/badge/rules/yudefine/nuxt-supabase-starter/security-policy.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 875 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00875
Opus 5 $0.00000 $0.00438
Sonnet 5 $0.00000 $0.00175
Haiku 4.5 $0.00000 $0.00088

Measured 2d ago against content hash d51920724280, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

security-policy 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 2d 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.

template/.cursor/rules/security-policy.mdc · 41 lines

What it actually says

Security policy(SECURITY.md 安全憲法)

SECURITY.md 是這個 repo 安全不變量的 SoT。Codex Security 掃描($CLADE_HOME/scripts/security-scan.ts)在 target 有它時自動當 --knowledge-base 餵入;沒有它,掃描只看語法——程式碼裡的「刪除專案」是漏了授權還是正常功能,只有憲法答得出來。

五段固定結構(REQUIRED,順序固定)

寫什麼 從哪裡盤點
## 攻擊入口 對外可達的 API / route 分群,含每一個未認證入口(token 連結、webhook、公開表單、kiosk / 裝置端點)逐條列 server/api/**server/routes/**
## 信任邊界 請求在哪一層從「外部」變「可信」:middleware 名稱、session 型態、service-role client 准用的範圍 server/middleware/**
## 身分與授權模型 第一行明寫 user-ownedtenant-scoped;每層 enforcer(RLS / middleware / handler)各負責什麼 schema 的擁有者欄位 + RLS policy
## 核心資產與 secret 最值錢的資料表,加上所有 secret 的 key 名(NEVER 寫值) .env.example
## 安全不變量 每條格式 - INV-n: <NEVER 句> — enforced by: rls|middleware|handler|storage|queue 前四段推出

不變量 MUST ≥ 5 條,每一條都要有 enforced by——沒有執行層的不變量,掃描器找不到反面證據,只能報候選、報不了 finding。

條件句

  • 這個 repo 沒有 SECURITY.md → 先從 $CLADE_HOME/vendor/snippets/security-policy/ 的範本(user-ownedtenant-scoped)建一份,再動 Tier 3 路徑
  • SECURITY.md 的任一條不變量改了 → 上一次 security-scan.ts baseline 即過期(audit 以 ledger 的 security_md_sha 判),下一次 Tier 3 commit 前重跑
  • 掃描報告的每一條 finding → 先走 security-evidence finding(Severity / Confidence / Coverage / Proof Gap)判讀,再登 TD;wrapper 只掃不修

精簡

每段只寫掃描器判斷需要的事實:範例、教學、逐 endpoint 的 handler 描述都不放——它是 --knowledge-base,每個字都進 prompt。

機械稽核:node $CLADE_HOME/scripts/audit-security-policy.ts --consumers <path>。成因與文章論證:docs/rule-rationale/security-policy.md

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. 2d ago First seen · 41 lines · 0 tokens per session scan A d51920724280

Subscribe to this mod's changes

security-policy 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 875 tokens. 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-09-03.