laravel-security

Audit Laravel authentication, input validation, and production configuration for security vulnerabilities.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill laravel-security-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/laravel-security
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill laravel-security-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications are frequently vulnerable to common web security threats including broken authentication, CSRF attacks, SQL injection, and insecure file uploads, which can lead to data breaches, compliance violations, and loss of user trust.

Core Features & Use Cases

  • Comprehensive Auth & Access Control: Guidance for implementing Laravel Sanctum/Passport API authentication, model policies, and gate-based authorization to restrict access to sensitive resources.
  • Input & Data Protection: Best practices for request validation, mass assignment guards, encrypted attributes, and XSS/SQL injection prevention to keep user data safe.
  • Production Hardening: Instructions for securing sessions, cookies, CORS configurations, rate limiting, and environment secrets to protect deployed Laravel applications from exploitation.
  • Use Case: A developer building a Laravel API for customer payment data can use this skill to implement proper token auth, validate all incoming request payloads, and configure secure production settings to avoid exposing sensitive financial information.

Quick Start

Use the laravel-security skill to audit your Laravel application's authentication, input validation, and production configuration for common security vulnerabilities.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I secure a Laravel API against broken authentication and data exposure?

To secure a Laravel API against broken authentication, implement Sanctum or Passport for token auth, use model policies for authorization, and encrypt sensitive attributes to prevent data exposure. This restricts access to protected resources.

What is the best way to prevent CSRF attacks and SQL injection in Laravel?

The best way to prevent CSRF attacks and SQL injection in Laravel is by applying built-in request validation, enabling CSRF tokens, and using mass assignment guards to ensure all incoming data is sanitized before processing.

How do I configure secure file upload handling in a Laravel application?

Secure file upload handling in Laravel requires validating all uploaded file inputs against strict rules and storing them outside the public directory to mitigate insecure data exposure and malicious payload execution.

How do I harden Laravel production deployment for session and CORS configuration?

Harden Laravel production deployment by securing session cookies, configuring strict CORS policies, applying rate limiting, and auditing environment secrets to protect deployed applications from exploitation.

Does this Laravel security guidance cover dependency auditing and regulatory compliance?

Yes, this Laravel security guidance covers dependency auditing and encrypted data storage practices required to protect sensitive user data and satisfy specific regulatory compliance standards for production apps.