Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Agent Detector Laravel Package

ergebnis/agent-detector

Detect the presence of coding agents in your PHP app by checking environment variables. Supports Amp, Antigravity, Augment, Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, and more via a simple Detector::isAgentPresent() API.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Fraud & Abuse Mitigation: Integrate into Laravel middleware to block or throttle non-human traffic (e.g., credential stuffing, API abuse) without custom regex or complex logic. Supports 10+ agents, including GitHub Copilot and Replit, reducing false positives in CI/CD pipelines.
  • Cost Optimization: Reduce cloud spend by dynamically rate-limiting or blocking bot traffic (e.g., scrapers, fake accounts) with minimal dev effort. New PHP 8.6 support ensures compatibility with modern Laravel stacks.
  • Feature Gating & Personalization: Hide sensitive endpoints or content from bots (e.g., premium features, admin panels) using environment-based checks. Generic AI_AGENT variable enables future-proofing for unknown agents.
  • Compliance & Data Privacy: Differentiate human/bot traffic for GDPR/CCPA compliance without manual audits. MIT license avoids vendor lock-in for regulated industries.
  • Roadmap Efficiency: Avoid reinventing bot detection—this package replaces ad-hoc user-agent parsing with a maintained, extensible solution. Active contributions (e.g., new maintainers) signal long-term viability.
  • Developer Experience: Single-line integration ($detector->isAgentPresent(getenv())) reduces onboarding time for security/feature flags. No framework dependencies mean it works in any PHP app, including Laravel.
  • CI/CD & DevTool Awareness: Detect coding agents (e.g., GitHub Copilot, Cursor) to optimize pipelines, log telemetry, or adapt behavior in CI environments.

When to Consider This Package

  • Adopt if:

    • Your Laravel app has public APIs, forms, or high-traffic endpoints vulnerable to bot abuse (e.g., fake accounts, scrapers).
    • You need lightweight, real-time detection (e.g., middleware, request guards) without heavy ML models or third-party services.
    • Your team lacks dedicated security engineers to maintain custom bot-detection rules.
    • You’re using Laravel/PHP 8.2+ and want to avoid vendor-specific solutions (e.g., Cloudflare WAF).
    • You need to detect coding agents (e.g., GitHub Copilot, Replit) for CI/CD optimizations or logging.
    • You want a future-proof solution with support for unknown agents via AI_AGENT environment variable.
  • Look elsewhere if:

    • You require behavioral analysis (e.g., mouse movements, session depth) beyond environment variables.
    • Your budget allows enterprise tools (e.g., Akamai Bot Manager) with SLAs, 24/7 support, or global IP reputation checks.
    • Your traffic is low-volume or internal-only (e.g., admin dashboards).
    • You’re not using PHP/Laravel and prefer language-native solutions (e.g., Python’s fake-useragent).
    • You need custom agent support or breaking changes—this package is stable and incremental.

How to Pitch It (Stakeholders)

For Executives: "This MIT-licensed PHP package lets us automatically detect and block bots—including AI coding tools like GitHub Copilot—with a single line of code. It’s lightweight, maintained, and works seamlessly in Laravel, reducing fraud risk and cloud costs without heavy engineering. No vendor lock-in, just plug-and-play security that scales with our growth."

For Engineering: *"We can replace custom bot-detection logic with this battle-tested detector, which:

  • Blocks bots in middleware (e.g., if ($detector->isAgentPresent()) { abort(403); }).
  • Enables feature gating for non-human traffic (e.g., hide APIs from scrapers).
  • Detects coding agents (e.g., Copilot, Replit) for CI/CD optimizations.
  • Supports PHP 8.6 and integrates in <5 minutes—no framework bloat. Let’s use this to reduce abuse, cut costs, and future-proof our stack without reinventing the wheel."*

For Security/Compliance Teams: "This package simplifies GDPR/CCPA compliance by reliably distinguishing human vs. bot traffic via environment variables. The MIT license and active maintenance ensure no vendor risks, and it integrates cleanly with Laravel’s middleware for automated policy enforcement."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor