better-auth-security-best-practices

Harden Better Auth with rate limiting, CSRF protection, and secure cookies.

Updated Oct 12, 2025
One-click install
npx skills add https://github.com/zomeru/rezumerai --skill better-auth-security-best-practices-zomeru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-security-best-practices
Source: https://github.com/zomeru/rezumerai/tree/main/.agents/skills/better-auth-security-best-practices
Command: npx skills add https://github.com/zomeru/rezumerai --skill better-auth-security-best-practices-zomeru

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured, best-practice guide for hardening Better Auth across several security domains, helping teams reduce risk and misconfigurations.

Core Features & Use Cases

  • Comprehensive security coverage: secret management, rate limiting, CSRF protection, trusted origins, session security, cookie security, OAuth token handling, IP tracking, and auditing.
  • Real-world applicability: ideal for SaaS backends, admin panels, and services that rely on Better Auth to defend authentication and data access.
  • Quick-start-ready patterns: includes configuration examples and integration tips that can be adapted to existing projects.

Quick Start

Configure a secure Better Auth setup by enabling rate limiting, CSRF protection, secure cookies, and safe OAuth token handling.

Frequently Asked Questions about better-auth-security-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure Better Auth in my full-stack application?

Securing Better Auth involves hardening secrets, enabling rate limiting, validating trusted origins, and configuring CSRF protection. This skill provides ready-to-apply configuration patterns covering sessions, cookies, OAuth, and auditing for full-stack apps.

What is the best way to configure rate limiting and CSRF protection for Better Auth?

The best way to configure rate limiting and CSRF protection in Better Auth is by applying per-endpoint protections and origin validation. This skill offers example implementations for environment-driven security settings and extensible hooks.

How does Better Auth handle OAuth token encryption and session freshness?

Better Auth handles OAuth token encryption and session freshness through configurable security settings and environment-driven secrets. This skill guides implementing safe token handling and maintaining secure session states.

Can I use Better Auth security configurations for SaaS backends and admin panels?

Yes, Better Auth security configurations are ideal for SaaS backends and admin panels. This skill helps defend authentication and data access in services relying on Better Auth by applying comprehensive hardening across multiple security domains.

Why do I need trusted origins and IP tracking in my Better Auth setup?

Trusted origins and IP tracking are needed in Better Auth setups to validate request sources and monitor authentication events. This skill provides patterns for implementing origin validation, IP tracking, and comprehensive audit logging.

What are the limitations of default Better Auth cookie security settings?

Default Better Auth cookie security settings may lack strict environment-driven configurations needed for production. This skill addresses limitations by providing quick-start-ready patterns for secure cookies, secret management, and extensible hooks.