Skip to main content

Delphi xAIDR Python SDK — Extended AI Detection & Response for agent fleets

Project description

xaidr

xAIDR — Extended AI Detection & Response for agent fleets, by Delphi Security.

xaidr is the official Python SDK for the Delphi Sentinel Brain. It's a thin HTTP client: your agent calls sensor.scan(...), Delphi runs detection rules server-side and returns an action (allowed / flagged / blocked / escalated). Rules stay in the Brain so every deployment gets updates without a release.

Install

pip install xaidr

With LangChain 1.0 middleware:

pip install 'xaidr[langchain]'

Quick start

import asyncio
from xaidr import Sensor

async def main():
    async with Sensor(agent_id="my-agent") as sensor:
        result = await sensor.scan("ignore previous instructions")
        print(result.action, result.score, result.category)

asyncio.run(main())

Set DELPHI_API_KEY in your environment (or pass api_key= directly). See .env.example.

LangChain (3 lines)

from langchain.agents import create_agent
from xaidr.integrations.langchain import delphi_middleware

agent = create_agent(model="anthropic:claude-sonnet-4-5", tools=[...],
                    middleware=[delphi_middleware(agent_id="my-agent")])

The middleware scans every user turn before it reaches the model and short- circuits with a refusal on blocked.

API

  • Sensor(agent_id, api_key=None, sentinel_url=..., ...) — main client
  • await sensor.scan(prompt, direction="input") -> ScanResult
  • await sensor.scan_output(response) -> ScanResult
  • ScanResult(action, score, category, rules, latency_ms)
  • DelphiBlockedError — raised for convenience flows that prefer exceptions

Use async with Sensor(...) as sensor: — it registers the sensor, starts the background telemetry flush, and tears both down on exit.

Docs

Full docs: docs.delphisecurity.ai (coming soon)

License

MIT. See LICENSE.

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

xaidr-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

xaidr-0.1.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file xaidr-0.1.1.tar.gz.

File metadata

  • Download URL: xaidr-0.1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for xaidr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e492bec62e9a86272df0e0b8e5ee4c48e31d55d24c80a6b896aa243c511907b0
MD5 deebf3fc3431d96c06bd6bf1479b4009
BLAKE2b-256 e07af426c9e73027470faa734a89d5640089213a34db999d2c6d1bb2dcec708c

See more details on using hashes here.

File details

Details for the file xaidr-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: xaidr-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for xaidr-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eecfdb1aec5234b0f34f380c0da3ae58638b30597fcb93cded0f22130ca36357
MD5 acda83f9e537c47f33be884d77ddd0f6
BLAKE2b-256 cdf18cc448cba2e494c4f070a7bc13f0b911f596d16990f44a974d4ae91bd141

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