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

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.17
File Size Uploaded
btp_guard-5.4.17.tar.gz 923.8 kB Details

Built distribution (wheel)

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

Total release size: 1.9 MB

Release files / btp_guard-5.4.17.tar.gz

Download URL btp_guard-5.4.17.tar.gz
Size 923.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2f4f9b06cc54f348b1dfacc1693bb451f6cdc7554d5398d3fd8f85c4767e833f
BLAKE2b-256 checksum
How to use checksums
b80dabf1dd2070b8d0a96104acfd1ce6757a68fbe9f8525a086f35a966d6209c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

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

Download URL btp_guard-5.4.17-py3-none-any.whl
Size 954.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
590cccbefaf9853c75169c8128312c748f8b760654f5f584cf18cd810cfb3687
BLAKE2b-256 checksum
How to use checksums
041562027a98910fcd9158f19fc73414d666e5fdc44a41e29472b73f94333e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

5.4.21

2 release files

5.4.20

2 release files

5.4.19

2 release files

This release

5.4.17 This release

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