Skip to main content

Paybond Kit for Python: tenant-bound Harbor sessions, evidence signing, and agent-runtime hooks.

Project description

paybond-kit

Paybond Kit for Python provides a tenant-bound Harbor client, gateway-authenticated service-account sessions, canonical signing for intent creation and evidence submission, x402 / USDC-on-Base intent funding helpers, tenant-scoped ledger provenance reads, tenant-scoped Signal analytics and reputation reads, plus first-party hooks for the OpenAI Agents SDK and LangGraph.

Install the public package with:

pip install "paybond-kit[agents,langgraph]"

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_... service-account API key
  • Reachable Gateway and Harbor base URLs

Published wheels bundle the paybond_kit._native extension. maturin develop is only required when building from a local checkout.

Tenant isolation

Every session is bound to the tenant realm echoed by gateway-authenticated service-account introspection and Harbor access exchange flows.

  • Do not pass tenant ids by hand for normal SDK usage.
  • Construct one Paybond session 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 uuid import UUID

from paybond_kit import Paybond


async def main() -> None:
    paybond = await Paybond.open(
        gateway_base_url="https://gateway.example.com",
        api_key=os.environ["PAYBOND_API_KEY"],
        harbor_base_url="https://harbor.example.com",
    )
    try:
        verified = await paybond.harbor.verify_capability(
            intent_id=UUID(os.environ["PAYBOND_INTENT_ID"]),
            token=os.environ["PAYBOND_CAPABILITY"],
            operation="payments.capture",
            requested_spend_cents=18_700,
        )
        if not verified.allow:
            raise RuntimeError(f"verify denied: {verified.code or 'deny'} {verified.message or ''}")
    finally:
        await paybond.aclose()


asyncio.run(main())

What the package includes

  • Paybond.open(...) for gateway-authenticated, tenant-derived Harbor sessions
  • HarborClient for capability verification, intent creation, x402 funding, evidence submission, and ledger reads
  • GatewaySignalClient and ServiceAccountSignalSession for tenant-scoped Signal reads
  • paybond.signal on Paybond sessions opened from one service-account API key
  • PaybondIntents helpers for principal-side signing, x402 funding, and payee-side signing flows
  • Optional extras for agents and langgraph

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 only a rail request. Stripe destinations and x402 receive addresses stay tenant-owned server-side config and are never supplied by the SDK caller.

What it does not include

  • No operator-tier settlement or console workflows

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: docs/kit/
  • Python quickstart: docs/kit/quickstart-python.md
  • Python SDK reference: docs/kit/sdk-reference-python.md
  • OpenAI Agents example: examples/paybond-kit-openai-agents-python/
  • LangGraph example: examples/paybond-kit-langgraph-python/

Release verification

From kit/python:

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

From kit/python:

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


Download files

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

Source Distribution

paybond_kit-0.3.0.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

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

paybond_kit-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (391.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file paybond_kit-0.3.0.tar.gz.

File metadata

  • Download URL: paybond_kit-0.3.0.tar.gz
  • Upload date:
  • Size: 31.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for paybond_kit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 08a9b89ccccc9b2d26154eb2926e5c40d0c0f717b4e27f8c9a1fd8209ea18f7a
MD5 dfe5e245347436fa544f82b183a74182
BLAKE2b-256 4cc9e0202d64e35d2a5529bfa8ea9d88b5c5ccab5540ed9db062e3b3bc9a0458

See more details on using hashes here.

File details

Details for the file paybond_kit-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for paybond_kit-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecc85a1d44c54796d338e20b6d4a29dde002a9daea5ebbb2a76106ef2a630563
MD5 0065a00f284917a55f4c04a0be987b2e
BLAKE2b-256 d8b0421b5547ab5392976214382c90fc23aeffa6837dbba73ddac3067b27c873

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