shipfastlabs/agent-detector
Lightweight PHP 8.2+ utility to detect if your app is running inside an AI agent or automated dev environment. Supports Claude, Cursor, Gemini, Codex, Replit, Devin, and more via env vars or file checks, with a simple API and helper function.
Adopt if:
ANTIGRAVITY_* env vars).Avoid if:
ANTIGRAVITY_* vars).For Executives: *"This update adds support for Antigravity, a growing AI tool in developer workflows, to our existing agent detection package. By adopting this, we:
For Engineering: *"New in v1.1.2: Antigravity detection! Use this to:
if (AgentDetector::detect()->isAgent && AgentDetector::detect()->name === 'Antigravity') {
$this->error('Antigravity detected: Restricting sensitive operations.');
return;
}
CheckAgent middleware or command guards.How to test Antigravity detection:
ANTIGRAVITY_API_KEY).$agent = AgentDetector::detect();
dd($agent->isAgent, $agent->name); // Should return `true` and `'Antigravity'`.
Caveats:
APP_DEBUG or custom middleware for defense in depth.For Security/Compliance Teams: *"Antigravity support extends our agent detection to a new AI tool, helping mitigate risks like:
tinker, API keys) in Antigravity-driven workflows.APP_DEBUG, middleware) for layered protection. Avoid for high-risk systems until adoption grows."*How can I help you explore Laravel packages today?