Metadata-Version: 2.4
Name: nexus-a2a-sdk
Version: 0.6.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: scitt
Requires-Dist: cryptography>=42.0; extra == "scitt"
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"
Requires-Dist: cryptography>=42.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"
Requires-Dist: cryptography>=42.0; extra == "dev"
Dynamic: license-file

# nexus-a2a-sdk

<!-- REPOSITORY-ROUTES:START -->
[![Framework context: v3.5](https://img.shields.io/badge/Framework_Context-v3.5-F6921E?style=flat-square)](../../../README.md)
[Framework home](../../../README.md) | [Topic map](../../../docs/README.md) | [Mapping validation](../../../docs/ROSETTA-STONE-V35.md) | [Component status](../../../docs/V35-ECOSYSTEM-ADOPTION.md) | [Agent routes](../../../llms.txt)
<!-- REPOSITORY-ROUTES:END -->

**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

This source tree contains SDK 0.6.0. Check the [PyPI release history](https://pypi.org/project/nexus-a2a-sdk/#history) for available versions. To evaluate this source revision, use `pip install ./NEXUS` from a reviewed repository checkout. See [component versions](../../../docs/COMPONENT-VERSIONS.md) for the repository’s release status.

```bash
pip install nexus-a2a-sdk

# RFC 9943 Signed Statements and Ed25519 verification
pip install "nexus-a2a-sdk[scitt]"

# Full production stack (embeddings + OPA + OpenTelemetry + SCITT signing)
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 |
| `nexus_sdk.payments.scitt` | RFC 9943 payment-evidence Signed Statements and independent issuer verification |
| `nexus_sdk.payments.scitt_receipts` | RFC 9162 transparency registration and RFC 9942 inclusion-receipt verification |

The human-readable **Transparency Statement Issuer**, technically
`SCITTSignedStatementIssuer`, creates COSE_Sign1 statements from canonical
evidence. Bind it to a protected Ed25519 signing service in production. Its
verifier reports issuer-signature validity separately from transparency-service
receipt verification, so an attached but unverified receipt cannot become a
false registration claim. See the
[Sovereign Payment Gateway](../../payments/SOVEREIGN-GATEWAY.md#transparency-statement-issuer).

The **Transparency Registration Service**, technically
`RFC9162TransparencyService`, is an in-memory reference service that registers
the exact Signed Statement and returns an RFC 9942 inclusion receipt. The
**Transparency Receipt Verifier**, technically `SCITTReceiptVerifier`, verifies
the RFC 9162 Merkle proof and trusted service signature. By default it accepts
statement envelopes up to 1,200,000 bytes and at most 16 attached receipts.
Registration uses the statement verifier's envelope limit and defaults to
the same receipt count. The reference log caches Merkle subtree hashes.
Keep the signed statement and receipt for later verification.
Production assurance requires a durable,
independently operated service and protected keys.

## 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).
