netlify-identity

netlify-identity is a cursor rule for Cursor from netlify/context-and-tools. It costs 126 tokens per session (3,774 once invoked), scanned C, original, MIT.

Rules for adding Netlify Identity, a Netlify service for user signup, login, social login, roles, and account administration, to a website.

In plain words
What is it for?
Use it to add login and signup, Google or other social sign-in, server-side user checks, role-based access control, admin user management, and identity event hooks to a Netlify site.
Why use it?
It prevents common authentication mistakes, such as testing in an unsupported local environment, building duplicate OAuth code, or sending users without permission to an unusable page.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to add login and signup, Google or other social sign-in, server-side user checks, role-based access control, admin user management, and identity event hooks to a Netlify site.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/netlify/context-and-tools/netlify-identity
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/netlify/context-and-tools

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 netlify-identity

README.md
[![agentmods](https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-identity/github.svg)](https://agentmods.dev/rules/netlify/context-and-tools/netlify-identity)
Your own site
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-identity"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-identity/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 netlify-identity

Your own site · 80×15
<a href="https://agentmods.dev/rules/netlify/context-and-tools/netlify-identity"><img src="https://agentmods.dev/badge/rules/netlify/context-and-tools/netlify-identity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,774 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.00126 $0.03774
Opus 5.5 $0.00050 $0.01510
Sonnet 5.5 $0.00025 $0.00755
Haiku 4.5 $0.00013 $0.00377

Measured 27d ago against content hash 4d9984970a27, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

netlify-identity scanned grade C with 2 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 27d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- system: agent-context/identity/system.md — human-owned, merged by ctx-gen; edit system.md, not this section -->

Makes network callslowCapability

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

> **Identity config is dashboard-only. There is no public API.** Never curl `api.netlify.com` to flip or read Identity settings, never read tokens from local Netlify config, and never probe undocumented endpoints. Enable
cursor/rules/netlify-identity.mdc · 298 lines

How it starts

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

Netlify Identity

Use @netlify/identity (npm). For new projects it replaces the legacy netlify-identity-widget and gotrue-js. Do not reach for those.

npm install @netlify/identity

Framework examples (Next.js/Astro/Remix/SvelteKit) and the full API reference are in the @netlify/identity README on npm.

Identity does not run under netlify dev. Test all auth flows on a deploy. Deploy Previews work. Local dev will not complete signup/login/OAuth.

Identity config is dashboard-only. There is no public API. Never curl api.netlify.com to flip or read Identity settings, never read tokens from local Netlify config, and never probe undocumented endpoints. Enable and configure Identity at https://app.netlify.com/projects/{site_name}/identity.

Never build a from-scratch OAuth flow alongside Identity. No provider app registration in code, no client_id/secret in source, and no custom callback token exchange. Use oauthLogin() + handleAuthCallback(). Raw OAuth beside Identity is the most common source of rework.

Client auth (browser)

import { signup, login, logout, getUser, oauthLogin, handleAuthCallback } from '@netlify/identity'

// Register — confirmation email sent by default (unless autoconfirm is on)
const user = await signup('[email protected]', 'securepassword', { full_name: 'Jane Doe' })

// Log in / out
await login('[email protected]', 'securepassword')
await logout()

// Current user or null
const current = await getUser()
if (current) console.log(`Logged in as ${current.email}`)

// External provider — redirects the browser; provider is one of
// 'google' | 'github' | 'gitlab' | 'bitbucket'
oauthLogin('github')

handleAuthCallback() is mandatory on your landing page. Without it, OAuth redirects, email-confirmation links, password-recovery links, and invite links never complete. Call it on page load.

Invites are NOT logged in by handleAuthCallback(). For an invite it returns type === 'invite' with the token in result.token and result.user === null. The account does not exist yet. You must collect a password and call acceptInvite(result.token, password). If you skip this step, invited users never get an account.

Read the full file on GitHub · 298 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. 27d ago Changed · +30 lines · +5 tokens per session 4d9984970a27
  2. 2mo ago Changed · +6 lines c4bf0ab593ee
  3. 2mo ago Changed · -32 lines · -2 tokens per session 4d79bd826276
  4. 3mo ago First seen · 294 lines · 123 tokens per session scan C c163aafc1aee

Subscribe to this mod's changes

netlify-identity is a cursor rule published in the GitHub repository netlify/context-and-tools (58 stars, last pushed 4d ago), licensed MIT. It adds 126 tokens to every session and 3,774 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 2 findings (hidden instructions, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

netlify-identity compared with cursor rules from other repositories

netlify-identity next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
netlify-identitynetlify/context-and-toolsCursor rule584d agoMITC126Cursor
djangosanjeed5/awesome-cursor-rules-mdcCursor rule3.6k8d agoCC0-1.0A2,043Cursor
api-property-optionality-hygienenovuhq/novuCursor rule40ktodaynoneA0Cursor
cursormrwogu/promptscriptCursor rule324yesterdayMITA53Cursor
pythonPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A734Cursor
gosupertokens/create-supertokens-appCursor rule244d agoApache-2.0A0Cursor
ehs-ims-conventionsSafetyMP/Autonomous-EHS-ManagementCursor rule92d agoApache-2.0A722Cursor