Paybond Kit for Python: hosted Gateway sessions, evidence signing, agent-runtime hooks, and Stripe Connect or x402 / USDC-on-Base settlement.
Project description
paybond-kit
Paybond Kit for Python is the PyPI package for tenant-bound Paybond integrations. It opens hosted Gateway sessions, verifies capability tokens, signs intent and evidence payloads, uses Stripe Connect or x402 / USDC-on-Base settlement rails, reads tenant-scoped Signal, fraud, ledger, protocol, and A2A data, and includes optional agent-runtime integrations.
Install
Core SDK:
pip install paybond-kit
Optional integrations:
pip install "paybond-kit[agents]"
pip install "paybond-kit[langgraph]"
pip install "paybond-kit[mcp]"
pip install "paybond-kit[agents,langgraph]"
Install only the extras your runtime needs. The agents extra enables the generic tool-guardrail helper for agent runtimes, langgraph enables the LangGraph tool wrapper, and mcp enables the paybond-mcp-server CLI.
Open source
paybond-kit is distributed as open-source software under the Apache 2.0 license. The source repo and published artifacts include the full license text in LICENSE.
Requirements
- Python 3.11+
- A
paybond_sk_sandbox_...orpaybond_sk_live_...service-account API key - For intent creation or evidence submission: 32-byte Ed25519 signing seeds owned by your application
Published wheels bundle the paybond_kit._native extension. maturin develop is only required when building from a local checkout.
Minimal environment for the quick start:
export PAYBOND_API_KEY="paybond_sk_sandbox_..."
Tenant isolation
Every session is bound to the tenant realm echoed by gateway-authenticated service-account introspection.
- Do not pass tenant ids by hand for normal SDK usage.
- Construct one
Paybondsession per tenant/service account. - Treat any tenant or intent echo mismatch from Harbor as a severity-zero defect.
Quick start
import asyncio
import os
from paybond_kit import Paybond
def required_env(name: str) -> str:
value = os.environ.get(name)
if not value:
raise RuntimeError(f"missing {name}")
return value
async def main() -> None:
paybond = await Paybond.open(
api_key=required_env("PAYBOND_API_KEY"),
expected_environment="sandbox",
)
try:
print("tenant realm:", paybond.harbor.tenant_id)
finally:
await paybond.aclose()
asyncio.run(main())
What the package includes
Core SDK:
Paybond.open(...)for API-key-only, tenant-derived hosted sessionsHarborClientfor capability verification, intent creation, x402 funding, evidence submission, and ledger readspaybond.signalandpaybond.fraudonPaybondsessions opened from one service-account API keyPaybondIntentshelpers for principal-side signing, x402 funding, and payee-side signing flows
Gateway and trust helpers:
GatewaySignalClientandServiceAccountSignalSessionfor tenant-scoped Signal reads and signed portfolio artifactsGatewayFraudClientandServiceAccountFraudSessionfor tenant-scoped fraud assessments, review queues, review events, metrics, and release-gate config- Protocol-v2 helpers for mandate verification, replay-safe recognition proof verification, receipt reads, and A2A discovery
Optional integrations:
- Optional extras for
agentsandlanggraph - Optional extra for
mcpwith the tenant-boundpaybond-mcp-serverCLI
Agent-facing surfaces are model-provider agnostic. Paybond verifies tool operations and tenant scope, not whether a tool call came from OpenAI, Anthropic, Gemini, a local model, or another runtime.
allowed_tools values are your own tool or operation names, not a Paybond-owned catalog. Harbor enforces string matching against whatever names you chose when creating the intent.
settlement_rail on intent creation is a principal-signed rail request. Stripe destinations and x402 receive addresses stay tenant-owned server-side config and are never supplied by the SDK caller.
The protocol-v2 surface is trust-first: signed mandates, recognition proofs, and receipts work across supported settlement adapters instead of treating any single rail as the product boundary.
Gateway-backed protocol helpers raise ProtocolHttpError with parsed error_code and error_message fields when the gateway returns a JSON error envelope. Recognition-gated flows surface unregistered_key, revoked_key, mandate_agent_key_mismatch, and protocol_binding_mismatch explicitly.
What it does not include
- No operator-tier settlement or console workflows
- No model-provider-specific MCP wrapper; the MCP server is host-agnostic and works with any MCP-compatible runtime
Source build
For local development from this directory:
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
maturin develop
Use this path when you are editing the package itself or rebuilding the bundled native extension locally.
Docs
- Long-form docs: https://paybond.ai/docs/kit
- Python quickstart: https://paybond.ai/docs/kit/quickstart-python
- Python SDK reference: https://paybond.ai/docs/kit/sdk-reference-python
- Agent integrations: https://paybond.ai/docs/kit/agent-integrations
- MCP server guide: https://paybond.ai/docs/kit/mcp-server
- Agent runtime tutorial: https://paybond.ai/docs/kit/agent-runtime-tutorial-python
- LangGraph patterns: https://paybond.ai/docs/kit/quickstart-python#agent-framework-integrations
Release verification
For maintainers working from a source checkout, release verification lives in this package directory:
python3 scripts/verify_release.py
This builds wheel and sdist artifacts, inspects them for stray local files, validates metadata/extras, and smoke-installs the built wheel in a temporary virtual environment.
Publish to PyPI
For maintainers only:
export MATURIN_PYPI_TOKEN="pypi-..."
./scripts/publish_release.sh
This reruns release verification and then publishes the sdist and wheel with maturin publish --non-interactive.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paybond_kit-0.7.1.tar.gz.
File metadata
- Download URL: paybond_kit-0.7.1.tar.gz
- Upload date:
- Size: 46.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a8e3609dc03204a69db04eb127b56f71a4cd376eccd1d41ab50f08c133cac0d
|
|
| MD5 |
5b4bd007d0f52c154e78a2d39036cfe5
|
|
| BLAKE2b-256 |
cde7511b8a5b274ef1677967275eab66622552dc904e95bbe365dfba58b35f7b
|
File details
Details for the file paybond_kit-0.7.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: paybond_kit-0.7.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 410.4 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
081c2c31b4fd89ef806593c8672feb55b904ff38bb8a0eb854f90e6200f00c63
|
|
| MD5 |
6fe9cc50f814e0cd1eaf21c83c32419d
|
|
| BLAKE2b-256 |
9d2cc72f558aa9b933b1fb782aa724792bec4e54d5d842011a0eab886307e2db
|