ai-safe2-framework

nexus-a2a-sdk

NEXUS Python SDK: deterministic governance for agent, tool, and payment execution.

Version License Python

The Python SDK for NEXUS, an optional AI SAFE² reference implementation for governed agent actions.

Install

The source SDK is 0.6.0; PyPI currently serves 0.5.0 (verified 2026-10-16). Install from a reviewed repository checkout using pip install ./NEXUS for the 0.6.0 source candidate. The package-index commands below install the published SDK. See component versions.

pip install nexus-a2a-sdk

# Full production stack (embeddings + OPA client + OpenTelemetry)
pip install "nexus-a2a-sdk[full]"

What’s Included

Module What it does
nexus_sdk.cael CAEL envelope, APEM message types, JouleWork economic accounting
nexus_sdk.memory Memory Vaccine: injection detection, drift scoring, provenance
nexus_sdk.guardian Guardian Integration Profile: per-call argument inspection
nexus_sdk.otel NOR output receipts, OpenTelemetry/OCSF audit export
nexus_sdk.agbom Dynamic Agent Bill of Materials: real-time, hash-chained
nexus_sdk.bridges Protocol bridges: MCP, ACS, A2A, LangChain, CrewAI, n8n, REST
nexus_sdk.payments Sovereign Payment Gateway contracts, deterministic controls, evidence, and readiness gates

Quick Example

from nexus_sdk.guardian import GuardianPolicy, NEXUSGuardianClient, build_tool_call_step

policy   = GuardianPolicy(blocked_argument_patterns=["../"])
guardian = NEXUSGuardianClient(inline_policy=policy,
                               fail_mode=NEXUSGuardianClient.FAIL_CLOSED)

step    = build_tool_call_step(
    agent_did="did:nexus:agent:my-agent",
    spiffe_id="spiffe://nexus.local/agent/my-agent",
    tool_name="read_file",
    tool_arguments={"path": "../../etc/passwd"},
    act_tier=2,
)
verdict = guardian.evaluate(step)
print(verdict.decision)   # deny

Documentation

Full documentation, reference deployment, OPA policies, JSON schemas, and the IETF draft: github.com/CyberStrategyInstitute/ai-safe2-framework/NEXUS

License

Apache 2.0. See LICENSE.