NullBridge Python SDK
AI Agent Identity Governance for Python — give your AI agents a cryptographic identity, credential vault, behavioral anomaly detection, and kill switch in three lines of code.
Installation
pip install nullbridge
Requires Python 3.8+. Zero external dependencies.
Quick Start
from nullbridge import NullBridge
import os
nb = NullBridge(license_key=os.environ["NULLBRIDGE_LICENSE_KEY"])
nb.init()
# Register your agent
agent = nb.agents.register(
name="fraud-detector",
type="llm",
model="gpt-4o",
scopes=["read:transactions", "write:alerts"],
metadata={"team": "risk", "environment": "prod"},
)
# Log actions to the audit trail
agent.log_action("analyze_transaction", {"tx_id": "TX-1234", "amount": 5000})
# Check permissions
if not agent.has_scope("write:alerts"):
raise PermissionError("Agent not authorized")
# Graceful shutdown
nb.shutdown()
Usage with LangChain
from nullbridge import NullBridge
from langchain.agents import initialize_agent
nb = NullBridge(license_key=os.environ["NULLBRIDGE_LICENSE_KEY"])
nb.init()
agent_identity = nb.agents.register(
name="langchain-research-agent",
type="llm",
model="gpt-4o",
scopes=["read:web", "write:reports"],
)
# Your normal LangChain agent
lc_agent = initialize_agent(tools, llm, agent="zero-shot-react-description")
# Wrap with NullBridge audit logging
def run_with_governance(query):
agent_identity.log_action("run_query", {"query": query})
result = lc_agent.run(query)
agent_identity.log_action("query_complete", {"result_length": len(result)})
return result
Usage with CrewAI
from nullbridge import NullBridge
from crewai import Agent, Task, Crew
nb = NullBridge(license_key=os.environ["NULLBRIDGE_LICENSE_KEY"])
nb.init()
# Register each CrewAI agent with NullBridge
researcher_identity = nb.agents.register(
name="researcher",
type="llm",
scopes=["read:web"],
)
writer_identity = nb.agents.register(
name="writer",
type="llm",
scopes=["write:reports"],
)
Context Manager
with NullBridge(license_key="NB-XXXX-XXXX-XXXX-XXXX") as nb:
agent = nb.agents.register(name="my-agent", type="llm")
agent.log_action("do_something")
# Automatically shuts down and flushes audit logs
Anomaly Detection
nb.anomaly.on_alert(lambda alert: print(f"Anomaly: {alert['metric']} z={alert['z_score']}"))
# Record metrics — NullBridge builds a baseline and alerts on deviations
nb.anomaly.record(agent.id, "api_calls_per_minute", 14)
nb.anomaly.record(agent.id, "tokens_used", 3200)
Environment Variables
export NULLBRIDGE_LICENSE_KEY=NB-XXXX-XXXX-XXXX-XXXX
License
Proprietary — contact brian@nullbridge.ai for licensing.
Metadata
Release files for nullbridge 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nullbridge-1.0.1.tar.gz | 12.7 kB | Without provenance | Details for nullbridge-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nullbridge-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for nullbridge-1.0.1-py3-none-any.whl |
Total release size: 26.0 kB
Release files / nullbridge-1.0.1.tar.gz
| Download URL | nullbridge-1.0.1.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
976beeb33b4811d880187c1b15927ccd095e2e3826b718f1f97b86cd5149b1df
|
|
BLAKE2b-256 checksum How to use checksums |
3d1f184c622bea449de98c9e82aaa60cfdf677316863f1f04bd5422b95e66eb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / nullbridge-1.0.1-py3-none-any.whl
| Download URL | nullbridge-1.0.1-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c47eecd49dfeead98171cdddef25ab494f7348344cf1787379d37f4158a3b55a
|
|
BLAKE2b-256 checksum How to use checksums |
bfe42be0aac1c6fb86dcfade794bb6eabefa91871deccf4608f2a2721372ddea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for nullbridge 1.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.