Skip to main content

btp-guard • BTP v2.2 Universal Agent Trust Guard

Cryptographic Governance for LangGraph, AutoGen, CrewAI & LlamaIndex

btp-guard is the official Python SDK for the Bartholomew Trust Protocol (BTP v2.2). It provides 100% offline, zero-network mathematical verification of autonomous agent trajectories, tool executions, and cross-framework delegations using RFC 8785 JSON Canonicalization (JCS) and FIPS 186-5 Ed25519 signatures.


Installation

pip install btp-guard

Quickstart: 1-Line Tool Guard (LangGraph / LangChain)

from btp_guard import BTPGuard

# 1. Initialize guard with your organization's recognized root authorities
guard = BTPGuard(
    trusted_authorities=["<64-hex-char-ed25519-public-key>"],
    agent_id="Agent-Production-Cluster"
)

# 2. Decorate critical tools
@guard.wrap_tool
def execute_sql_patch(sql_query: str):
    # Automatically blocked if unauthenticated or payload tampered
    return db.execute(sql_query)

Quickstart: Microsoft AutoGen Interceptor

from btp_guard import BTPGuard

guard = BTPGuard(trusted_authorities=[ROOT_KEY])

# Drops or alerts on unattested high-privilege tool requests in transit
safe_message = guard.intercept_autogen_message(inbound_packet)

Quickstart: Standalone Offline Verification (Zero-SDK)

from btp_guard import verify_btp_receipt

ok, msg = verify_btp_receipt(
    receipt_json_str=inbound_packet,
    candidate_payload={"file": "worker.py", "patch": "fix()"},
    trusted_root_pubkeys=[ROOT_KEY],
    expected_recipient_context="Agent-Production-Cluster"
)

if not ok:
    raise PermissionError(f"Attestation rejected: {msg}")

Specification & Challenge Package

Metadata

Release files for btp-guard 7.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for btp-guard 7.0.2
File Size Uploaded Provenance Actions
btp_guard-7.0.2.tar.gz 141.0 kB Without provenance Details for btp_guard-7.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for btp-guard 7.0.2
File Interpreter ABI Platform Actions
btp_guard-7.0.2-py3-none-any.whl Python 3 none any Details for btp_guard-7.0.2-py3-none-any.whl

Total release size: 316.1 kB

Release files / btp_guard-7.0.2.tar.gz

Download URL btp_guard-7.0.2.tar.gz
Size 141.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4e0e75f754353b5cdbfcca4124491b6a3ac57ea48b93a7d5f672adf4a474e5a5
BLAKE2b-256 checksum
How to use checksums
d0030d68e3a753a71290f15d3723316dfd4826fd85d97de11351660bbfead27d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / btp_guard-7.0.2-py3-none-any.whl

Download URL btp_guard-7.0.2-py3-none-any.whl
Size 175.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c6e2202787b5ca97fc127e1c0676f8d5cc4db75f787597b5d2a48e1d617559a
BLAKE2b-256 checksum
How to use checksums
ad42c1698243774f6431a388fc344b5e4a4d21412ced651e824bb47d02d7bb2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for btp-guard 7.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

7.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page