Download the PHP package shipfastlabs/agent-detector without Composer
On this page you can find all versions of the php package shipfastlabs/agent-detector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shipfastlabs/agent-detector
More information about shipfastlabs/agent-detector
Files in shipfastlabs/agent-detector
Package agent-detector
Short Description Detect if code is running in an AI agent or automated development environment
License MIT
Homepage https://github.com/laravel/agent-detector
Informations about the package agent-detector
Laravel Agent Detector
Introduction
Agent Detector is a lightweight PHP utility to detect if your code is running inside an AI agent or automated development environment.
Requires PHP 8.2+
Installation
To get started, install Agent Detector via the Composer package manager:
Usage
Or use the standalone function:
Supported Agents
| Agent | Detection Method |
|---|---|
| Custom | AI_AGENT env var |
| Cursor | CURSOR_AGENT env var |
| Gemini | GEMINI_CLI env var |
| Codex | CODEX_SANDBOX, CODEX_CI, CODEX_THREAD_ID, or CODEX_SANDBOX_NETWORK_DISABLED env var |
| Augment CLI | AUGMENT_AGENT env var |
| AMP | AMP_CURRENT_THREAD_ID env var |
| Opencode | OPENCODE_CLIENT or OPENCODE env var |
| Claude | CLAUDECODE or CLAUDE_CODE env var |
| Cowork | CLAUDE_CODE_IS_COWORK with CLAUDECODE or CLAUDE_CODE env var |
| Copilot | AI_AGENT=github-copilot, AI_AGENT=github-copilot-cli, COPILOT_MODEL, COPILOT_ALLOW_ALL, COPILOT_GITHUB_TOKEN, COPILOT_CLI, or COPILOT_AGENT_SESSION_ID with GITHUB_ACTIONS env var |
| Replit | REPL_ID env var |
| Devin | /opt/.devin file exists |
| Antigravity | ANTIGRAVITY_AGENT or ANTIGRAVITY_CLI_ALIAS env var |
| Pi | PI_CODING_AGENT env var |
| Junie | JUNIE_DATA, JUNIE_SHIM_PATH, or MATTERHORN_SESSION_ID env var |
| Kiro CLI | KIRO_AGENT_PATH env var |
| v0 | AI_AGENT=v0 env var |
| Kimi | KIMI_PLUGIN_ROOT env var |
| Grok | GROK_PLUGIN_ROOT or GROK_PLUGIN_DATA env var |
| Cline | CLINE_ACTIVE env var |
| Goose | GOOSE_TERMINAL env var |
| OpenClaw | OPENCLAW_SHELL env var |
| ZCode | ZCODE_ENV env var |
| Qwen Code | QWEN_CODE env var |
| Crush | CRUSH or AI_AGENT=crush env var |
| Windsurf | WINDSURF_CASCADE_TERMINAL env var |
| Zed Agent | TERM_PROGRAM=zed with an empty PAGER and GIT_PAGER=cat env vars |
| Kiro IDE | TERM_PROGRAM=kiro env var in a non-interactive CLI process |
| Jules | HOME=/home/jules with USER=swebot env vars |
Custom Agent
Set the AI_AGENT environment variable to any value to identify your custom agent:
Testing
Contributing
Thank you for considering contributing to Agent Detector! You can read the contribution guide here.
Code of Conduct
In order to ensure that the Agent Detector community is welcoming to all, please review and abide by the Code of Conduct.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
Agent Detector is open-sourced software licensed under the MIT license.