authentication-security

authentication-security is a skill for Claude Code, Codex from williamzujkowski/standards. It costs 50 tokens per session (6,017 once invoked), scanned A, original, MIT.

An authentication guide covering how applications verify identity, including OAuth2, signed tokens, multi-factor authentication, and secure sessions.

In plain words
What is it for?
Use it when building login systems for web, mobile, or distributed applications, including token expiry, password storage, MFA, and session protection.
Why use it?
It helps prevent account takeover caused by weak passwords, unsafe tokens, insecure cookies, or poorly designed login flows.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building login systems for web, mobile, or distributed applications, including token expiry, password storage, MFA, and session protection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/williamzujkowski/standards/authentication
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add williamzujkowski/standards --skill authentication
Clone the repo
git clone --depth 1 https://github.com/williamzujkowski/standards

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for authentication-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/williamzujkowski/standards/authentication/github.svg)](https://agentmods.dev/skills/williamzujkowski/standards/authentication)
Your own site
<a href="https://agentmods.dev/skills/williamzujkowski/standards/authentication"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/authentication/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for authentication-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/williamzujkowski/standards/authentication"><img src="https://agentmods.dev/badge/skills/williamzujkowski/standards/authentication.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,017 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.06017
Opus 5.5 $0.00020 $0.02407
Sonnet 5.5 $0.00010 $0.01203
Haiku 4.5 $0.00005 $0.00602

Measured 2d ago against content hash 98c61655d4fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-02, from the pricing page.

Security

Grade A, and why

authentication-security scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/generate-jwt-keys.sh, templates/jwt-validator.js, templates/jwt-validator.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await axios.post(`${this.authServerUrl}/token`, {
skills/security/authentication/SKILL.md · 859 lines

How it starts

The opening of the file, as written. The whole thing — 859 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authentication Security

Quick Navigation: Level 1: Quick Start (5 min) → Level 2: Implementation (30 min) → Level 3: Mastery (Extended)


Level 1: Quick Start (<2,000 tokens, 5 minutes)

Core Principles

  1. Multi-Factor Always: Require MFA for sensitive operations (TOTP, WebAuthn, hardware keys)
  2. Secure Tokens: Use RS256 for JWT, never HS256 with shared secrets in distributed systems
  3. Short-Lived Tokens: Access tokens <15 min, refresh tokens with rotation
  4. OAuth2 with PKCE: Always use PKCE for SPAs and mobile apps
  5. Session Security: httpOnly, secure, sameSite cookies with CSRF protection

Essential Checklist

  • OAuth2 flow: Authorization code with PKCE for public clients
  • JWT signing: RS256 asymmetric keys, never embed secrets in tokens
  • Token expiration: Access <15 min, refresh <7 days with rotation
  • MFA enabled: TOTP (Google Authenticator) or WebAuthn (hardware keys)
  • Session cookies: httpOnly=true, secure=true, sameSite=strict
  • CSRF protection: State parameter for OAuth2, CSRF tokens for sessions
  • Password storage: bcrypt (cost≥12) or argon2id, never plaintext/MD5/SHA1
  • Account lockout: 5 failed attempts → temporary lockout (AC-7)
  • TLS required: All auth endpoints require HTTPS (SC-8)
  • Audit logging: Log all auth events with timestamps (AU-2)

Quick Example

// @nist ia-2 "Identification and authentication"
// @nist ia-5 "Authenticator management"
const jwt = require('jsonwebtoken');
const fs = require('fs');

// ❌ NEVER do this (shared secret, symmetric)
// const token = jwt.sign({ userId: 123 }, 'hardcoded_secret', { algorithm: 'HS256' });

// ✅ Use RS256 with private/public keypair
const privateKey = fs.readFileSync('./keys/private.pem');
const publicKey = fs.readFileSync('./keys/public.pem');

function generateAccessToken(userId) {
  return jwt.sign(
    {
      sub: userId,
      iss: 'auth.example.com',
      aud: 'api.example.com'
    },
    privateKey,
    {
      algorithm: 'RS256',
      expiresIn: '15m'  // Short-lived
    }
  );
}

function verifyToken(token) {
  try {
    return jwt.verify(token, publicKey, {
      algorithms: ['RS256'],
      issuer: 'auth.example.com',
      audience: 'api.example.com'
    });
  } catch (err) {
    throw new Error('Invalid token');
  }
}

Read the full file on GitHub · 859 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 859 lines · 50 tokens per session scan A 98c61655d4fe

Subscribe to this mod's changes

authentication-security is a skill published in the GitHub repository williamzujkowski/standards (18 stars, last pushed 1mo ago), licensed MIT. It adds 50 tokens to every session and 6,017 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-29.

Related

Other skills, from other repositories