shadow-auth
Skill1 starsChanged yesterdayMITView on GitHub
Identity, AuthN & AuthZ Engineering. Use when implementing or reviewing login, RBAC/ABAC, OAuth2/OIDC, SSO, JWT/session rotation, multi-tenant isolation, or security audit trails.
In this repository51 other files it gives its agents.
- antislop-codeSkill
- antislop-copywritingSkill
- antislop-humanSkill
- antislop-layoutmobileSkill
- antislopSkill
- antislop-uiSkill
- context7Skill
- handoffSkill
- shadow-accessibilitySkill
- shadow-apiSkill
- shadow-architectSkill
- shadow-bootstrapSkill
- shadow-browserSkill
- shadow-cacheSkill
- shadow-compatSkill
- shadow-concurrencySkill
- shadow-dataSkill
- shadow-dbSkill
- shadow-debugSkill
- shadow-designSkill
- shadow-discoverySkill
- shadow-docSkill
- shadow-domainSkill
- shadow-eaSkill
- shadow-evalSkill
- shadow-finopsSkill
- shadow-gitSkill
- shadow-grcSkill
- shadow-handoverSkill
- shadow-integrateSkill
- shadow-maintainSkill
- shadow-mobileSkill
- shadow-modernizeSkill
- shadow-monarchSkill
- shadow-observeSkill
- shadow-opsSkill
- shadow-perfSkill
- shadow-planSkill
- shadow-pmoSkill
- shadow-presalesSkill
- shadow-privacySkill
- shadow-qualitySkill
- shadow-realtimeSkill
- shadow-refactorSkill
- shadow-releaseSkill
- shadow-resilienceSkill
- shadow-searchSkill
- shadow-secSkill
- shadow-supplychainSkill
- shadow-testSkill
- shadow-uatSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 2 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill whenever designing, implementing, or modifying login, registration, password reset, MFA, SSO/OAuth2/OIDC, role/permission …
- Very specific: line 14
Password Hashing: Always hash passwords with Argon2id (preferred) or bcrypt (cost $\ge 12$).
- Very specific: line 19
JWT + Refresh Token Rotation: Keep access tokens short-lived (5–15 minutes).
- Very specific: line 29
Prefer fine-grained permissions (invoice:create, invoice:approve, invoice:read:own, invoice:read:tenant) mapped to roles rather than …
- Very specific: line 31
Never fetch, update, or delete by primary key id alone (WHERE id = $1).
- Very specific: line 32
Always scope queries by the authenticated user's tenant_id / organization_id (WHERE id = $1 AND tenant_id = $2) or enforce PostgreSQL …
- Very specific: line 33
Never trust tenant_id, user_id, or role sent in the request body/query if it belongs to the authenticated caller's session context.
- Distinctive: line 39
Every privileged or security-sensitive action (login success/failure, password reset, role/permission change, user impersonation, …
- Very specific: line 51
Object/Tenant Policy Matrix Tests: Every protected endpoint must include automated negative authorization tests asserting 403/404 for (a) …
- Distinctive: line 52
Confused Deputy & Privilege Escalation Prevention: Never derive acting identity or tenant scope from request parameters when an …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shadow Auth (/shadow-auth) — Identity, RBAC/ABAC, Multi-Tenancy & Session Lifecycle
Use this skill whenever designing, implementing, or modifying login, registration, password reset, MFA, SSO/OAuth2/OIDC, role/permission guards, or multi-tenant data isolation.
1. Authentication & Credential Security Rules (OWASP ASVS V2 & V3)
- Password Hashing: Always hash passwords with
Argon2id(preferred) orbcrypt(cost $\ge 12$). Never use SHA-256/MD5 or reversible encryption for passwords. - Account Enumeration Prevention: Login, registration, and forgot-password endpoints must return generic user-facing messages and consistent timing so attackers cannot probe valid emails/usernames.
- Brute-Force & Credential Stuffing Protection: Enforce rate limiting per IP and per account identifier (e.g., max 5 failed attempts per 15 minutes with progressive lockout or CAPTCHA challenge).
- Session & Token Lifecycle:
- Cookie Sessions / Refresh Tokens: Store in
HttpOnly,Secure,SameSite=Lax(orStrict) cookies. - JWT + Refresh Token Rotation: Keep access tokens short-lived (
5–15 minutes); persist hashed refresh tokens in DB/Redis with atoken_family_idso reuse of a rotated refresh token immediately revokes the entire session family. - Immediate Revocation: Password change, role downgrade, or account deactivation must immediately invalidate all active sessions/refresh tokens for that user.
- Cookie Sessions / Refresh Tokens: Store in
2. Authorization Architecture (RBAC, ABAC & Zero-IDOR)
- Server-Side Enforcement at Every Entry Point:
- UI route guards and hidden buttons are for UX only — every API route, GraphQL resolver, server action, and export endpoint MUST enforce both Authentication and Authorization on the server.
- Permission Matrix Design (
Role -> Permission -> Resource Scope):- Prefer fine-grained permissions (
invoice:create,invoice:approve,invoice:read:own,invoice:read:tenant) mapped to roles rather than scatteringif (user.role === 'ADMIN')checks across controllers.
- Prefer fine-grained permissions (
- Strict Multi-Tenant & Ownership Isolation (Anti-IDOR):
- Never fetch, update, or delete by primary key
idalone (WHERE id = $1). - Always scope queries by the authenticated user's
tenant_id/organization_id(WHERE id = $1 AND tenant_id = $2) or enforce PostgreSQL Row-Level Security (RLS). - Never trust
tenant_id,user_id, orrolesent in the request body/query if it belongs to the authenticated caller's session context.
- Never fetch, update, or delete by primary key
3. Immutable Security Audit Trail (audit_logs)
Every privileged or security-sensitive action (login success/failure, password reset, role/permission change, user impersonation, approval/rejection, data export, record deletion) MUST write an append-only audit log entry containing:
id(UUIDv7 / ULID)timestamp(UTCTIMESTAMPTZ)actor_user_id,actor_role,tenant_idip_address,user_agent,request_idaction(e.g.,USER_ROLE_UPDATED,INVOICE_APPROVED)target_entity,target_idbefore_state&after_state(with secrets/PII redacted)
4. Policy Test Matrix, Confused Deputy & Escalation Gates
- Object/Tenant Policy Matrix Tests: Every protected endpoint must include automated negative authorization tests asserting
403/404for (a) unauthenticated caller, (b) authenticated Tenant A accessing Tenant B object (IDOR/BOLA), and (c) lower-role caller attempting privileged mutation. - Confused Deputy & Privilege Escalation Prevention: Never derive acting identity or tenant scope from request parameters when an authenticated session exists; reject mass-assignment of
role,permissions,tenant_id, oris_verifiedvia explicit DTO allowlists. - Revocation Propagation: Session revocation, password rotation, or role downgrade must reject existing access/refresh tokens (and notify active
/shadow-realtimeconnections) within bounded SLA.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

