npx skills add ...
npx skills add netlify/context-and-tools --skill netlify-access-control
Picks the right Netlify protection layer for a deployed site and disambiguates the three unrelated things people call "auth". Use when a developer wants to password-protect a site or previews, restrict a project to their team, make a project public/private, set team visibility defaults, require SSO to view a site, or debug SSO-session symptoms like being logged out mid-session / getting 401s on an SSO-protected site / token expiry or refresh. Routes app-user login ("who is this user in my app") to the netlify-identity skill and dashboard/team SSO SSO elsewhere; this skill only chooses the perimeter layer for site/preview access.
npx skills add netlify/context-and-tools --skill netlify-access-control
This skill ROUTES. Its job is choosing the correct protection layer for loading a site, not implementing app auth. Before recommending anything, disambiguate — three unrelated layers get called "auth":
nf_jwt). App login, OAuth providers for your users, auth code. → Route to the netlify-identity skill. Not covered here.Sessions are separate. The same provider (e.g. Google) can be an Identity OAuth provider for app users AND a SAML IdP for team members — unrelated wiring.
These settings have no public API, no CLI command, and no MCP tool. Do NOT curl api.netlify.com or read local auth tokens to inspect or change them. Hand the user the dashboard path and checklist. On failure, report what you tried and stop.
A Password-Protection / team-login perimeter session and a Netlify Identity app session have no bridge — no shared cookie, no header forwarding, no JWT exchange. Don't burn iterations trying to wire them together. For the combined Password-Protection + Identity pattern and its tradeoffs, see references/two-layer-pattern.md.
For company-wide app-level SSO with a single sign-in (no double login), recommend the Auth0 extension (federating to the corporate IdP) BEFORE the two-layer stack.
| Goal | Use |
|---|---|
| Restrict site to your team, invite by email | Private project (Credit-based) or team login protection |
| Shared password anyone can use | Basic password protection, or Password visibility (Pro only) |
| Protect only previews, keep production open | "Non-production deploys only" / "Previews only" |
| Require SSO to view the site | Org/Team SSO with Only SSO allowed (strict) + team login protection |
| Log in users inside your app | → netlify-identity skill |
| Single company-wide app SSO, no double login | → Auth0 extension |
The UI names differ by plan — the underlying protection is identical:
Legacy → Credit-based translation:
| Password Protection (old) | Project visibility (new) |
|---|---|
| No protection settings | Public |
| Basic protection | Password |
| Team protection | Private |
| All deploys | Production and previews |
| Non-production deploys only | Previews only |
Credit-based (Project visibility):
Project configuration > General > Visitor access > Project visibility — https://app.netlify.com/projects/{site_name}/configuration/general/#project-visibilityTeam settings > General > Visitor access > Default project visibility — https://app.netlify.com/teams/{team_name}/settings/general#default-project-visibilityEnterprise / Open Source / legacy (Password Protection):
Project configuration > Access & security > Visitor access > Password Protection — https://app.netlify.com/projects/{site_name}/configuration/access#site-protectionTeam settings > Access & security > Visitor access > Default Password Protection settings — https://app.netlify.com/teams/{team_name}/settings/access#default-site-protection-settingsProject configuration > General > Visitor access > Project visibility.Per-site or team default via the paths above → Configure Password Protection → Customize this site's protection settings (if a default exists) → choose Basic password protection (single shared password) or Team login protection (Netlify team login, SSO-capable) → scope All deploys or Non-production deploys only → Save.
https://docs.netlify.com/manage/security/secure-netlify-access/configure-organization-saml-sso) or Team SSO (https://docs.netlify.com/manage/security/secure-netlify-access/configure-team-saml-sso).SSO auth tokens expire after 1 hour. An SSO-protected site starts returning HTTP 401 once the token expires — this is the "logged out mid-session" symptom.
The platform returns a Netlify-Site-Protection-Expires-In response header (seconds until the token expires) on requests to SSO-protected sites. Read it and re-auth before it hits zero:
The header name and semantics are documented; the JS wrapper is illustrative.
One visibility setting — Public, Password, or Private — plus a separate scope (Production and previews or Previews only).
Previews stay private unless you change preview visibility (includes Deploy Previews, agent-run previews, and branch deploys). There is no default shared password — set a password per project.
Team defaults: Private for new projects (new start behind team login; existing keep visibility), Private for all projects (new + all existing locked to team login; none can be made public), Public for new projects (new are public; existing keep visibility).
https://docs.netlify.com/manage/security/secure-access-to-sites/basic-authentication-with-custom-http-headers), which is code you author — out of scope here.See also: references/two-layer-pattern.md for the combined Password-Protection + Identity pattern.
These are org conventions, not docs facts — merged into the rendered skill by ctx-gen and never generated. Owned by the skills maintainer.
references/two-layer-pattern.md.nf_jwt),
Password Protection / project visibility ("can this request load the site
at all"), and Team/Org SAML SSO ("can you log in to the Netlify
dashboard"). Sessions are separate; the same provider (Google) can appear
in two unrelated places — Identity OAuth for app users, SAML IdP for team
members. Disambiguate before recommending anything.references/two-layer-pattern.md.api.netlify.com or read local auth tokens to inspect or change them —
hand the user the dashboard path and checklist; on failure, report what
you tried and stop.Netlify-Site-Protection-Expires-In guidance is unreachable if the
skill never triggers on the symptom.