
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
@superline-ai/agent-detection
Advanced tools
Agent detection library for detecting AI agents using browser automation
A lightweight, high-performance library for detecting AI agents in real-time from browser sessions based on browser environment metadata and behavioral patterns.
NPM Package: https://www.npmjs.com/package/@superline-ai/agent-detection
Note: This is an early version of the library and is not yet recommended for production use.
Superline Agent Detection analyzes a session on a website in real-time to distinguish between human users and AI agents. The library extracts features from browser metadata and behavioral data (mouse movements, keyboard patterns, scroll behavior, clicks) and processes them through a logistic regression model to calculate detection probability.
Built on data from hundreds of thousands of labeled browser sessions, the detection system is continuously improved with new findings and for better reliability. The library is designed to have minimal performance impact while providing reliable detection results.
Detection results can be used to differentiate between humans and agents in your analytics and A/B testing setups, ensuring your metrics reflect actual human behavior and your experiments target the right audience.
For comprehensive documentation, API references, and integration guides, visit our official documentation:
npm install @superline-ai/agent-detection
# or
yarn add @superline-ai/agent-detection
# or
pnpm add @superline-ai/agent-detection
Add directly to your HTML head:
<!-- Add the script with defer attribute -->
<script src="https://cdn.jsdelivr.net/npm/@superline-ai/agent-detection/dist/umd/index.umd.js" defer></script>
<!-- Initialize it with defer as well -->
<script defer>
document.addEventListener('DOMContentLoaded', function() {
// The library exposes a global agentDetector object
window.agentDetector.init({
debug: false,
autoStart: true
});
// Later, check if the session is from an agent
window.agentDetector.finalizeDetection()
.then(result => {
console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);
});
});
</script>
Getting started with Superline Agent Detection is simple:
import AgentDetector from '@superline-ai/agent-detection';
// Initialize the detector (pre-instantiated)
AgentDetector.init({
debug: false,
autoStart: true
});
// Later, when you want to check if the session is from an agent
const result = await AgentDetector.finalizeDetection();
console.log('Is agent:', result.isAgent, 'Confidence:', result.confidence);
// Integration with analytics
// Send the agent detection result to your analytics platform
if (result.isAgent) {
// Example with Google Analytics 4
gtag('set', 'user_properties', {
is_agent: true,
agent_confidence: result.confidence
});
// Example with Mixpanel
mixpanel.people.set({
'Is Agent': true,
'Agent Confidence': result.confidence
});
}
That's it! The library will begin collecting behavioral patterns and provide detection results.
Currently, the library is "open weights" - providing the trained model weights for detection. We're actively working on several improvements to make the agent detection more powerful and versatile:
Join our Discord community to connect with other developers, ask questions, and share your experiences:
This project is licensed under the MIT License - see the LICENSE file for details.
For a detailed changelog and release history, please refer to our GitHub Releases page.
FAQs
Agent detection library for detecting AI agents using browser automation
The npm package @superline-ai/agent-detection receives a total of 13 weekly downloads. As such, @superline-ai/agent-detection popularity was classified as not popular.
We found that @superline-ai/agent-detection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.