authentication-and-rbac
Skill0 starsChanged 3 days agoMITView on GitHub
Design identity and authorization flows that enforce least privilege, tenant isolation, and safe session handling.
In this repository34 other files it gives its agents.
- accessibilitySkill
- admin-panelSkill
- ai-agent-interfaceSkill
- ai-chat-interfaceSkill
- ai-dashboardSkill
- ai-engineeringSkill
- analytics-and-data-visualizationSkill
- animation-and-motionSkill
- api-engineeringSkill
- backend-architectureSkill
- component-engineeringSkill
- dashboard-designSkill
- database-engineeringSkill
- design-intelligenceSkill
- design-systemsSkill
- frontend-engineeringSkill
- iconographySkill
- image-art-directionSkill
- integrations-and-webhooksSkill
- javascript-typescriptSkill
- performance-optimizationSkill
- premium-landing-pagesSkill
- python-engineeringSkill
- rag-and-knowledge-systemsSkill
- responsive-designSkill
- saas-dashboardSkill
- security-engineeringSkill
- super-admin-panelSkill
- testing-and-qualitySkill
- unslop-engineSkill
- ux-researchSkill
- visual-designSkill
- visual-regressionSkill
- website-architectureSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use for login, sessions, invitations, organization membership, roles, permissions, API credentials, or authorization changes.
- Distinctive: line 15
Do not invent a custom cryptographic protocol or treat frontend hiding as authorization.
- Distinctive: line 31
Use secure session/token storage, expiration, rotation, revocation, and CSRF protections as applicable.
- Distinctive: line 40
Default to least privilege and deny by default.
- Distinctive: line 41
Never store plaintext passwords or expose credentials in logs.
- Distinctive: line 42
Use established identity libraries/providers where suitable.
- Distinctive: line 59
Test anonymous, ordinary, admin, revoked, cross-tenant, expired-session, and background-job access paths.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Authentication and RBAC
When to use
Use for login, sessions, invitations, organization membership, roles, permissions, API credentials, or authorization changes.
When not to use
Do not invent a custom cryptographic protocol or treat frontend hiding as authorization.
Inputs and assumptions
Identify identity provider, account lifecycle, tenant model, roles, resources, session requirements, recovery, audit, and regulatory constraints.
Workflow
- Separate authentication (who) from authorization (may do what).
- Define resource/action permissions and inheritance explicitly.
- Enforce checks server-side at every access path, including APIs, jobs, exports, and nested resources.
- Prevent cross-tenant access by deriving scope from trusted identity and membership, not user-supplied tenant IDs alone.
- Use secure session/token storage, expiration, rotation, revocation, and CSRF protections as applicable.
- Make invitation, role change, recovery, and account deletion flows resistant to enumeration and unauthorized takeover.
- Audit security-sensitive changes and test both allowed and denied behavior.
Decision rules
- Default to least privilege and deny by default.
- Never store plaintext passwords or expose credentials in logs.
- Use established identity libraries/providers where suitable.
- Re-check permission when asynchronous work executes.
Example
An organization admin can change a member role only after the backend confirms both the actor's current organization-admin permission and the target's membership in that same organization.
Common failures
- Checking roles only in client routes.
- Trusting client-supplied tenant identity.
- Long-lived credentials without rotation/revocation.
Validation
Test anonymous, ordinary, admin, revoked, cross-tenant, expired-session, and background-job access paths; review audit and recovery behavior.
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.

