More screenshots
Works with the AI Agents you already use
Repair JWT Verification & Key Rotation
Repair JWT verification and key-rotation bugs involving algorithm confusion, kid lookup, JWKS caching, issuer/audience validation, stale keys, refresh races, and fail-open error paths.
$1
Repair JWT Verification & Key Rotation
Example session with this skill installed
Our API caches JWKS for an hour. When a new kid appears, many requests refresh at once; if refresh fails, one path retries verification with any cached RSA key. Repair locally with a fake JWKS provider and preserve issuer/audience and clock-skew policy.
- Read your context and instructions
- Compiled the repair jwt verification
Unknown-key handling can degrade into key guessing and refreshes are uncoordinated. The repair keeps explicit algorithm/kid binding, coalesces refresh by keyset generation, never verifies with an unrelated key, and tests rotation, stale cache, refresh failure, concurrent unknown-kid requests, and existing claim checks.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
JWT verification logic often suffers from race conditions during key rotation, inconsistent trust boundaries, or JWKS caching bugs that cause intermittent authorization failures. Developers struggle to fix these issues without accidentally weakening security policies or leaking sensitive data in logs.
What it does
- Identifies inconsistencies in token parsing, key selection, and JWKS refresh logic across the codebase.
- Patches concurrent refresh bugs and ensures state ownership for keys and caches is deterministic.
- Strictly enforces existing issuer, audience, and clock-skew policies while repairing the underlying implementation.
- Generates deterministic local fixtures and loopback endpoints for testing key rollover scenarios.
- Implements redacted observability to track verification failures without logging secrets or customer data.
Why this beats prompting it yourself
General prompts often suggest insecure workarounds like widening clock skew or adding arbitrary sleeps to handle async key loading. This skill applies a formal transaction-based approach to state transitions, ensuring that retries and cleanups are bound to the specific generation that triggered them without compromising the security posture.
Use cases
- Fixing race conditions where a JWKS refresh fails to update the local cache before a new token arrives.
- Standardizing JWT validation across multiple microservices using different libraries.
- Implementing robust error handling for expired or rotated signing keys without exposing internal stack traces.
- Creating regression tests for edge cases like "kid" header mismatches or malformed JWKS responses.
Known limitations
Does not contact production services or read live secrets. Scope is limited to repository-level repairs and local testing fixtures.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.
Cannot redesign authorization claims policy, accepted algorithms, issuer/audience policy, clock-skew policy, key source, refresh policy, and public errors; cannot verify production infrastructure or prove every runtime, proxy, network, filesystem, or scheduler ordering.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
Run on a clean branch with repository files and disposable local fixtures. Review patches and validation before merge. Keep production services, real credentials, customer payloads, and deployment out of scope.