agentleFS
K95M65K95M65/AI_ONBOARD/skills/identity-management/SKILL.md

identity-management

Skill0 starsChanged 5 months agoMITView on GitHub

Design and review authentication and authorization — sessions, tokens (JWT), OAuth2/OIDC, RBAC/ABAC, MFA, and password handling. Use when building or auditing login, access control, or any "who can do what" logic.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    OAuth2 / OIDC: use a library; use Authorization Code + PKCE.

    line 23
  2. Distinctive:

    Enforce on every action, server-side, deny-by-default: Never rely on a hidden UI element as a control.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Identity management

The two questions: authentication (who are you?) and authorization (what may you do?). Most access bugs are authorization bugs — see the checklist and reference.md.

When to use

Building or reviewing login, sessions, access control, or any permission decision.

Authentication

  • Passwords: hash with a slow, salted KDF (Argon2id / bcrypt / scrypt) — never fast hashes, never plaintext. Enforce length over complexity; check against breached-password lists.
  • MFA: offer TOTP/WebAuthn for sensitive accounts; WebAuthn/passkeys where you can.
  • Sessions vs tokens: server sessions (opaque id + secure cookie) are simplest and revocable. JWTs are stateless but hard to revoke — keep them short-lived with a refresh flow, and validate alg, iss, aud, exp every time. Never accept alg: none.
  • OAuth2 / OIDC: use a library; use Authorization Code + PKCE; validate state (CSRF) and the id-token signature. Don't invent your own flow.

Authorization

  • Enforce on every action, server-side, deny-by-default. Never rely on a hidden UI element as a control.
  • Check the resource, not just the route — the #1 bug is IDOR (user A reads user B's record by id).
  • RBAC or ABAC, centrally enforced (middleware/policy layer), not scattered per-handler ifs.
  • Least privilege for the identity's scope and token lifetime.

On Cloudflare

For app-level access without building auth, Cloudflare Access (Zero Trust) gates apps by identity/policy; pair with Workers for fine-grained checks. See the cloudflare-one skill if vendored.

Verify

Pair with security-review/security-audit; specifically probe for IDOR, missing server-side checks, alg:none/unvalidated JWTs, and long-lived tokens.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.