Skip to main content

Decision Layer SDK for AI agents. Encrypted actionable decisions over gRPC.

Project description

📦 @noxy-network/python-sdk

SDK for AI agent runtimes integrating with the Noxy Decision Layer: send encrypted, actionable decision payloads (tool proposals, approvals, next-step hints) to registered agent devices over gRPC.

Before you integrate: Create your app at noxy.network. When the app is created, you receive an app id and an app token (auth token). This Python SDK authenticates with the relay using the app token (auth_token in NoxyConfig). The app id is used by client SDKs (browser, iOS, Android, Telegram bot), not as the bearer token here.

Overview

  • Route decisions to devices bound to a Web3 identity (0x… address).
  • Receive delivery outcomes from the relay plus a decision_id when the relay accepts the route.
  • Wait for human-in-the-loop resolution — approve / reject / expire. The usual path is send_decision_and_wait_for_outcome.
  • Query quota and resolve identity devices.

The wire API uses agent.proto (noxy.agent.AgentService): RouteDecision, GetDecisionOutcome, GetQuota, GetIdentityDevices.

Communication is gRPC over TLS with Bearer authentication. Payloads are encrypted end-to-end (Kyber + AES-256-GCM) per device before leaving your process.

Requirements

  • Python >= 3.10

Installation

pip install noxy-sdk

Quick start

from noxy import (
    NoxyHumanDecisionOutcome,
    init_noxy_agent_client,
    NoxyConfig,
)

client = init_noxy_agent_client(
    NoxyConfig(
        endpoint="https://relay.noxy.network",
        auth_token="your-api-token",
        decision_ttl_seconds=3600,
    )
)

resolution = client.send_decision_and_wait_for_outcome(
    "0x...",
    {
        "kind": "propose_tool_call",
        "tool": "transfer_funds",
        "args": { "to": "0x000000000000000000000000000000000000dEaD", "amountWei": "1" },
        "title": "Transfer 1 wei to the burn address",
        "summary": "The agent is requesting approval to send 1 wei to the burn address.",
    },
)

if resolution.outcome == NoxyHumanDecisionOutcome.APPROVED:
    ...

Configuration

Option Type Required Description
endpoint str Yes Relay gRPC endpoint. https:// is stripped; TLS is used.
auth_token str Yes Bearer token for relay auth.
decision_ttl_seconds int Yes TTL for routed decisions (seconds).

SendDecisionAndWaitOptions

Optional argument to send_decision_and_wait_for_outcome.

Field Type Default Description
initial_poll_interval_ms float | None 400 First delay between polls (ms).
max_poll_interval_ms float | None 30000 Cap between polls (ms).
max_wait_ms float | None 900000 Total budget (ms). Raises WaitForDecisionOutcomeTimeoutError.
backoff_multiplier float | None 1.6 Backoff multiplier per iteration.

API

  • init_noxy_agent_client(config) -> NoxyAgentClient
  • NoxyAgentClient: send_decision, get_decision_outcome, wait_for_decision_outcome, send_decision_and_wait_for_outcome, get_quota, close
  • is_terminal_human_outcome, poll_decision_outcome_loop (advanced)
  • Exceptions: WaitForDecisionOutcomeTimeoutError, SendDecisionAndWaitNoDecisionIdError

Regenerating gRPC code

From the package root (requires grpcio-tools):

python -m grpc_tools.protoc -I proto --python_out=noxy/grpc --grpc_python_out=noxy/grpc proto/agent.proto

Then fix the import in noxy/grpc/agent_pb2_grpc.py to use a relative import:

from . import agent_pb2 as agent__pb2

License

MIT

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

noxy_sdk-2.0.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

noxy_sdk-2.0.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file noxy_sdk-2.0.1.tar.gz.

File metadata

  • Download URL: noxy_sdk-2.0.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for noxy_sdk-2.0.1.tar.gz
Algorithm Hash digest
SHA256 ea2eaa4da9ccac4bed911cfba452716f4c7e5c827e03e41f8da7f6a4c8f25763
MD5 1506b1b014a960b2e8317822c2c168b4
BLAKE2b-256 3f1343fd9e3a5542f9657afae54bc2804d97103bb854b53ffac38c6757ce2457

See more details on using hashes here.

File details

Details for the file noxy_sdk-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: noxy_sdk-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for noxy_sdk-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0775bc8f04adbc42c63b25fb5ada0fa88a581512e226f731e188bc2f1d7c06df
MD5 00a5b72a444ef3cb5181eefa3b42152b
BLAKE2b-256 c0a6213a58a7da4625f460090b2ab64b4220387e5b9f5f8701a033939dcc383b

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