Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

better-auth-security-best-practices: Claude Code skill

Hardens Better Auth deployments by configuring rate limits, CSRF rules, session caching, and OAuth token encryption.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add better-auth/skills --skill better-auth-security-best-practices -a claude-code
npx skills add better-auth/skills --skill security -a claude-code
Open on GitHub

What better-auth-security-best-practices does

This skill guides security configuration for Better Auth deployments. It sets up rate limiting with default windows of 10 seconds for 100 general requests and tighter limits of 3 requests for sensitive auth endpoints. It also activates CSRF checks, trusted origin lists, and secure cookie prefixes like __Secure-.

Secret keys resolve in strict order: first options.secret, then BETTER_AUTH_SECRET, and finally AUTH_SECRET. OAuth tokens gain AES-256-GCM encryption, while session cookies can use compact or encrypted jwe formats.

Using in-memory storage for rate limits causes counters to wipe on serverless restarts, which makes Redis or persistent database storage necessary for ephemeral environments.

What it helps with

  • limit brute force attempts on authentication endpoints
  • encrypt stored OAuth tokens using AES-256-GCM
  • define dynamic and wildcard trusted origins
  • record security audit logs on session events

Example prompts for the agent

  • Configure Better Auth rate limiting for sign-in routes with custom limits
  • Set up AES-256-GCM encryption for stored OAuth provider tokens
  • Add databaseHooks to log session creation and deletion events

How to install better-auth-security-best-practices

1Skills CLI (Vercel)

npx skills add better-auth/skills --skill better-auth-security-best-practices -a claude-code
npx skills add better-auth/skills --skill security -a claude-code

2Manually: put the files in place

~/.claude/skills/security/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/security/

From the same set5

The whole set →

Similar

binary-ninja-reverse zhaoxuya520 Guides binary analysis in Binary Ninja using HLIL, MLIL, and LLIL representations. Useful for tracing cross-references, inspecting exports, and reviewing binary patches. Claude Code CX Codex Cursor +1 587installs code-review agno-team Automated code inspection for style violations, bugs, and best-practice gaps. The skill runs linting, identifies issues, and delivers structured feedback with severity levels. Claude Code CX Codex Cursor +1 472installs pr-workflow tursodatabase Enforces rules for atomic commits, clean PRs, dependency licensing, and secret hygiene. Useful for agents pushing code or running inside CI workflows. Claude Code CX Codex Cursor +1 1,200installs secure-workflow-guide trailofbits Guides smart contracts through Trail of Bits' 5-step security audit on check-in or before deployment. It runs static analysis, generates visual charts, and prepares fuzzing tests. Claude Code CX Codex Cursor +1 7,400installs threat-model-analyst official github Runs STRIDE-A threat modeling for a repository or system. It can also update an earlier report against the current code or a chosen commit. GitHub Copilot 1,500installs agent-owasp-compliance official github Checks an AI agent codebase against the 10 OWASP ASI risks. Use it before production deployment, for security review, or when preparing an audit report. GitHub Copilot 1,500installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. Claude Code 499,069installs ponytail-review DietrichGebert ponytail-review reviews a change beyond the diff, checking connected code, bugs, risks, load, tests, speed, and unnecessary code. Use it for PRs and commits. Claude Code CX Codex Cursor +1 56,300installs

Questions about better-auth-security-best-practices

How to install better-auth-security-best-practices in Claude Code?

Run npx skills add better-auth/skills --skill better-auth-security-best-practices -a claude-code in your terminal.

What does better-auth-security-best-practices do?

It provides hardening patterns for Better Auth, covering CSRF checks, session cookie strategies, and IP grouping rules.

Which rate limiting storage works best for serverless?

The memory option resets on container restart. Serverless architectures require database or secondary-storage with Redis to persist attempt counters across requests.

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor