Skip to main content

breach-intel-client

Python SDK for the Breach Intel Policy Agent. Drop into any Python AI agent in 2 lines.

pip install breach-intel-client

Quick Start

from breach_intel_client import PolicyAgentClient

# Initialize (agent_id from register() below)
client = PolicyAgentClient(
    base_url="http://your-policy-agent:8080",
    agent_id="your-agent-id",
    vertical="fintech",
    silent=True,   # never block your agent if policy agent is down
)

# Wrap your LLM calls
response = my_llm.generate(prompt)
result = client.emit_llm_response(response.text, tenant_id="customer-001")

if result.is_breach:
    print(f"[BREACH] {result.breach_types} — severity: {result.severity}")
    print(f"Breach ID for audit: {result.breach_id}")

Registration

Note: If you installed with ./install.sh and enabled auto-monitoring, registration happens automatically. The sitecustomize.py hook calls auto_attach() → _auto_register(), which registers the process and reports detected AI frameworks (OpenAI, Anthropic, LangChain) as declared capabilities. Manual registration is only needed if you want to declare custom capabilities or skip auto-monitoring.

Call once at agent startup:

reg = client.register(
    agent_name="Portfolio Advisor v2",
    owner_id="acme-corp",
    declared_capabilities=["read_portfolio", "get_market_data", "send_report"],
    approved_domains=["api.bloomberg.com", "smtp.acme.com"],
)
client.agent_id = reg.agent_id  # save this

Emitting Events

Method Use when
emit_llm_response(text) Any LLM output
emit_tool_call(name, args) Before/after tool invocation
emit_api_request(method, url, body) Any outbound HTTP call
emit(event_type, payload) Any other event

Async Support

# pip install breach-intel-client[async]
from breach_intel_client import AsyncPolicyAgentClient

async with AsyncPolicyAgentClient("http://localhost:8080", agent_id="...") as client:
    result = await client.emit_llm_response_async(text, tenant_id="cust-001")

Querying Breaches

# All breaches for this agent
breaches = client.get_breaches(severity="CRITICAL")

# Single record
breach = client.get_breach("br-xyz")

# Tamper check
integrity = client.verify_breach("br-xyz")
print(integrity["tampered"])  # False = clean

# Summary counts
print(client.summary())

Metadata

Release files for breach-intel-client 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for breach-intel-client 0.3.1
File Size Uploaded
breach_intel_client-0.3.1.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for breach-intel-client 0.3.1
File Interpreter ABI Platform
breach_intel_client-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.4 kB

Release files / breach_intel_client-0.3.1.tar.gz

Download URL breach_intel_client-0.3.1.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c80f36d7649c8109cda63f817f9a245ae1321ab5235ff63260ecb4dfaaf60121
BLAKE2b-256 checksum
How to use checksums
644fcab86100c364c0482e67fe9cf579780826d3704fc1c05531ffc33061f1a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Release files / breach_intel_client-0.3.1-py3-none-any.whl

Download URL breach_intel_client-0.3.1-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cdfb521bd3f2bb45431e931633f547b3930cfc886be9f985435828c6929f3f4
BLAKE2b-256 checksum
How to use checksums
035748465c24291883238084ed8b9b9449b1eda9de8c4a29337eaea6de4f1fca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page