Skip to main content

A library to detect if Python code is run inside an agent

Project description

AI Agent Detector

This is a Python port of pushpak1300's PHP library agent-detector.

A small library to tell you if Python is run in the context of an AI agent.

Installation

pip install ai-agent-detector

Usage

from ai_agent_detector import detect_agent
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ai_agent_detector import Result

result: Result = detect_agent()

result.is_agent # True
result.name # "codex"
result.is_known_agent # True

Local installation

uv sync

Testing

uv run mypy src
uv run pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_agent_detector-0.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_agent_detector-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_agent_detector-0.1.0.tar.gz.

File metadata

  • Download URL: ai_agent_detector-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for ai_agent_detector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5f4e18a927686e04c5001a5ee445ab0df8c89deecbf176873433182cf7a930c3
MD5 dce4cef1a98b29af81ad889ee8f3942e
BLAKE2b-256 e424769b1c3542713e6216737c269eaebd0d893983bf77cc0de8e2aa9d205bfc

See more details on using hashes here.

File details

Details for the file ai_agent_detector-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_agent_detector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 142747a5a21828c400342130172126bb73bece08374f068f1d8e2252014a7541
MD5 319ccc5352326cc4634f2f0ac54117dd
BLAKE2b-256 5ff698c50b4fe13081443f2c5693e02c0d0cd45bcc4d11d26b5d9d039849d044

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page