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

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

Built distribution (wheel)

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

Total release size: 321.2 kB

Release files / btp_guard-7.0.4.tar.gz

Download URL btp_guard-7.0.4.tar.gz
Size 143.3 kB
Tags Source
SHA-256 checksum
How to use checksums
174fbc20670597f74b7155dbbad8a7c84876dce7da7c35e279a6677f4c438707
BLAKE2b-256 checksum
How to use checksums
2d3682dd47a73eaef61c2fd65c7b7021ee09816c7055ee93c50a67563ef0a823
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.4-py3-none-any.whl

Download URL btp_guard-7.0.4-py3-none-any.whl
Size 177.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cbfdee20318df755702f6c98b5a83d1dc0151f65567871423d30b5c4e9e35f7
BLAKE2b-256 checksum
How to use checksums
55a464fb2be5bed99f36bcfafd9b1ca7f3bb82b735246a59937262a2d780a83e
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.4

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