ai-safe2-framework

NEXUS v0.6.0

This is the 0.6.0 source candidate. The latest published PyPI SDK is 0.5.0, verified 2026-10-16. Source metadata and release notes do not prove publication. See component versions.

Non-repudiable, Extensible, eXecutive-Unified, Sovereign Agent-to-Agent Governance

NEXUS AI SAFE² License NEXUS CI

Cyber Strategy Institute reference implementation for governed agent-to-agent, agent-to-tool, and agent-to-payment enforcement

Framework Home Documentation Map Cross-Pillar Governance AISM MCP Profile Payments Profile Dashboard
Previous: ← AISM Next: Gateway / Runtime Enforcement →

Scoped technology contribution claims

NEXUS implementation evidence is assessed under the same Technology Contribution Profile as third-party candidates. Pin component versions, separate tested planes and scaffolding from operational mechanisms, and record contribution and assurance per claim. Reference-implementation status and AISM invariants do not confer organizational maturity, certification, or automatic conformance. This documentation update changes no NEXUS schema or enforcement behavior.

Role in AI SAFE² v3.1

AI SAFE² is the governance and requirements standard. NEXUS is Cyber Strategy Institute’s first-party reference implementation.

NEXUS demonstrates one way to enforce AI SAFE² requirements across:

Organizations do not have to deploy NEXUS to claim AI SAFE² conformance. They must demonstrably satisfy the applicable AI SAFE² controls and produce the required independently reconstructable evidence.


What changed in v0.5

v0.5 turns the payment integrity profile into a composed Sovereign Payment Gateway reference implementation. The agent can propose a payment, but it cannot obtain unrestricted keys, widen authority, reinterpret a timeout as permission to retry, or declare its own settlement truth.

The release adds durable gateway state, Key Guardian, independent policy and runtime authorities, transaction-bound human approval, authoritative settlement observation, governed recovery, policy-parity enforcement, sandbox rail readiness, and deployment-proof decisions. These components remain reference implementations until an operator binds production storage, protected signing, authenticated rail integrations, and independently controlled trust roots.

Start with the Sovereign Payment Gateway and Deployment Proof & Readiness guides.

Compatibility boundary

The Python distribution is nexus-a2a-sdk; applications import it as nexus_sdk. Package release 0.6.0 retains the CP.5.APAY/0.4 profile, schema filenames, policy identifiers, and wire contracts introduced in v0.4. The new gateway composes and hardens those contracts; it does not silently revise them. A future profile revision will use new, explicitly versioned identifiers and migration guidance.

Payment foundation introduced in v0.4

v0.4 adds the agent-to-payment enforcement plane as CP.5.APAY, the Agentic Payments Integrity Profile.

The reasoning is short. The agentic payments ecosystem is standardizing fast, and it is standardizing around two questions: is this a registered agent (Visa TAP, Mastercard Agent Pay, both on Web Bot Auth) and did a human approve this purchase (AP2, contributed to the FIDO Alliance in April 2026). Both are being answered well.

Neither is the question that decides whether money stays where it belongs. That question is whether the workload holding a valid credential is still running the software that was approved — and every one of those protocols assumes the signing host is trustworthy without requiring proof of it. An attacker who owns the agent host inherits its identity, registrations and mandates intact, and every signature they produce verifies correctly, because it is correct.

Identity proves which agent arrived. Mandates prove what authority was granted. NEXUS proves whether this measured workload may still use that authority for this transaction, at this moment — and stops the entire authority tree when it may not.

