Getting Started
Learn how to integrate AgentShield into your application
Introduction
AgentShield provides comprehensive protection against AI agents and automated bots accessing your web applications. Whether you're protecting valuable content, preventing scraping, or ensuring fair usage of your services, AgentShield offers the tools you need.
How It Works
AgentShield uses multiple detection methods to identify automated traffic:
- Behavioral Analysis - Monitors interaction patterns that differ from human users
- Browser Fingerprinting - Identifies characteristics unique to automated browsers
- Request Signatures - Analyzes HTTP headers and request patterns
- Machine Learning - Continuously improves detection based on traffic patterns
Choose Your Implementation
AgentShield offers multiple integration options to fit your specific needs:
For Developers
JavaScript Beacon
Best for: Single-page applications, static sites, and traditional web apps
- Lightweight client-side detection
- WebWorker support for non-blocking execution
- Real-time event tracking
- Works with any JavaScript framework
Server-side Middleware
Best for: Full-stack applications with server control
- Next.js - Edge-optimized middleware with App Router support
- Express - Drop-in middleware for Node.js applications
- Complete request analysis before response
- Session tracking and advanced analytics
For Marketers
Marketing Pixel
Best for: Marketing teams using Google Tag Manager
- No coding required
- GTM template for easy installation
- Automatic pageview tracking
- Custom event configuration through GTM interface
Core Concepts
Detection Confidence
AgentShield provides a confidence score (0-1) for each detection:
- 0.0-0.3: Likely human
- 0.3-0.7: Uncertain (may be automated tools or assistive technology)
- 0.7-1.0: Likely AI agent or bot
Response Actions
You can configure how to handle detected agents:
- Allow - Log detection but allow access
- Block - Return 403 Forbidden response
- Redirect - Send to a different page
- Challenge - Request additional verification
- Custom - Define your own response logic
Privacy & Compliance
AgentShield is designed with privacy in mind:
- GDPR compliant
- Respects Do Not Track headers
- Configurable data retention
- No PII collection by default
- IP anonymization options
Installation Overview
The installation process varies by integration type:
- Choose your package - Select the appropriate npm package
- Install dependencies - Add to your project
- Configure - Set up with your API key and preferences
- Deploy - Push to production
- Monitor - Track detections in your dashboard
System Requirements
Client-side (Beacon/Pixel)
- Modern browsers (Chrome 60+, Firefox 55+, Safari 11+, Edge 79+)
- JavaScript enabled
- Optional: WebWorker support for optimal performance
Server-side (Middleware)
- Node.js 16+
- Next.js 13+ (for Next.js integration)
- Express 4+ (for Express integration)
Quick Decision Guide
Not sure which integration to choose? Here's a quick guide:
If you have... | Use this... |
---|---|
Next.js app | @kya-os/agentshield-nextjs |
Express/Node.js app | @kya-os/agentshield-express |
Static site or SPA | @kya-os/agentshield-beacon |
WordPress/CMS | Marketing Pixel via GTM |
Multiple properties | Marketing Pixel + specific integrations |
Next Steps
Ready to get started? Follow our Quick Start Guide to have AgentShield running in under 5 minutes.
For a deeper understanding of how AgentShield works, check out our Core Concepts guide.