laravel/agent-detector
Lightweight PHP utility for detecting whether your Laravel/PHP app is running inside an AI agent or automated dev environment. Identifies known agents (e.g., Cursor, Gemini, Codex, Claude) via env vars, with a simple API and helper function.
user-agent parsing libraries like Mobile-Detect).ps checks).For Executives: *"This package lets us automatically detect AI agents (like GitHub Copilot or Claude) in our PHP/Laravel apps. We can use it to:
For Engineers: *"Agent Detector is a batteries-included way to check if code runs in an AI environment. Key perks:
composer require laravel/agent-detector.AgentDetector::detect() for broad checks or knownAgent() === KnownAgent::Claude for specific logic./admin/audit and gate sensitive endpoints (e.g., /data/export)."*How can I help you explore Laravel packages today?