Skip to content
Back to skills

Jwt

ASecurity

JSON Web Tokens — when to use JWTs vs opaque tokens, signing algorithms (asymmetric preferred), key rotation with kid/JWKS, mandatory claim validation, algorithm confusion and `none` attacks, expiry and revocation strategies, size and privacy. Use when issuing or validating JWTs (JWT, JWS, JWKS, token validation, key rotation).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsrustgosecurity

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill jwt --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jwt?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jwt
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-jwt/badge)](https://www.skillsdirectory.com/skills/vectora-os-jwt)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jwt
description: JSON Web Tokens — when to use JWTs vs opaque tokens, signing algorithms (asymmetric preferred), key rotation with kid/JWKS, mandatory claim validation, algorithm confusion and `none` attacks, expiry and revocation strategies, size and privacy. Use when issuing or validating JWTs (JWT, JWS, JWKS, token validation, key rotation).
metadata:
  category: security
---

# JWT

## Purpose

Issue and validate JWTs without the classic vulnerabilities.

**Use when:** token-based auth with JWTs.

**Not for:** session design for first-party web apps (consider cookies).

## Inputs

- Token use case, key management.

## Outputs

- Token format, validation code and tests, rotation procedure.

## Read first

- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "jwt"` for prior decisions, patterns and anti-patterns.
- [Security standard](../../../standards/security.md)

## Steps

1. **Choose.** Prefer opaque tokens when revocation matters; JWT when stateless validation is needed.
   Done when choice justified.
2. **Sign.** Asymmetric (ES256/EdDSA/RS256); fixed allow-list of algorithms.
   Done when `none` and HS/RS confusion impossible.
3. **Validate.** iss, aud, exp, nbf, signature with kid lookup.
   Done when negative tests for each claim.
4. **Rotate.** JWKS with overlap window.
   Done when rotation rehearsed.

## Best practices

- Keep payload minimal; no personal data.
- Short expiry plus refresh.

## Common mistakes

- Trusting the `alg` header.
- Using JWT as a session store for everything.

## Example

ES256 tokens, `kid` per key, JWKS cached 10 min, validation rejects wrong audience — tests for 7 negative cases.

## Reusable prompt

```text
Apply the JWT skill (.agents/skills/jwt/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Define the token format, signing and validation rules with negative tests and the key rotation procedure.
Return: Token format, validation code and tests, rotation procedure..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.