# Auth security

> Auth security is an open-source agent skill for security. Guides an agent through OAuth 2.1, PKCE and JWT security practices for auth code. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/majiayu000/spellbook/tree/main/skills/auth-security
- **Repository:** https://github.com/majiayu000/spellbook
- **GitHub stars:** 303
- **License:** MIT
- **Skill name:** auth-security
- **Collection:** https://github.com/majiayu000/spellbook
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-04

## About

This skill gives the agent a reference-style playbook for building authentication and API authorization on the OAuth 2.1 and RFC 9700 model. It covers the Authorization Code flow with PKCE, the flows to drop (implicit and password grants), and which JWT signing algorithms to prefer, with ES256 shown as the default example.

The guidance walks through token handling in practice: verifying access tokens with an explicit algorithm allow-list, issuer, audience and clock tolerance checks, storing tokens in HttpOnly cookies for web apps or in memory for single page apps, and rotating single-use refresh tokens with reuse detection. It also outlines defenses against algorithm confusion, CSRF, XSS and token theft, including a DPoP proof-of-possession example and a revocation approach.

The code samples are TypeScript and rely on the jose library and an Express-style response object. The skill ships reference notes on OAuth, JWT and attacks, plus a TypeScript auth service template, and ends with a security checklist for reviewing an implementation.

## When your agent uses it

> OAuth 2.1 + JWT authentication security best practices. Use when implementing auth, API authorization, token management. Follows RFC 9700 (2025).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs TypeScript scripts](https://github.com/majiayu000/spellbook/tree/HEAD/skills/auth-security)
- [No network calls found in its scripts](https://github.com/majiayu000/spellbook/tree/HEAD/skills/auth-security)
- [License: MIT](https://github.com/majiayu000/spellbook/tree/HEAD/skills/auth-security)

## Features

- **PKCE authorization code flow:** Shows how to generate a code verifier and S256 challenge and exchange the authorization code.
- **JWT signing and verification:** Covers algorithm choice, required claims and strict verification with an explicit allow-list.
- **Browser token storage rules:** Explains when to use HttpOnly cookies versus in-memory storage and why localStorage is avoided.
- **Refresh token rotation:** Describes single-use refresh tokens, reuse detection and revoking a user's sessions.
- **Attack prevention patterns:** Covers algorithm confusion, CSRF, XSS mitigations and DPoP token binding.
- **Security review checklist:** Provides a markdown checklist for auditing OAuth, JWT, token and cookie configuration.

## Good for

- Add OAuth 2.1 login with PKCE to a web app
- Review JWT verification code for algorithm confusion risks
- Set up refresh token rotation with reuse detection
- Choose where a single page app should store access tokens
- Audit an existing auth implementation against a security checklist

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/auth-security` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/auth-security &&
cp -R "$tmp/skills/auth-security" ~/.claude/skills/auth-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/auth-security` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/auth-security` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/auth-security &&
cp -R "$tmp/skills/auth-security" ~/.agents/skills/auth-security &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/auth-security` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/auth-security` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/auth-security &&
cp -R "$tmp/skills/auth-security" ~/.cursor/skills/auth-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/auth-security` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/majiayu000/spellbook.git --path skills/auth-security
```

Or copy the folder to `~/.gemini/skills/auth-security` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/auth-security`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/majiayu000/spellbook.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/auth-security &&
cp -R "$tmp/skills/auth-security" ~/.copilot/skills/auth-security &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/auth-security` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/majiayu000/spellbook.git
```

Then copy `spellbook/skills/auth-security` into your agent's skills folder as `auth-security`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Auth security need to run?

Its code samples are TypeScript and use the jose library for JWT signing and verification. The skill itself is instructions and reference material.

### Does Auth security change files or run commands?

It provides guidance and code patterns for the agent to follow. The listed files are reference notes, a checklist and a TypeScript auth service template.

### Which token lifetimes does Auth security recommend?

It recommends access tokens that expire in 5 to 15 minutes and refresh tokens that are single-use and rotated on each use.

### How do I install Auth security in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/auth-security to use it in all your projects, or to .claude/skills/auth-security in one project.

### Does Auth security run scripts?

Yes. It runs TypeScript scripts. No network calls were found in its 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 security?

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 security?

The closest alternatives to Auth security are Sh kb auth, API security auth pattern, JWT, Authentication and Auth and rbac.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Sh kb auth](https://ai-powered.com/skills/sh-kb-auth): Sh kb auth is an open-source agent skill for security.
- [API security auth pattern](https://ai-powered.com/skills/api-security-auth-pattern): API security auth pattern is an open-source agent skill for security.
- [JWT](https://ai-powered.com/skills/jwt-scaledockhq): JWT is an open-source agent skill for security.
- [Authentication](https://ai-powered.com/skills/authentication): Authentication is an open-source agent skill for security.
- [Auth and rbac](https://ai-powered.com/skills/auth-and-rbac): Auth and rbac is an open-source agent skill for security.
- [Security](https://ai-powered.com/skills/security-sorah): Security is an open-source agent skill for security.
- [Swift security expert](https://ai-powered.com/skills/swift-security-expert): Swift security expert is an open-source agent skill for security.
- [Axiom security](https://ai-powered.com/skills/axiom-security-charleswiltgen-2): Axiom security is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/auth-security
