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 VS Code Marketplace 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}`);
}

Cursor, Windsurf & MCP 1-Click Integration

Bartholomew provides deterministic execution firewalls and capability scoping directly inside Cursor, Windsurf, and Claude Code.

1. Cursor & Windsurf Rules (.cursorrules / .windsurfrules)

Drop the pre-configured .cursorrules into your project root to enforce AST boundary checks and block destructive terminal actions:

  • Blocks recursive directory deletion (rm -rf) and database destruction (DROP TABLE).
  • Masks .env, private keys (id_rsa, id_ed25519), and API secrets from LLM context.
  • Confines autonomous agent file mutations strictly to the active workspace.

2. Model Context Protocol (MCP) Server Setup

Add Bartholomew to your cursor.json, claude_desktop_config.json, or Windsurf MCP settings:

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

3. Native IDE Extensions

Install the in-process execution sentry directly from your IDE's marketplace:


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

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.20
File Size Uploaded
btp_guard-5.4.20.tar.gz 1.0 MB Details

Built distribution (wheel)

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

Total release size: 2.1 MB

Release files / btp_guard-5.4.20.tar.gz

Download URL btp_guard-5.4.20.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
42222a165fa45a1103af33f234d68d42029b5e2a3b071d4ab05034b0ec50882a
BLAKE2b-256 checksum
How to use checksums
4e99b515a9f6b19e9da1437312c54c819bbd9278e8ca9f5e394b9e5a53126b32
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.20-py3-none-any.whl

Download URL btp_guard-5.4.20-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
51edd5d0c447d544079362d4e518e16fa2ed340c9d0d35329392772b0d494f77
BLAKE2b-256 checksum
How to use checksums
4c130bdca7981876470a44f80797a1c0e703e427fd2f582056a2a3ac31b43f44
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

This release

5.4.20 This release

2 release files

5.4.19

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