Metadata-Version: 2.4
Name: nexus-a2a-sdk
Version: 0.5.0
Summary: NEXUS SDK: deterministic governance for agent, tool, and payment execution
Author-email: Cyber Strategy Institute <sdk@cyberstrategyinstitute.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/CyberStrategyInstitute/ai-safe2-framework/tree/main/NEXUS
Project-URL: Repository, https://github.com/CyberStrategyInstitute/ai-safe2-framework
Project-URL: Documentation, https://github.com/CyberStrategyInstitute/ai-safe2-framework/blob/main/NEXUS/README.md
Project-URL: Security Policy, https://github.com/CyberStrategyInstitute/ai-safe2-framework/blob/main/NEXUS/SECURITY.md
Project-URL: Issue Tracker, https://github.com/CyberStrategyInstitute/ai-safe2-framework/issues
Project-URL: Changelog, https://github.com/CyberStrategyInstitute/ai-safe2-framework/blob/main/NEXUS/CHANGELOG.md
Keywords: ai-agents,agent-security,agentic-ai,mcp,a2a,ai-governance,zero-trust,safe2,opa,spiffe,guardian,memory-vaccine,nexus
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Provides-Extra: embeddings
Requires-Dist: sentence-transformers>=2.7.0; extra == "embeddings"
Provides-Extra: opa
Requires-Dist: httpx>=0.27.0; extra == "opa"
Provides-Extra: otel
Requires-Dist: opentelemetry-api>=1.24.0; extra == "otel"
Requires-Dist: opentelemetry-sdk>=1.24.0; extra == "otel"
Requires-Dist: opentelemetry-exporter-otlp>=1.24.0; extra == "otel"
Provides-Extra: full
Requires-Dist: sentence-transformers>=2.7.0; extra == "full"
Requires-Dist: httpx>=0.27.0; extra == "full"
Requires-Dist: opentelemetry-api>=1.24.0; extra == "full"
Requires-Dist: opentelemetry-sdk>=1.24.0; extra == "full"
Requires-Dist: opentelemetry-exporter-otlp>=1.24.0; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: mypy>=1.10.0; extra == "dev"
Dynamic: license-file

# nexus-a2a-sdk

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

[![Version](https://img.shields.io/pypi/v/nexus-a2a-sdk)](https://pypi.org/project/nexus-a2a-sdk/)
[![License](https://img.shields.io/pypi/l/nexus-a2a-sdk)](https://github.com/CyberStrategyInstitute/ai-safe2-framework/blob/main/NEXUS/LICENSE)
[![Python](https://img.shields.io/pypi/pyversions/nexus-a2a-sdk)](https://pypi.org/project/nexus-a2a-sdk/)

The Python SDK for [NEXUS](https://github.com/CyberStrategyInstitute/ai-safe2-framework/tree/main/NEXUS), an optional AI SAFE² reference implementation for governed agent actions.

## Install

```bash
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

```python
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](https://github.com/CyberStrategyInstitute/ai-safe2-framework/tree/main/NEXUS)

## License

Apache 2.0. See [LICENSE](https://github.com/CyberStrategyInstitute/ai-safe2-framework/blob/main/NEXUS/LICENSE).
