
Auth and rbac
Guides FastAPI auth with session or JWT chains, argon2id hashing, MFA and RBAC
Auth and rbac is an open-source agent skill for security. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 13
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Auth and rbac
This skill gives the agent a reference set of FastAPI authentication and authorization patterns drawn from identity services and multi-tenant backends. It covers session and JWT dependency chains, RS256 token issuance with key rotation and a JWKS endpoint, refresh token rotation, and argon2id password hashing run off the event loop. It also covers MFA with TOTP and email one-time codes, backup codes, and a role hierarchy with org and subtree access checks.
The material is organized as conventions, code skeletons and anti-patterns, with separate reference files for dependencies, RBAC, token and hashing details, and security hardening such as rate limiting, lockout and session fingerprinting. It also explains when to choose RBAC, ABAC or ACL models and outlines an OAuth 2.0 authorization-code flow with PKCE and state checks for social login.
The skill is Python and FastAPI oriented and expects libraries such as argon2, pyjwt, pyotp and Redis to be available in the project. It ships no scripts; the agent applies the patterns to the code it is writing.
When your agent uses it
FastAPI auth patterns — session/JWT chains, argon2id hashing, pyotp TOTP/Email OTP, role-based access control, x-user-data gateway forwarding. Use when building auth dependencies, MFA, or role hierarchies.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 8 files (104 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the claude-kit plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add ajyadav013/claude-kit
/plugin install claude-kit@claude-kitOr copy only this skill to ~/.claude/skills/auth-and-rbac:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/auth-and-rbac &&
cp -R "$tmp/providers/codex/claude-kit/skills/auth-and-rbac" ~/.claude/skills/auth-and-rbac &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/auth-and-rbac inside it instead.
Copy the skill folder to ~/.agents/skills/auth-and-rbac to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/auth-and-rbac &&
cp -R "$tmp/providers/codex/claude-kit/skills/auth-and-rbac" ~/.agents/skills/auth-and-rbac &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/auth-and-rbac inside it instead.
Copy the skill folder to ~/.cursor/skills/auth-and-rbac to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/auth-and-rbac &&
cp -R "$tmp/providers/codex/claude-kit/skills/auth-and-rbac" ~/.cursor/skills/auth-and-rbac &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/auth-and-rbac inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/ajyadav013/claude-kit.git --path providers/codex/claude-kit/skills/auth-and-rbacOr copy the folder to ~/.gemini/skills/auth-and-rbac yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/auth-and-rbac:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/auth-and-rbac &&
cp -R "$tmp/providers/codex/claude-kit/skills/auth-and-rbac" ~/.copilot/skills/auth-and-rbac &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/auth-and-rbac inside it instead.
Get the folder:
git clone --depth 1 https://github.com/ajyadav013/claude-kit.gitThen copy claude-kit/providers/codex/claude-kit/skills/auth-and-rbac into your agent's skills folder as auth-and-rbac. Agents that support SKILL.md read one folder per skill.
What it does
- Session and JWT chains
- Dependency patterns for cookie sessions and bearer token authentication in FastAPI.
- Password hashing with argon2id
- Argon2id parameters and async wrappers so hashing does not block the event loop.
- RS256 token issuance
- Signed access tokens with key IDs, refresh token rotation and a JWKS endpoint.
- MFA with TOTP and email codes
- Setup and verification flows for authenticator apps, email one-time codes and backup codes.
- Role hierarchy and org checks
- Role dependencies and materialized-path checks for admins managing org subtrees.
- Gateway identity forwarding
- Parsing a forwarded x-user-data header and the trust boundary it requires.
Good for
- Add login with JWT access and refresh tokens to a FastAPI service
- Protect admin endpoints with role-based dependencies
- Add TOTP or email one-time code MFA to an existing login flow
- Hash and verify user passwords with argon2id in an async app
- Restrict tenant and org admins to their own organization subtree
Auth and rbac FAQ
What does Auth and rbac need to be used?
It is written for FastAPI projects and references argon2, pyjwt, pyotp, Redis and Fernet-encrypted storage in its examples.
Does Auth and rbac install any scripts or change files?
No. It has no scripts; it provides guidance and code patterns the agent can apply when building auth code.
When does Auth and rbac trigger?
It is meant for tasks involving building auth dependencies, multi-factor authentication or role hierarchies in FastAPI.
Which authorization model does Auth and rbac recommend?
It describes RBAC as the default for a small set of org-wide tiers, and suggests ABAC-style ownership checks or ACLs when rules depend on ownership or per-object sharing.
How do I install Auth and rbac in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/auth-and-rbac to use it in all your projects, or to .claude/skills/auth-and-rbac in one project. Or install the claude-kit plugin, which includes it: /plugin marketplace add ajyadav013/claude-kit, then /plugin install claude-kit@claude-kit.
Does Auth and rbac run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Auth and rbac?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Auth and rbac?
The closest alternatives to Auth and rbac are Auth security, Sh kb auth, API security auth pattern, Authentication and Backend repo architecture.
Where this comes from
- Description: from the skill's own SKILL.md.
More from ajyadav013/claude-kit

Guides an agent through pytest, async fixtures and security-regression tests for FastAPI
- Open source
- 13 GitHub stars
- Developer tools

Lets your agent inspect and debug live browser pages via Chrome DevTools MCP
- Open source
- 13 GitHub stars
- Browser automation

Runs concurrent load and stress tests against API endpoints to find latency and throughput
- Open source
- 13 GitHub stars
- Developer tools

Lets an agent click through a feature in a real browser and check how it behaves
- Open source
- 13 GitHub stars
- Developer tools

Runs quick health checks on backend, frontend and login to catch obvious breakage
- Open source
- 13 GitHub stars
- Developer tools

Guides an agent through red-green-refactor, bug reproduction tests and test pyramid
- Open source
- 13 GitHub stars
- Developer tools





