Agent Detection Overview

Superline Agent Detection provides real-time detection of AI agents in browser sessions using metadata and behavioral patterns. This page provides an overview of how the library works and its key components.

How It Works

1

Feature Extraction

The library extracts features from browser metadata and user behavior (mouse movements, keyboard patterns, scroll behavior, clicks)
2

Data Processing

Extracted features are processed through standardization, normalization, and one-hot encoding where appropriate
3

Model Scoring

A logistic regression model analyzes the processed features to calculate a detection probability
4

Classification

The probability value is compared to a threshold to classify the session as human or AI agent

Key Components

The core component that manages the detection process, including initialization, data collection, and result generation. This is your main point of interaction with the library.
// Example of creating and using the Agent Detector
AgentDetector.init({ debug: false, autoStart: true });
const result = await AgentDetector.finalizeDetection();
Components that collect and analyze different aspects of the browser session. The library includes extractors for browser metadata, mouse events, keyboard events, scroll events, and click events.Each extractor focuses on a specific aspect of user behavior and contributes specific features to the detection model.
A logistic regression model that processes the extracted features to calculate a confidence. The model is trained on a large dataset of labeled browser sessions from both humans and AI agents.The model parameters (weights and intercepts/bias) are included in the library, making it work “out of the box” without requiring server-side processing.
A pluggable system that adapts the library to different operational contexts. The default browser environment provides real-time event collection, while a replay environment is available for offline analysis.
A system for persisting events and metadata during the detection process. The default implementation uses IndexedDB in browser environments to ensure data is available across page loads.

Detection Result

When you call AgentDetector.finalizeDetection() or AgentDetector.getCurrentDetectionResult(), you receive a detection result with the following structure:
{
  isAgent: boolean,     // True if the session is classified as an AI agent
  confidence: number,   // Probability prediction between 0 and 1
  features?: any        // Preprocessed features used for scoring (optional)
}

Next Steps