/agentic-awesome-skills:saas-authorizationfrom agentic-awesome-skills
Guides authorization design for multi-tenant SaaS apps: sign-in, roles, data routes, API tokens, webhooks, and threat modeling across tenant boundaries.
Ships in agentic-awesome-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Keep the scope, sandbox, credentials and approval settings supplied by the user or host. Obtain authorization before delegating, exposing project files to another provider, enabling connectors or hooks, using paid services or deploying. Use synthetic or redacted inputs for examples. Keep security reviews static and defensive, with findings and fixes grounded in source inspection.
Adding sign-in, a role, a route that touches data, API tokens, a webhook or job, or 'is this secure': who may do what in a multi-tenant SaaS.
Decide who may act on what across every tenant boundary. This skill covers authorization and the threat classes every multi-tenant app has, whatever it does.
Keep the principle and substitute your stack's mechanism. Each principle precedes the Clerk, Supabase or Next mechanism. Apply clerk-production and supabase-production for vendor mechanics in depth.
references/documents-and-tests.md). It is the intent an audit compares the code against (intended-vs-implemented, security-audit-static). Beside it sit the architecture doc (what exists: routes, ownership, invariants, known risks), the flows doc (the journeys where permissions, money or personal data are exercised) and the backlog (deferred work, each with the trigger that reopens it). What each must say about authorization is in the same file; shipping-artifacts defines the core set.@supabase/ssr and a browser key, a middleware path list deciding who may see a page.Read references/model.md for each full rule, reason and receipt.
workspaces table holds the identity provider's org or user id, with one exception, authorship (who wrote a note, who labelled a row), which gets one table of its own: a member row holding only the workspace, the provider's user id and the product's own member id, made on the member's first write, never read for authorization and never a copy of a name, an email or a role; author columns reference that row, so a change of provider is two tables.resolve<Thing>(publicId) → the thing and its workspace. requireVisitor(thingId, cookie) → the anonymous visitor row. requireWorkspaceAccess(workspaceId, auth, permission) → throws unless the caller holds that permission in that workspace.references/model.md). A caller with no session that the server handles (an API token, a job) reads the subscription for the plan, and the provider's plan list for that plan's features, never the subscription's embedded copy. A background worker that must know a plan may read a mirror the app writes only from a verified read, and only to route work. Gate on features, not plan names, and fail towards the free tier.| Class | The rule | Depth |
|---|---|---|
| Untrusted text | Plain text unless rich text is needed, and then a server-side allowlist sanitizer. Validate shape on client and server, and escape on render. A CSP header. An origin check on every mutation, reading Sec-Fetch-Site first. Every route handler reads its body through one helper that has its own byte ceiling, counted while the body streams | references/threat-model.md § Untrusted text |
| Abuse and floods | Per-IP flood limits at the host's edge (one rule per surface: member, public). Per-actor budgets in the app, answered by 429 + Retry-After or a structured delay. One client wrapper for refused calls. Turnstile only where abuse shows | § Abuse and floods |
| Cross-tenant access | Every query scoped by workspace through the three functions, and a cross-tenant test on every route that touches data | § Cross-tenant access |
| Origin bypass | A secret header from the proxy, checked by the app. It needs a host that accepts a proxy. Until then, trust no forwarded header | § Origin bypass |
| Leaked tokens | prefix_<kid>.<secret>, stored as kid + HMAC(pepper, owner ‖ secret). Shown once, compared in constant time, revoked by tombstone. Scoped and workspace-owned | § Leaked tokens and credentials |
| Leaked database | Ids and hashes, not identities: no emails, no profile copies, no IPs. Logs hold ids, never bodies | § Leaked database |
| Anonymous identity | The token is the visitor. A surface that needs enforceable identity refuses to work without the cookie, and says what the cookie is for | § Anonymous identity |
| Webhooks | Verify signatures, handle replays idempotently, process only events you own | § Webhooks |
| Scheduled work | No public cron endpoint. Each run idempotent: a unique key per run, or a receipt per unit of work claimed under a lease | § Scheduled work |
| Secrets | Never in the repo, a URL, a log line or a client bundle. server-only on every module that imports one. A leaked key is rotated before anything else; a planned rotation reaches every holder before the old value is revoked | § Secrets |
| Calls to customer-supplied addresses | Only https, resolved once and refused unless public (no loopback, private, link-local or metadata address), connected to the address checked, every redirect checked again, time and size capped, nothing of yours sent | § Calls to customer-supplied addresses |
| Customer secrets | Encrypted before they reach the database, under a key held outside it, bound to their row; decrypted only where used; never shown back, logged or returned | § Customer secrets at rest |
| Embedded agents | What an agent can do is bounded by its tools, never by its prompt. Each run and each actor has a cost ceiling | § Embedded agents |
references/model.md § Roles and entitlements never touch).security-audit-static on the release's changes before release. It compares code against the permissions doc. The release procedure itself is release-gate.references/documents-and-tests.md § Authorization test matrix.A denial test must prove it reached the check it claims to test. A 404 from a function that does not exist passes for an ownership check that works (references/documents-and-tests.md § Rules that came from bugs). Which harness runs each test is test-harness.
Each rule's origin, the case that taught it, is in receipts.md beside this file; read it when a rule's edge is unclear.
A member of one workspace, holding another workspace's ids, can neither see nor change its data, and a test in the gate proves it.
| File | Holds | Read when |
|---|---|---|
references/model.md | workspaces and the two shapes; the two credentials; deterministic enforcement; the three functions; the active organization; permissions and roles, and what screens show and say; entitlements; roles vs entitlements; invariants as constraints; unguessable ids and public reads | adding sign-in, a workspace, a role, a permission, a plan limit, or any route that touches data |
references/threat-model.md | each threat class in depth, with the stack's mechanism: the body helper, the origin check, edge and per-actor limits, the origin seal, token storage, what the database may hold, the anonymous cookie, webhooks, jobs, secrets, calls to customer-supplied addresses, customer secrets at rest, agents | adding a public surface, a mutation, an API token, a webhook, a job, a secret or an agent; a security review |
references/documents-and-tests.md | what the permissions, architecture and flows docs must hold about authorization; the required tests; the authorization rules that came from bugs; reading the matrix against intent | writing or checking those docs; writing an authorization test; reviewing a permission matrix |
clerk-production or supabase-production. This skill keeps the principle and a one-line pointer.Build a synthetic role matrix for the project list and compare each route result with the approved permissions for owner, member and guest.
Treat upstream examples as patterns. Validate scope and results against current project constraints, available tools and decisions recorded by the owner.
Adapted from Pawel Huryn’s upstream skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
saas-authorization, multi-tenant, access-control, rbac, threat-modeling
Generated from the plugin's indexed repository (sickn33/agentic-awesome-skills) — no native marketplace selected
npx claudepluginhub p/sickn33-antigravity-awesome-skills3,195 skills in this plugin
/007Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project./00-andruia-consultantUsar al iniciar o mejorar un proyecto de IA: diagnostica código y restricciones, propone skills existentes y redacta tareas y un plan de implementación en español./10-andruia-skill-smithUsar para crear o mejorar una skill de Andru.ia: define entradas y resultados, redacta SKILL.md con ejemplos y límites, valida la estructura y prepara una PR.2 plugins in one repository ship this exact skill · first indexed Nov 21, 2026
Other plugins' skills for the same job