authentication-authorization
Skill198 starsChanged 4 days agoMITView on GitHub
Design identity, authentication, sessions, authorization, roles, permissions, and tenant access consistently across application types.
In this repository20 other files it gives its agents.
- api-designSkill
- application-securitySkill
- apply-renovate-prsSkill
- architecture-guidelinesSkill
- configuration-and-secretsSkill
- data-access-and-migrationsSkill
- database-designSkill
- deployment-and-deliverySkill
- external-integrations-and-messagingSkill
- java-code-reviewSkill
- jspecify-skillSkill
- observabilitySkill
- pair-programmingSkill
- progenSkill
- reliability-and-performanceSkill
- spec-writerSkill
- spring-boot-skillSkill
- spring-modulith-verifierSkill
- technical-decision-makingSkill
- testing-strategySkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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 12
Use when adding login, logout, registration, account recovery, federation, service identities, roles, permissions, tenant isolation, or …
- Distinctive: line 15
Prefer established identity protocols and maintained identity providers over custom authentication mechanisms.
- Distinctive: line 16
Treat authentication (who is the caller?) and authorization (what may they do?) as separate decisions.
- Distinctive: line 18
Use stable internal subject identifiers.
- Distinctive: line 23
Keep service-to-service identities separate from human identities.
- Distinctive: line 34
Test both permitted and forbidden access paths, including cross-user and cross-tenant access.
- Distinctive: line 37
Never store plaintext passwords.
- Distinctive: line 39
Avoid long-lived bearer credentials unless there is a justified design and compensating protection.
- Distinctive: line 41
Do not trust client-supplied roles, user IDs, tenant IDs, or permission claims without verification.
- Distinctive: line 44
Avoid account enumeration in public-facing recovery and login responses where relevant.
- Distinctive: line 46
Ensure administrative and support access is tightly controlled and auditable.
- Distinctive: line 59
Document identity types, authentication flow, session/token policy, permission model, tenant/ownership rules, lifecycle workflows, and …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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 Authorization
Purpose
Guide identity and access-control design independently of any identity provider, protocol, framework, or language.
When to use
Use when adding login, logout, registration, account recovery, federation, service identities, roles, permissions, tenant isolation, or protected operations.
Design principles
- Prefer established identity protocols and maintained identity providers over custom authentication mechanisms.
- Treat authentication (who is the caller?) and authorization (what may they do?) as separate decisions.
- Define the application’s identity model before implementing endpoints.
- Use stable internal subject identifiers; do not rely on mutable email addresses as primary identity keys.
- Model permissions around actions and resources. Roles may group permissions but should not become the only authorization mechanism when resource-level rules are needed.
- Enforce authorization at the trusted server-side boundary for every protected operation.
- Apply least privilege and deny by default.
- Make ownership, tenant membership, delegation, and administrative access explicit.
- Keep service-to-service identities separate from human identities.
- Design account lifecycle and recovery as security-critical workflows.
Workflow
- Identify user types, service actors, tenants, and administrative actors.
- Define identity attributes and stable identifiers.
- Select an established authentication approach appropriate to clients and deployment.
- Define session/token lifecycle: issuance, expiry, renewal, revocation, storage, and logout semantics.
- Define authorization rules for actions, resources, ownership, and tenant boundaries.
- Specify registration, verification, recovery, lockout, and account deactivation behavior where applicable.
- Define audit events for login, failures, privilege changes, and sensitive actions.
- Test both permitted and forbidden access paths, including cross-user and cross-tenant access.
Security expectations
- Never store plaintext passwords; use a purpose-built password hashing algorithm and appropriate parameters.
- Protect credentials and tokens in transit and at rest.
- Avoid long-lived bearer credentials unless there is a justified design and compensating protection.
- Validate token issuer, audience, signature, expiry, and relevant claims.
- Do not trust client-supplied roles, user IDs, tenant IDs, or permission claims without verification.
- Protect browser sessions with appropriate cookie flags and CSRF defenses.
- Rate-limit credential, recovery, and verification workflows.
- Avoid account enumeration in public-facing recovery and login responses where relevant.
- Revoke or invalidate sessions after credential changes and account compromise.
- Ensure administrative and support access is tightly controlled and auditable.
Authorization test matrix
For each protected resource, test:
- Anonymous caller.
- Authenticated caller without permission.
- Authorized owner.
- Different authenticated user.
- User in a different tenant.
- Privileged administrator.
- Revoked, expired, or disabled identity.
Expected output
Document identity types, authentication flow, session/token policy, permission model, tenant/ownership rules, lifecycle workflows, and audit requirements. Avoid adding roles or permission abstractions that the product does not need.
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.

