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.2.tar.gz (8.7 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.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xaidr-0.1.2.tar.gz
  • Upload date:
  • Size: 8.7 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.2.tar.gz
Algorithm Hash digest
SHA256 4f8a40758a67f71fce8afd96d2dd4da1308cb88e311116ae49d7491d31f2983a
MD5 fc33656d735026b140b0efaaecb01f9b
BLAKE2b-256 3b8977033ad8b43abc994c19e1fe9f209102f9472399b07448e0587ad5353ef0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xaidr-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53a8f0c390d8cf2821484318e769d21505c6a463d4b8642707d9ab4b2edfb02a
MD5 ffe517eca4402888603eb246482cb588
BLAKE2b-256 ed4ce6376820e08bed6cae37cefad0e83aa9005e0deb6134b984d81377f2e024

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