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, scan_id)
  • 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.0.tar.gz (7.5 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.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xaidr-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 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.0.tar.gz
Algorithm Hash digest
SHA256 99f6c193d7dccb35ee6683bd2b2c12d9569d938b0a1e422ef69bb7ecea8ee6f4
MD5 d7c0aa27d4947ca373fea3af2b442156
BLAKE2b-256 71389a4243cc0e0df7ce5982ce1231b915ec932844e4ef11b193c5da2c376100

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xaidr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e206f225f7c851f11ef588ff79a0f2be1bf92e636dd8edb446ac2bc6c34f8896
MD5 9cb19326b09f312d1af00cbfdea9a561
BLAKE2b-256 703a1b59bb96ddae32429386436e690cbc61e80a3217836bf0fafd6927eb781e

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