Two AISM invariants are added alongside the existing six: I-7 Runtime-Bound Authority and I-8 Aggregate Economic Containment.


Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│                            NEXUS v0.6.0                                     │
├───────────┬─────────────────────────────────────────────────────────────────┤
│ L7        │ Value Integrity        CP.5.APAY: mandates, runtime binding,    │
│           │                        containment, revocation, PTR evidence    │
│ L6        │ Governance Plane       Constitutional constraints, amendments   │
│ L5        │ Economic Governance    Compute/accounting ceilings              │
│ L4        │ Memory and Context     Memory Vaccine, provenance, AgBOM        │
│ L3        │ Policy Enforcement     Guardian, OPA, AISM invariants           │
│ L2        │ Identity + Delegation  AIM, VCC, scoped authority, lineage      │
│ L1        │ Transport Security     mTLS, workload identity, crypto binding  │
├───────────┴─────────────────────────────────────────────────────────────────┤
│ Bridges / adapters: A2A | ACS | MCP | OpenAI | LangChain | CrewAI | n8n      │
│ Payment bindings:   AP2 | x402 | Visa TAP | Agent Pay | KYA-OS  (contracts)  │
└─────────────────────────────────────────────────────────────────────────────┘

NEXUS wraps the user’s stack. It does not replace the model, agent framework, tool protocol, wallet, or payment rail.


What NEXUS Implements

Security property NEXUS mechanism
Verified agent/workload identity AIM + DID and supported workload-attestation mechanisms
Delegation scope attenuation VCC and monotonic scope constraints
Memory provenance and drift controls Memory Vaccine and provenance records
Per-action policy enforcement Guardian + OPA policies
Non-repudiable operational receipts NOR and OTel/OCSF-compatible evidence
Dynamic agent supply-chain inventory AgBOM
Fail-closed enforcement Guardian/gateway decision paths
Protocol/tool governance Bridges and the v3.1 MCP adapter contract
Runtime-bound value authorization Payment Integrity Gateway + RuntimeMeasurement
Aggregate economic containment Authority graph subtree exposure accounting
Measured revocation Revocation epochs + exposure_after_revocation
Dispute-grade payment evidence PTR, hash-chained, selectively disclosed

Enforcement Planes

Plane NEXUS role Status
East-west: agent to agent Identity, delegation, authority, lineage, evidence v0.3 implementation
Agent-to-tool: MCP/tool CP.5.MCP enforcement contract and adapter path v3.1 adapter contract present; production implementation still required
Agent-to-payment: value CP.5.APAY plus Sovereign Payment Gateway controls v0.5 reference implementation; production bindings still required
North-south: model/provider Integrates with AI SAFE² gateway/runtime controls Reference integration path

MCP status is intentionally explicit

The NEXUS/adapters/mcp/adapter.py file added for AI SAFE² v3.1 is a fail-closed interface skeleton. Unimplemented methods raise rather than silently permit traffic.

It must not be described as production-ready until the authorization, provenance, state-handle, catalog, replay, and MCP-19 resource/audience enforcement paths are implemented and tested.

See NEXUS MCP adapter and CP.5.MCP.

Payment status is intentionally explicit

The CP.5.APAY core and its narrow reference adapters are implemented and tested. See the adapter guide for supported profiles, integration boundaries, and verification commands.

The rail bindings in nexus_sdk/payments/adapters.py (AP2, x402, Visa TAP, Mastercard Agent Pay, KYA-OS) are fail-closed contracts. Every enforcement method raises. They are published as contracts rather than stubs because each requires conformance testing against a live counterparty before it can be claimed, and a stub returning success would let a deployment believe it has binding it does not have.

The default credential broker is NullCredentialBroker, which refuses every signing request. An unconfigured payment path does not move money. Replacing that default with a permissive stub is the single most damaging change available in this codebase.

No production assurance is claimed. See the MVP acceptance gates.


Install

# Core SDK
pip install nexus-a2a-sdk

# Full production dependencies where supported
pip install "nexus-a2a-sdk[full]"

From source:

cd NEXUS
pip install -e .

v0.4 packaging fix. Prior releases declared an invalid build-backend, which made the package uninstallable from source. Corrected to setuptools.build_meta.

The PyPI distribution is nexus-a2a-sdk; the Python import is nexus_sdk.


Quick Start

Guardian: enforce before execution

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)

