📦 @noxy-network/python-sdk
SDK for AI agent backends integrating with Noxy human-in-the-loop guardrails: send encrypted, actionable prompts (tool proposals, approvals, next-step hints) to registered user devices over gRPC so users can take decisions before work proceeds.
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 logical identity: wallet (
0x…), email, phone, appuser_id, …—whatever matchesidentity_id/ device linking in your Noxy app. - Receive delivery outcomes from the relay plus a
decision_idwhen the relay accepts the route. - Wait for human-in-the-loop resolution — users take decisions on-device and outcomes return via polling; prompts can 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(
"user@example.com", # or 0x…, phone, user_id — match device registration
{
"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) -> NoxyAgentClientNoxyIdentityId— type alias for relayidentity_id(str).NoxyAgentClient:send_decision(identity_id, ...),get_decision_outcome,wait_for_decision_outcome,send_decision_and_wait_for_outcome,get_quota,closeis_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
Metadata
Release files for noxy-sdk 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| noxy_sdk-2.2.0.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| noxy_sdk-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / noxy_sdk-2.2.0.tar.gz
| Download URL | noxy_sdk-2.2.0.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40264475ee42855a047832783e5ed7bf40f34216aa3c51ddca9f8d6381aa90b2
|
|
BLAKE2b-256 checksum How to use checksums |
b200111ad62e858776244201d2731ba96b89375bf36045a041ef77b3fde0d8ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / noxy_sdk-2.2.0-py3-none-any.whl
| Download URL | noxy_sdk-2.2.0-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de90242122a4052f7ade80e1f90f70d6e710efc6983917ed90a84c5a73d0d366
|
|
BLAKE2b-256 checksum How to use checksums |
745536c1b0f4e7c9028228ed723c6652762c3212d843b3b2b1b91b533a625adb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|