Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.
SkillScore86Maintained
Automatic
◆Security & AppSec pack
Last verified 8/15/2026
What it changes
Passed 19 of 22 test cases with the skill, and 18 of 22 without it.
Without skill82%
With skill86%
Checks it passed that the model alone missed
The response configures the stateful array in config/sanctum.php using SANCTUM_STATEFUL_DOMAINS.
1 fixed18 passed either way3 still failing0 broke
Pass-rate lift
+5 pp
Tokens
+65%
Agent turns
0%
Response time
-27%
Model gemini-3.6-flashMeasured 8/15/2026v119 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
We are integrating a single-page application running on localhost with a Laravel Sanctum API. Developers want to pass Bearer tokens on every SPA request. Show how to configure Sanctum stateful domain authentication.
What was checked, without and with the skill
Checked
Without skill
With skill
The response configures the stateful array in config/sanctum.php using SANCTUM_STATEFUL_DOMAINS.
Missed
Passed
The response includes sanctum/csrf-cookie in CORS allowed paths.
Passed
Passed
case-14 · gemini-3.6-flash · 8/15/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md279 linessingle file
Laravel Security Best Practices
Comprehensive security guidance for Laravel applications to protect against common vulnerabilities.
When to Activate
Adding authentication or authorization
Handling user input and file uploads
Building new API endpoints
Managing secrets and environment settings
Hardening production deployments
How It Works
Middleware provides baseline protections (CSRF via VerifyCsrfToken, security headers via SecurityHeaders).
Guards and policies enforce access control (auth:sanctum, $this->authorize, policy middleware).
Form Requests validate and shape input (UploadInvoiceRequest) before it reaches services.