Skip to main content

Nexus Evidence Platform · Python SDK (NexusClient + nx.trace + HMAC auth)

Project description

nexus-ai-sdk · Python SDK

Client SDK for the Nexus Evidence Platform · EU AI Act compliance + observability.

Status: alpha (0.1.0) · sem 2 H1 · NOT yet published to PyPI (gate operador sem 3+).

Canon: ADR-037 §SDK contract languages · ADR-036 §Ingestion architecture · ADR-041 §Data residency boundary.

Install

Once published to PyPI:

pip install nexus-ai-sdk

For local development from this monorepo:

pip install -e sdk/python

Quickstart

from nexus_sdk import NexusClient

nx = NexusClient(
    api_key="nexus_tenant_abc123",
    tenant_id="<your-tenant-uuid>",
    system_id="hr-screening-v3",
    endpoint="http://127.0.0.1:8400",  # data-plane gateway local
    environment="production",
    sovereignty="eu",
)

with nx.trace(operation="candidate_screening", context={"job_id": "J-123"}):
    resp = anthropic_client.messages.create(
        model="claude-opus-4-7",
        messages=[...],
    )
    nx.attach_output(resp, classification="candidate_rank")

Architecture

The SDK sends IngestEvent payloads via HTTPS+HMAC to the data-plane gateway running locally (or in a Nexus-managed VPS). Raw prompts + responses never leave the data plane. Only aggregated metadata (counters, hashes, heartbeats) crosses to the control plane.

See adrs/ADR-036-ingestion-architecture.md for the full flow and adrs/ADR-041-data-residency-boundary.md for the boundary rules.

HMAC scheme

Each request is signed with HMAC-SHA256 using the tenant API key. Headers emitted:

X-Nexus-Tenant-Id:  <tenant_uuid>
X-Nexus-Timestamp:  <UTC ISO8601 second precision>
X-Nexus-Signature:  sha256=<hex>
Content-Type:       application/json

The signature canonicalizes the JSON body with sort_keys=True and compact separators, ensuring reproducibility cross-language (Python ↔ TypeScript SDK).

Errors

from nexus_sdk import NexusError, NexusAuthError, NexusValidationError

try:
    nx.send_event(event)
except NexusAuthError:
    # Rotate api_key via control plane
    ...
except NexusValidationError as e:
    print("schema rejected:", e.response_body)
except NexusError as e:
    # Network / generic gateway error
    ...

License

Proprietary · © Nexus Evidence Platform

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexus_evidence_sdk-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexus_evidence_sdk-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file nexus_evidence_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: nexus_evidence_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for nexus_evidence_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e89f41204e51a02c9a3c72660ad00be2a31ab0c156357ef0f220bb69553ec9f
MD5 d554bca68ac6378326838a6343729834
BLAKE2b-256 df4cc3d7fa5545ea63fca688267be1518b90fbab8bcfe60ec5b43b35789acc7d

See more details on using hashes here.

File details

Details for the file nexus_evidence_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nexus_evidence_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f2321829af5a4cc226b98ba37f07fc7c491b92ecffb09426a369e1c256a55d2
MD5 eb0736da013a0d86e63ea414cbe54f6f
BLAKE2b-256 feeb00a70db9a8213f1b05d10150b8bc5677899de5fea518ebbf9a0a8075b81c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page