Skip to main content

Bartholomew Shield Logo

Bartholomew (BTP v5.4) — The Agentic Runtime Protection (ARP) Platform

Deterministic AST Policy Invariant Gating, In-Flight Secret Masking, and Cryptographic Attestation for Autonomous AI Agent Swarms.

CI Open VSX PyPI npm License: MIT Tests

OpenAI Anthropic LangChain CrewAI AutoGen IDE


What It Does

Bartholomew is the execution gate for autonomous AI agents.

It sits between an agent and real-world execution (shell, SQL, file I/O, cloud APIs) and decides whether proposed actions should be allowed before they execute.

                    [ Autonomous Agent / LLM ]
                                │
                                ▼  (Proposes Tool Call / Bash / SQL)
  ┌────────────────────────────────────────────────────────────────────────┐
  │                 Bartholomew In-Process Runtime Gateway                 │
  │                                                                        │
  │   [ Polyglot AST Invariant Gate ] ──► Sub-millisecond syntax check     │
  │   [ In-Flight Secret Vault ]       ──► Real-time credential scrubbing   │
  │   [ Declarative Policy Engine ]   ──► Spend caps & command allowlists  │
  │   [ Cryptographic Attestation ]   ──► RFC 8785 Ed25519 Signed Receipts │
  └───────────────────────────────────┬────────────────────────────────────┘
                                      │
                         ┌────────────┴────────────┐
                         ▼                         ▼
                    [ ALLOW ]                  [ DENY ]
                         │                         │
                         ▼                         ▼
             [ Target System / DB / OS ]   [ Execution Veto + Audit Evidence ]

Core Capabilities:

  • Pre-Execution Gating: Evaluates tool arguments, commands, and code strings before OS dispatch.
  • Polyglot AST Parsing: Parses Abstract Syntax Trees across Python, SQL, Bash, JavaScript, and Go to block dangerous mutations (rm -rf, DROP TABLE, subshell escapes).
  • In-Flight Secret Scrubbing: Detects and redacts credentials (sk-*, ghp_*, AKIA*, private keys) before they touch logs, providers, or vector stores.
  • Cryptographic Auditability: Generates canonical RFC 8785 JSON digests signed with Ed25519 keys for tamper-proof verification.
  • Zero Network Overhead: Evaluates locally inside the host process runtime without external API latency or second-model token billing.

Quickstart

Python

pip install btp-guard
from btp_guard import Guard

guard = Guard(spend_cap=100.0, strict=True)

# 1. Protect any tool function via decorator
@guard.protect
def execute_shell(command: str):
    return f"Executed: {command}"

# 2. Or check actions directly inline
result = guard.check("rm -rf /var/data")
if not result["allowed"]:
    print(f"Blocked: {result['reason']}")
# Output: Blocked: BTP-AST-001: Catastrophic shell pattern detected

Node.js / TypeScript

npm install btp-guard
import { Guard } from "btp-guard";

const guard = new Guard({ maxSpendUsd: 100.0 });
const verdict = guard.check("DROP TABLE users;");

if (!verdict.allowed) {
  throw new Error(`Action blocked: ${verdict.reason}`);
}

MCP Server (Model Context Protocol)

Bartholomew provides a native Model Context Protocol (MCP) server for Claude Desktop, Cursor, Windsurf, and any MCP-compatible client:

{
  "mcpServers": {
    "bartholomew": {
      "command": "python",
      "args": ["-m", "src.mcp_server"]
    }
  }
}

Framework Integrations

Bartholomew provides drop-in runtime interceptors for all major agent orchestrators:

Framework / Ecosystem Integration Guard Reference Guide
OpenAI Agents SDK Dynamic Tool Gating & Schema Invariant Checks docs/FRAMEWORK_GUIDE.md
Anthropic Claude ClaudeToolGuard / Tool-Call Interceptor docs/FRAMEWORK_GUIDE.md
Microsoft AutoGen @btp_autogen_guard / Swarm Consensus Interceptor examples/future_swarms/autogen_swarm_consensus.py
CrewAI @btp_crewai_tool / Task & Agent Boundary Gate docs/FRAMEWORK_GUIDE.md
LangChain / LangGraph BTPGuardTool / Node Execution Interceptor docs/FRAMEWORK_GUIDE.md
Cursor / VS Code Pre-execution IDE Sentry & Extension Open VSX Extension

Defense in Depth Architecture

Bartholomew functions as Layer 2 in the autonomous agent defense stack:

Layer Technology Typical Latency Defense Boundary
Layer 1 — Prompt Rails NeMo, Guardrails AI, LlamaGuard 800ms – 2,500ms Natural language prompt & completion text
Layer 2 — Execution Gate Bartholomew BTP < 0.1 ms (Sub-millisecond) Raw tool arguments, AST syntax, credentials, spend
Layer 3 — OS Isolation Docker, gVisor, E2B 200ms – 500ms Kernel syscall & container isolation

Audit & Compliance Readiness

Bartholomew generates tamper-evident audit evidence packs mapping to AICPA Trust Services Criteria (CC6.1, CC6.6, CC7.1) and ISO/IEC 27001:2022 (A.8.8, A.8.30):

python scripts/generate_soc2_compliance_evidence.py

Output: docs/audit/soc2-compliance-evidence.json containing SHA-256 Merkle proofs, RFC 8785 canonical digests, and Ed25519 digital signatures for zero-network independent auditor verification.


Development & Test Suite

# Clone repository
git clone https://github.com/ivegotahunnitonit/bartholomew.git
cd bartholomew

# Install dependencies
pip install -e ".[test]"

# Run full test suite (2,920 automated tests)
python -m pytest -q

Documentation


License

Bartholomew is distributed under the MIT License.

Release files for btp-guard 5.4.19

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 5.4.19
File Size Uploaded
btp_guard-5.4.19.tar.gz 945.4 kB Details

Built distribution (wheel)

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

Total release size: 1.9 MB

Release files / btp_guard-5.4.19.tar.gz

Download URL btp_guard-5.4.19.tar.gz
Size 945.4 kB
Tags Source
SHA-256 checksum
How to use checksums
714c223a80972ee2a89b9459df1937a0052874d573eb5c807ab6350233799732
BLAKE2b-256 checksum
How to use checksums
86f28c97b0a6c468cc3c825f90bed6b6ad52c01cde852e60d2cf9a09e6e8767e
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-5.4.19-py3-none-any.whl

Download URL btp_guard-5.4.19-py3-none-any.whl
Size 958.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83311a40a97285e03a8d77fddb1b7bc8060ec16773b1f25ca74c3b81a33f22dc
BLAKE2b-256 checksum
How to use checksums
809ac4430798ce573767f85602f9094b36c6a448dd2e60e9ab3f4d0190117fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

5.4.21

2 release files

5.4.20

2 release files

This release

5.4.19 This release

2 release files

5.4.17

2 release files

5.4.16

2 release files

5.4.15

2 release files

5.4.14

2 release files

5.4.13

2 release files

5.4.12

2 release files

5.4.11

2 release files

5.4.10

2 release files

5.4.8

2 release files

5.4.7

2 release files

5.4.6

2 release files

5.4.5

2 release files

5.4.4

2 release files

5.4.0

2 release files

4.1.0

2 release files

3.0.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

1.0.0

2 release files

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