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.
npx agentmods add rules/netlify/context-and-tools/netlify-access-control-two-layer-patterngit clone --depth 1 https://github.com/netlify/context-and-toolsWhat 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 | $0.00024 | $0.01237 |
| Opus 5 | $0.00012 | $0.00619 |
| Sonnet 5 | $0.00005 | $0.00247 |
| Haiku 4.5 | $0.00002 | $0.00124 |
Grade A, and why
netlify-access-control-two-layer-pattern 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.
How it starts
The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Two-Layer Pattern: Company-Only Access + Per-User Identity
A common enterprise ask conflates two concerns:
- Perimeter — the deployed app should be reachable only by company employees.
- In-app identity — the app should tell users apart (per-user data, roles).
These are different layers (see the main skill). Below are the four ways to satisfy them on Netlify, ordered from least to most friction, plus why the naive "stack both" approach forces a double login.
Option A — Invite-only Netlify Identity (best default for "just my team")
Enable Netlify Identity in invite-only registration mode and invite only company addresses. Identity becomes the perimeter and the in-app identity: no uninvited user can sign in, and every signed-in user is a real Identity user with nf_jwt and roles.
- Plans: all (free).
- Logins: one.
- Per-user identity: full (roles via
app_metadata, role-based redirects vianf_jwt). - Tradeoffs: manual invite management; no automatic provisioning from a corporate directory; relies on invite links not being shared. Great for internal tools and small teams; doesn't scale cleanly to thousands of employees.
Option B — Auth0 extension (best for a real org with an existing IdP)
Use the Netlify Auth0 extension instead of (or alongside) Identity. Configure Auth0 to federate with the company's IdP (Okta, Entra, Google Workspace, etc.). Auth0 enforces "company-only" via its connection/organization settings and supplies per-user identity — in a single sign-in.
- Plans: Auth0 extension (enterprise-oriented); more setup than Identity.
- Logins: one (federated SSO).
- Per-user identity: full, from the corporate directory; supports auto-provisioning.
- Tradeoffs: more moving parts than Identity; requires Auth0 configuration. This is the path when invite-only Identity won't scale. Configured via the Netlify Auth0 extension — see the Netlify docs setup guide for Auth0.
Option C — Basic Password Protection + Netlify Identity
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.
- 2d ago First seen · 74 lines · 1,237 tokens per session scan A d599cb678694
netlify-access-control-two-layer-pattern is a cursor rule published in the GitHub repository netlify/context-and-tools (36 stars, last pushed 5d ago), licensed MIT. It adds 24 tokens to every session and 1,237 once invoked, about $0.0001 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
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.