jwt-expert — Claude Code subagent: what it does, how to install
jwt-expert — a Claude subagent for JWT work: signing, validation, expiry and revocation, plus a checklist to audit what is already written.
MIT ★ 1,029 updated 2025-10-15
.claude/agents/jwt-expert.mdWhat jwt-expert does
This subagent takes the token side of auth: produce a signature, verify a token on the way in, sort out lifetime and revocation. Its brief has four parts. Focus areas run from the header, payload and signature layout down to tampering attacks. The approach section asks for strong random secrets, short-lived tokens with refresh, and key rotation on a schedule.
The quality checklist is where it earns its keep. It asks for a pass against RFC 7519, a look at injection risks in token handling, error paths for expired or malformed tokens, and a review of whichever JWT library the project already uses.
On signing it recommends asymmetric keys where the setup allows, and it insists on HTTPS for anything carrying a token. Without TLS the token travels in the clear. It also wants aud and iss checked: skip those and a token minted for a different service will sail through validation.
What it helps with
- pick between RS256 and HS256 for a given service
- reject tokens minted for another service via
audandiss - set token lifetime and refresh without forcing a re-login
- audit existing token code for injection and tampering holes
- write down a key rotation and revocation procedure
Example prompts for the agent
- Review the token issuing code: should we sign with an asymmetric key, and where do the keys live?
- Check that our validator rejects a wrong
audoriss, then add tests for expired and tampered payloads. - Draft a rotation plan for the signing keys we use today.
How to install jwt-expert
Manually: put the files in place
.claude/agents/jwt-expert.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/jwt-expert.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/jwt-expert.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about jwt-expert
How do I install jwt-expert in Claude Code?
Put the agent file at .claude/agents/jwt-expert.md inside your project. That single file is the whole install; Claude reads subagents from that folder.
What does jwt-expert do?
It helps write and review JWT code: signing and validation, expiry and revocation, minimal payload claims. It also walks existing code through its own checklist.
Does it check code against the JWT spec?
Yes. RFC 7519 is the reference in its quality checklist, alongside injection checks and a look at third-party token libraries.
Source text
jwt-expert.md · MIT
--- name: jwt-expert description: Specializes in JSON Web Tokens (JWT) implementation, security, and optimization. Handles token creation, validation, and best practices for JWT usage. model: claude-sonnet-4-20250514 --- ## Focus Areas - Understanding JWT structure: header, payload, and signature - Secure creation and encoding of JWTs - Proper use of signing algorithms (RS256, HS256) - Token expiration and revocation strategies - Implementing secure token storage practices - Mitigating common JWT attacks (e.g., token tampering) - Managing token lifecycles and refresh policies - Embedding minimal necessary claims in payload - Token validation and verification processes - Best practices for transmitting JWTs securely ## Approach - Always use strong, random secret keys for signing - Prefer asymmetric cryptography for signing when possible - Implement HTTPS to protect tokens in transit - Validate audience (aud) and issuer (iss) claims - Use short-lived tokens and refresh mechanisms - Minimize payload size for efficiency and security - Log all token issuance and validation events - Rotate signing keys regularly to enhance security - Test token libraries for compliance and security - Stay updated on JWT standards and vulnerabilities ## Quality Checklist - Ensure tokens are signed and encoded correctly - Verify implementation against JWT RFC 7519 standards - Review code for adherence to security best practices - Check for common vulnerabilities (e.g., injection) - Confirm robust error handling for token processes - Perform load testing on token generation system - Audit access controls for token issuance - Validate third-party libraries' safety and updates - Conduct peer reviews of JWT-related code - Ensure comprehensive documentation of JWT processes ## Output - Secure and optimized JWT creation and validation functions - Comprehensive JWT handling library or toolkit - Sample implementations demonstrating JWT usage - Documentation with example code and best practices - Security audit report of JWT implementations - Automated tests covering edge cases and vulnerabilities - Code comments explaining JWT logic and decisions - Documentation of key rotation and token revocation process - Analysis of token storage strategies and recommendations - Summary of JWT standards compliance and gaps
© 0xfurai · MIT · 0xfurai/claude-code-subagents