Arguments are normalized before matching: percent-decoded, NFKC, \ to /, slashes collapsed. Built-in detectors run alongside your patterns: credential paths, path traversal, cloud metadata endpoints in any IP spelling, secret material, and download-to-interpreter pipes. Always declare act_tier. An omitted tier is treated as ACT-4, so HEAR applies (ACT_TIER_UNDECLARED), and ACT-3/4 reasoning must be substantive enough to review. See the CHANGELOG for the opt-outs.

Registry-bound ACT tiers (AIM v0.3)

The tier an agent operates at belongs to its identity, not its request. Register the agent’s AIM (owner of record sets actTier), then give the registry to Guardian and its export to OPA:

from nexus_sdk import AIMRegistry, GuardianPolicy

registry = AIMRegistry(signature_verifier=my_mldsa65_verifier)  # your FIPS 204 verifier
registry.register(aim_document)                             # schemas/aim-v0.3.schema.json
policy = GuardianPolicy(aim_registry=registry)              # registered tier governs HEAR
opa_data = {"nexus": {"aim": registry.to_opa_data()}}       # data.nexus.aim for the OPA sidecar

A request-supplied act_tier is a claim. Above the registered tier it is denied; below it, it is ignored. Unregistered agents are denied. Raising a tier means registering a new AIM version.

Payments: authority that narrows and cannot be widened

from nexus_sdk.payments import AuthorityGraph, MandateCompiler, Money

compiler = MandateCompiler()
mandate = compiler.compile(
    "Buy cloud capacity from approved vendors, up to $500 a time",
    explicit={"allowed_merchants": {"vendor-a"},
              "max_aggregate": Money.parse("5000.00")},
)
grant = compiler.issue(mandate, principal_id="principal-1",
                       rendering=compiler.render(mandate))

graph = AuthorityGraph()
graph.register_root(grant)

graph.delegate(grant.authority_grant_id, max_transaction=Money.parse("50.00"))   # ok
graph.delegate(grant.authority_grant_id, max_transaction=Money.parse("5000.00"))
# AttenuationError: delegation would widen parent authority on: max_transaction

Open-ended instructions do not become numbers:

compiler.compile("spend whatever we need on infrastructure").unresolved
# [Ambiguity(axis='max_transaction', detail='instruction contains open-ended
#  spend language; a ceiling must be set explicitly', resolution=None)]

See payments/README.md for the full sequence.

NOR: produce attributable evidence

from nexus_sdk.otel import build_tool_call_nor, nor_to_otel_attributes

nor = build_tool_call_nor(
    agent_did="did:nexus:agent:my-agent",
    spiffe_id="spiffe://nexus.local/agent/my-agent",
    tool_name="read_file",
    outcome=verdict.decision,
)

attrs = nor_to_otel_attributes(nor)

Memory Vaccine: govern persistence

AI SAFE² v3.1 uses the canonical governance vocabulary: request, handle_scoped, durable.

Older NEXUS APIs may still expose SESSION, CROSS_SESSION, or PERMANENT as compatibility aliases during migration. Those legacy names must not be treated as protocol identity or authorization boundaries.

from nexus_sdk.memory import MemoryVaccine

mv = MemoryVaccine(
    "did:nexus:agent:my-agent",
    "research assistant",
    use_stub_embeddings=True,
)

AgBOM: track the agent supply chain

from nexus_sdk.agbom import AgBOMManager

agbom = AgBOMManager("did:nexus:agent:my-agent")
agbom.discover_mcp_server("filesystem-mcp", "http://localhost:3000", version="1.0")

chain_ok, violations = agbom.verify_chain_integrity()

AISM Invariants

NEXUS encodes architectural invariants as enforceable policy. The v0.4 interpretation is:

