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.3

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.3
File Size Uploaded Provenance Actions
btp_guard-7.0.3.tar.gz 143.3 kB Without provenance Details for btp_guard-7.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 321.1 kB

Release files / btp_guard-7.0.3.tar.gz

Download URL btp_guard-7.0.3.tar.gz
Size 143.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cfb6cf7a01ce84e41ba714b1fee550bbbb231e3b2ea3d6fc2b5e643b7404334b
BLAKE2b-256 checksum
How to use checksums
a0662b3e144e29dc226dd8104088c03f41254e1dee03c677af3114f172237fb1
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.3-py3-none-any.whl

Download URL btp_guard-7.0.3-py3-none-any.whl
Size 177.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16abf19f1a49afed5a5401dc406bbebee88fc39337346fe5f7f2a3177be07ac2
BLAKE2b-256 checksum
How to use checksums
1c40657ee88ac042c3281f97868be87d4d36ac3bbaa72819d6789fe42c21701e
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.3

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.3 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