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.
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:
- Pro Edition ($49/mo): Direct Stripe Checkout
- Enterprise Edition ($199/mo): Direct Stripe Checkout
- CLI Activation: Run
npx btp-guard activate <key>orbtp-guard pricing - Pricing & Storefront: https://bartholomew.info/pricing
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 & Frontier Partner Adapters
| Frontier Partner / Swarm | Integration Guard | Recipe Path |
|---|---|---|
| Google Gemini 3.8 Ultra | @btp_gemini_38_tool() / Thought Scratchpad Gate |
examples/being_built/google_gemini38_guard.py |
| Anthropic Claude 3.7 Sonnet | Claude37ToolGuard / Hybrid Thinking Interceptor |
examples/being_built/anthropic_claude37_guard.py |
| GPT-Astra / OpenAI Agents SDK | OpenAIToolGuard / Dynamic Schema Verifier |
examples/being_built/openai_agents_sdk_guard.py |
| Cloudflare Workers AI & Agents | Sub-50µs Edge AST Gate & KV Replay Defense | examples/future_swarms/cloudflare_edge_agent_guard.ts |
| Microsoft AutoGen Swarm | @btp_autogen_guard / Consensus Quorum & AWU Barter |
examples/future_swarms/autogen_swarm_consensus.py |
| GitHub Copilot / Cursor / Windsurf | MCP Stdio Proxy / .cursorrules / .mdc Sentry |
examples/ides/ & mcp_server.py |
| Universal Swarm (A2A) | UniversalSwarmDelegator (Ed25519 + L402 Rails) |
examples/future_swarms/universal_swarm_delegation.py |
Full documentation and quickstarts in the Master Cookbook.
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
docs/quickstart.md— full setup guidedocs/threat-model.md— threat model & security boundariesdocs/btp-protocol-spec.md— BTP wire protocol specificationdocs/cookbook.md— all integration recipesSECURITY.md— vulnerability disclosure policyCONTRIBUTING.md— contributing guide
© 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file btp_guard-5.4.12.tar.gz.
File metadata
- Download URL: btp_guard-5.4.12.tar.gz
- Upload date:
- Size: 875.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c0d84b5ee3888d5e657579f94aebc049656408e94ffe6fa8cc219a8fe1332dd
|
|
| MD5 |
82aa87131022c4e97c8719bdce6118b2
|
|
| BLAKE2b-256 |
7bbeed4fcf7dd20cf6f082a815cee98a8c508783affd29cc8b93d6f4b6bfe31f
|
File details
Details for the file btp_guard-5.4.12-py3-none-any.whl.
File metadata
- Download URL: btp_guard-5.4.12-py3-none-any.whl
- Upload date:
- Size: 906.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65e34a1b2c1bd954b58941d602e5e6d3c8519d2c2d00e4ed656a255518175e65
|
|
| MD5 |
b514d7c43b9ab6741c5614c842ee1102
|
|
| BLAKE2b-256 |
02286a0a2128aae78a892f315447fb6c62c2c4f94c1f0adcab9084974a690fdb
|