Invariant Requirement
I-1 Authenticated Borders Verify the principal/workload at governed boundaries
I-2 Monotonic Scope Delegated authority narrows or expires; it does not silently expand
I-3 Memory Provenance Governed persistent writes require attributable provenance and policy context
I-4 Physical/External Kill Path High-autonomy deployments retain an independently operable stop path
I-5 Owner of Record Every governed agent has accountable human ownership
I-6 Bias as Security Signal Material behavioral drift can be treated as a security event, not merely a quality metric
I-7 Runtime-Bound Authority (new) Authority to take a consequential action binds to a fresh measurement of the workload exercising it, not only to the identity presenting it
I-8 Aggregate Economic Containment (new) Consumable authority aggregates across the authority tree; every descendant’s consumption counts against every ancestor’s ceiling

Policy files:

The payment policy and the in-process TransactionFirewall are fed from one input contract (nexus_sdk/payments/opa_input.py), and tests/test_apay_opa_contract.py fails if the Rego references an input path nothing supplies. Two implementations of one rule set drift, and drift in a policy engine is silent: the two disagree only on the transactions that matter.


AI SAFE² v3.1 Alignment

NEXUS is evaluated as an implementation against AI SAFE². The framework is not considered proven merely because NEXUS implements a control.

Key v3.1 expectations include:

The existing scoring utility remains an implementation checker and should not be treated as independent framework validation.


Protocol and Integration Status

Integration Status
ACS Guardian / AOS JSON-RPC v0.3 supported
Agent-to-agent bridge paths v0.3 supported
OpenAI/function calling bridge Existing implementation
LangChain / LangGraph Existing implementation
CrewAI Existing implementation
n8n Existing implementation
REST bridge Existing implementation
MCP legacy bridge behavior Existing compatibility path
MCP 2026-07-28 v3.1 enforcement adapter Contract/scaffolding, not production-ready
CP.5.APAY core and reference adapters v0.4 implemented and adversarially tested
Identity normalization (Entra/KYA-OS/SPIFFE/Web Bot Auth) v0.4 implemented
AP2 binding Contract only, not implemented
x402 SafePay Exact binding (X402V2ExactEVMUSDCBinding) Narrow structural binding implemented; shadow mode only, no live facilitator or chain verification
Visa TAP / Web Bot Auth binding Contract only, not implemented
Mastercard Agent Pay binding Contract only, not implemented
KYA-OS binding Contract only, not implemented

This table intentionally separates existing bridge code from enforcement contracts that are not yet implemented.


Repository Map

NEXUS/
├── adapters/
│   └── mcp/                    v3.1 agent-to-tool adapter contract
├── payments/                   CP.5.APAY profile, threat model, controls, challenge lab
├── sdk/python/nexus_sdk/       Core SDK
│   └── payments/               Payment Integrity Gateway
├── sdk/python/tests/           SDK tests (run them; see Testing)
├── opa/                        Authorization, AISM invariant, and APAY policies
├── schemas/                    AIM, NOR, AgBOM, Guardian, APAY grant, APAY PTR schemas
├── docker/                     Reference deployment assets
├── examples/                   Gateway, bridge, and personal-agent examples
├── governance/                 Governance charter and draft protocol work
└── compliance/scoring/         NEXUS implementation scoring

Testing

cd NEXUS
pip install -e ".[dev]"
pytest sdk/python/tests -q
opa check --strict opa/ && opa test opa/   # policies: OPA 0.65 (compose pin) and 1.x

The payment suite is structured so that a control with only a happy-path test does not count as a control: every APAY control has at least one test proving it denies what it claims to deny, and the TestHonesty class fails if anyone makes a fail-closed default permissive. Run the current suite rather than relying on a documentation test count.


Governance and Licensing

NEXUS is licensed under Apache 2.0 where designated in the NEXUS subtree. This differs from the broader AI SAFE² repository licensing model, which uses MIT for code and CC BY-SA 4.0 for framework/documentation material unless a subtree states otherwise.

See:


🔗 Navigation

Previous Current Next
AISM NEXUS Payments Profile → Gateway
Framework Home Cross-Pillar Governance AISM MCP Profile Payments Profile Challenge Lab Dashboard

AI SAFE² v3.1 reference implementation · NEXUS v0.6.0 · Cyber Strategy Institute