Python SDK for the Breach Intel Policy Agent — attach any AI agent to breach logging in one import
Project description
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.shand enabled auto-monitoring, registration happens automatically. Thesitecustomize.pyhook callsauto_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())
Project details
Release history Release notifications | RSS feed
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 breach_intel_client-0.3.1.tar.gz.
File metadata
- Download URL: breach_intel_client-0.3.1.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c80f36d7649c8109cda63f817f9a245ae1321ab5235ff63260ecb4dfaaf60121
|
|
| MD5 |
5fca8044924390158d324e8c9a2cb35a
|
|
| BLAKE2b-256 |
644fcab86100c364c0482e67fe9cf579780826d3704fc1c05531ffc33061f1a5
|
Provenance
The following attestation bundles were made for breach_intel_client-0.3.1.tar.gz:
Publisher:
publish-sdk.yml on ParthaMehtaOrg/breach-intel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breach_intel_client-0.3.1.tar.gz -
Subject digest:
c80f36d7649c8109cda63f817f9a245ae1321ab5235ff63260ecb4dfaaf60121 - Sigstore transparency entry: 1195255578
- Sigstore integration time:
-
Permalink:
ParthaMehtaOrg/breach-intel@44986c70b703c7d6ff74b9e2839aa4d696094a3d -
Branch / Tag:
refs/tags/sdk/v0.3.1 - Owner: https://github.com/ParthaMehtaOrg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@44986c70b703c7d6ff74b9e2839aa4d696094a3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file breach_intel_client-0.3.1-py3-none-any.whl.
File metadata
- Download URL: breach_intel_client-0.3.1-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cdfb521bd3f2bb45431e931633f547b3930cfc886be9f985435828c6929f3f4
|
|
| MD5 |
f79ec8c2bdb087b144b8404b1037b8e8
|
|
| BLAKE2b-256 |
035748465c24291883238084ed8b9b9449b1eda9de8c4a29337eaea6de4f1fca
|
Provenance
The following attestation bundles were made for breach_intel_client-0.3.1-py3-none-any.whl:
Publisher:
publish-sdk.yml on ParthaMehtaOrg/breach-intel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
breach_intel_client-0.3.1-py3-none-any.whl -
Subject digest:
7cdfb521bd3f2bb45431e931633f547b3930cfc886be9f985435828c6929f3f4 - Sigstore transparency entry: 1195255650
- Sigstore integration time:
-
Permalink:
ParthaMehtaOrg/breach-intel@44986c70b703c7d6ff74b9e2839aa4d696094a3d -
Branch / Tag:
refs/tags/sdk/v0.3.1 - Owner: https://github.com/ParthaMehtaOrg
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@44986c70b703c7d6ff74b9e2839aa4d696094a3d -
Trigger Event:
push
-
Statement type: