nextjs-security

Harden Next.js 15 apps with CSRF protection, rate limiting, and RLS policies.

1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/Ai-Whisperers/Vete --skill nextjs-security-ai-whisperers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-security
Source: https://github.com/Ai-Whisperers/Vete/tree/main/.claude/plugins/vete-veterinary/skills/nextjs-security
Command: npx skills add https://github.com/Ai-Whisperers/Vete --skill nextjs-security-ai-whisperers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Security patterns for Next.js 15 applications in multi-tenant veterinary platforms are complex and error-prone, risking data exposure, tenant isolation breaches, and regulatory concerns if not implemented consistently.

Core Features & Use Cases

  • Server Action hardening: enforce authentication, validation, and authorization within app router actions.
  • CSRF protection: implement token-based protections for state-changing requests.
  • Rate limiting: apply per-user/IP controls to prevent abuse across APIs and actions.
  • RLS policy generation: provide templates to enforce tenant-scoped data access.
  • Auth middleware patterns: standardize session handling and RBAC across routes and APIs.
  • Use Case: a clinic deploys a new feature and uses the templates to ensure only authorized staff can modify patient records without cross-tenant access.

Quick Start

Implement the recommended security patterns in your Next.js 15 app by applying the provided templates and integration guidelines.

Frequently Asked Questions about nextjs-security

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

FAQPage Schema
How do I secure server actions in Next.js 15 to prevent unauthorized data access?

Securing Next.js 15 server actions requires enforcing authentication, validation, and authorization checks directly within app router actions to prevent unauthorized data modification and exposure.

What is the best way to enforce tenant isolation in a multi-tenant Supabase application?

Tenant isolation in a multi-tenant Supabase application is enforced by generating Row Level Security (RLS) policies that restrict data access to a user's specific tenant scope.

How do I implement CSRF protection for state-changing requests in a Next.js app?

CSRF protection in a Next.js app is implemented by integrating token-based workflows that validate state-changing requests, ensuring actions are deliberately triggered by authenticated users.

Does this security approach work with Upstash for API rate limiting?

Yes, the security approach integrates with Upstash to apply per-user and per-IP rate limiting controls, preventing API abuse across server actions and routes in Next.js 15.

How do I standardize authentication middleware and RBAC across Next.js API routes?

Standardizing authentication middleware involves implementing Supabase client patterns to manage sessions and enforce role-based access control (RBAC) uniformly across Next.js routes and APIs.