Skip to main content

Bartholomew — BTP v5.4.10

In-Process AI Agent Execution Gateway — sub-35µs AST gating, secret scrubbing, and tamper-evident audit receipts for autonomous agent runtimes.

CI PyPI npm Cloud Console Pricing License: MIT Tests


What it does

Traditional guardrails operate on prompt text — they are blind to what happens when an autonomous agent invokes real-world tools. Bartholomew closes that gap by sitting inside the agent's memory space, inspecting raw tool arguments and AST syntax trees in under 35 microseconds before actions reach the OS, a database, or an external API.

Prompt rails (NeMo, Guardrails AI)   ~80–2500ms  ─┐
                                                    ├─ BLIND SPOT
Bartholomew in-process gate          <35µs       ──┤  ← fills here
                                                    │
OS / container boundary (Docker)     kernel-level ──┘

What it blocks:

  • Destructive shell commands (rm -rf, mkfs, dd)
  • Destructive SQL mutations (DROP TABLE, TRUNCATE)
  • Credential exfiltration (sk-*, ghp_*, AKIA*) in thought logs or tool args
  • Runaway token spend loops beyond configured USD caps
  • Prompt-injection-driven tool hijacks across multi-agent swarms

Install

# Python
pip install btp-guard

# Node.js / MCP
npx btp-guard init

Requirements: Python ≥ 3.10 · No mandatory cloud dependency · Works fully offline


Quickstart

Python — decorator guard

from btp_guard import Guard, BTPViolationError

guard = Guard(spend_cap_usd=50.0, max_retries=5)

@guard.protect
def execute_query(sql: str):
    return db.execute(sql)

try:
    execute_query("DROP TABLE accounts;")
except BTPViolationError as e:
    print(e.to_diagnostics())
    # {"status": "BLOCKED", "rule_id": "BTP-SQL-001",
    #  "reason": "Destructive SQL mutation detected", "latency_us": 18.4}

Python — inline check

from btp_guard import Guard

guard = Guard()
result = guard.check("rm -rf /var/data")
# {"allowed": False, "reason": "[BTP-AST-001] Destructive filesystem pattern"}

TypeScript / Node.js

import { BTPGuard } from 'btp-guard';

const guard = new BTPGuard();
const receipt = guard.evaluateAction({
  agentId: 'worker-1',
  actionType: 'DATABASE_MUTATION',
  payload: { query: 'DROP TABLE users;' }
});
// receipt.verdict === "DENY"  (blocked in ~11µs, Merkle receipt attached)

MCP — Claude Desktop, Cursor, Windsurf

# Starts the BTP stdio/SSE proxy — all tool calls pass through it
python -m src.mcp_server

Config examples for each IDE are in examples/ides/.

GitHub Actions

- name: BTP Security Gate
  uses: ivegotahunnitonit/bartholomew@v5.4.10
  with:
    fail-on-violation: "true"
    generate-compliance-pack: "true"

Editions & Cloud Console

Bartholomew is fully open-source and offline for local developer workflows. For engineering teams deploying multi-agent swarms in production, the Cloud Console provides centralized fleet monitoring, instant threat alerts, and automated compliance reports:

Edition Pricing Ideal For Core Capabilities
Community (OSS) Free Forever Solo Devs & Local Scripts In-process sub-35µs AST gate, offline Ed25519 receipts, secret scrubber, MIT license
Pro / Team $49 / month Startups & Engineering Teams Cloud Telemetry Dashboard, instant Slack/Discord threat alerts, fleet API keys, policy sync
Enterprise $199 / month Scale-ups, FinTech & Healthcare Continuous 1-click SOC 2 Type II evidence bundles, multi-tenant workspace isolation, dedicated CISO ledger, priority SLA

👉 Get Started & Upgrade:


Architecture

cmd/bartholomew/          # Go CLI entry point
src/
  btp_guard/              # Core Python guard engine
  framework_adapters/     # LangChain, LangGraph, AutoGen, CrewAI wrappers
  bartholomew_eval/       # Bayesian risk engine & AST fuzzer
  mcp_server/             # MCP stdio/SSE gateway
  go_services/            # High-throughput Go verifier service
  rust_verifier/          # Sub-5µs Rust fast-path (experimental)
  daemon/                 # Background approval queue & tray manager
  ebpf/                   # eBPF kernel-level syscall hooks (Linux)
