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 clientawait sensor.scan(prompt, direction="input") -> ScanResultawait sensor.scan_output(response) -> ScanResultScanResult(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e492bec62e9a86272df0e0b8e5ee4c48e31d55d24c80a6b896aa243c511907b0
|
|
| MD5 |
deebf3fc3431d96c06bd6bf1479b4009
|
|
| BLAKE2b-256 |
e07af426c9e73027470faa734a89d5640089213a34db999d2c6d1bb2dcec708c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eecfdb1aec5234b0f34f380c0da3ae58638b30597fcb93cded0f22130ca36357
|
|
| MD5 |
acda83f9e537c47f33be884d77ddd0f6
|
|
| BLAKE2b-256 |
cdf18cc448cba2e494c4f070a7bc13f0b911f596d16990f44a974d4ae91bd141
|