examples/                 # Integration recipes (already_built, being_built, future_swarms, ides)
packages/                 # SDKs: pypi_package, npm_package, sdk_go, sdk_rust, sdk_typescript, vscode-extension
deploy/                   # Docker, K8s, Terraform, CDK, GCP, Helm, Systemd
tests/                    # 2,837-test suite (pytest -o 'pythonpath=src .')
docs/                     # Specs: threat-model.md, btp-protocol-spec.md, quickstart.md

Framework adapters

Framework Import
LangChain from src.framework_adapters.langchain_guard import BTPLangChainGuard
LangGraph from src.framework_adapters.langgraph_guard import BTPLangGraphGuard
AutoGen from src.framework_adapters.autogen_guard import BTPAutoGenGuard
CrewAI from src.framework_adapters.crewai_guard import BTPCrewAIGuard
Semantic Kernel from src.framework_adapters.semantic_kernel_guard import BTPSemanticKernelGuard
Raw OpenAI from src.framework_adapters.universal import UniversalBTPModelGuard
Raw Anthropic from src.framework_adapters.universal import UniversalBTPModelGuard

Full recipes in examples/.


Defense layers

Bartholomew is Layer 2 in a standard defense-in-depth stack:

Layer Tool Latency Scope
1 — Prompt rails NeMo, Guardrails AI, LlamaGuard 80–2500ms Prompt & completion text
2 — Execution gate Bartholomew BTP <35µs Raw tool args, AST, secrets, spend
3 — OS sandbox Docker, gVisor, E2B kernel Syscall interception

Audit & compliance

Generate a tamper-evident SOC 2 Type II evidence pack:

python scripts/audit_firm_ledger.py

Output: docs/audit/ — SHA-256 Merkle receipt JSON + auditor markdown summary.
Controls satisfied: AICPA CC6.1, CC6.6, CC7.1, CC7.2 · ISO 27001:2022 A.8.8, A.8.30.


Development

# Clone & install in editable mode
git clone https://github.com/ivegotahunnitonit/bartholomew.git
cd bartholomew
pip install -e ".[test]"

# Run the full test suite
pytest tests/ -o "pythonpath=src ." -q

# Lint
pip install ruff && ruff check src/ tests/

Documentation


© 2026 Bartholomew AI & Contributors. MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

btp_guard-5.4.11.tar.gz (885.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

btp_guard-5.4.11-py3-none-any.whl (904.4 kB view details)

Uploaded Python 3

File details

Details for the file btp_guard-5.4.11.tar.gz.

File metadata

  • Download URL: btp_guard-5.4.11.tar.gz
  • Upload date:
  • Size: 885.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for btp_guard-5.4.11.tar.gz
Algorithm Hash digest
SHA256 dc954bc90c8c96a1ca01ec2e85eb00bfdff84b4df480ed2aea31c4dd43d45815
MD5 c4317879fcb90611ec3602b1a76e0ac5
BLAKE2b-256 1e07f83bac9e453c9953345fd3f63605b14de0c6cee8e1508636a3cd779f25a7

See more details on using hashes here.

File details

Details for the file btp_guard-5.4.11-py3-none-any.whl.

File metadata

  • Download URL: btp_guard-5.4.11-py3-none-any.whl
  • Upload date:
  • Size: 904.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for btp_guard-5.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf33a8f2a0442d93354d03c5cbcb09d0616ada56544f3b1b8bac8d28946a9bf
MD5 dc8a1b2e4279962cd695d3ed2cbe637e
BLAKE2b-256 0278007666c315eddb762f73ee3854b4e526c6540b846d27f6efe16ab1d2af78

See more details on using hashes here.

Release history Release notifications | RSS feed

5.4.14

2 files

5.4.13

2 files

5.4.12

2 files

This release

5.4.11 This release

2 files

5.4.10

2 files

5.4.8

2 files

5.4.7

2 files

5.4.6

2 files

5.4.5

2 files

5.4.4

2 files

5.4.0

2 files

4.1.0

2 files

3.0.0

2 files

2.4.0

2 files

2.3.0

2 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