Bartholomew Developer Documentation

Deterministic sub-35µs AST invariant verification, credential scrubbing, and eBPF kernel process sandboxing for autonomous AI agent swarms.

1-Line Installation & Setup

Install Bartholomew across any environment in seconds with zero configuration required:

curl -fsSL https://bartholomew.info/install.sh | bash
irm https://bartholomew.info/install.ps1 | iex
pip install --upgrade btp-guard
npm install btp-guard
brew tap ivegotahunnitonit/bartholomew && brew install btp-guard
Instant Verification: After installing, test your local invariant gate with btp-guard try. It runs a live AST safety simulation in under 3 seconds.

Python: protect_agent(agent)

Wrap any autonomous agent (CrewAI, LangChain, AutoGen, or custom) in a single line of code. All agent tools and lifecycle methods are automatically shielded:

from crewai import Agent
from btp_guard import protect_agent

# 1. Instantiate any CrewAI agent
raw_agent = Agent(
    role="Fintech Ops Analyst",
    goal="Query database and execute verified transaction settlements",
    tools=[db_query_tool, bash_runner_tool]
)

# 2. Wrap in 1 line:
agent = protect_agent(raw_agent, spend_cap=50.0, strict=True)

# Gated execution: secrets auto-scrubbed, catastrophic commands blocked in <35µs
result = agent.execute_task("Analyze monthly invoices and query balance")
from langchain.agents import create_react_agent
from btp_guard import protect_agent

raw_agent = create_react_agent(llm, tools)

# 1-Line Universal Protection:
agent = protect_agent(raw_agent, spend_cap=25.0)

# Destructive shell actions (rm -rf, DROP TABLE) return self-correction feedback
response = agent.invoke({"input": "Perform system maintenance on /var/log"})
from btp_guard import protect_agent

class AutonomousDevBot:
    def __init__(self):
        self.tools = [execute_sql, run_shell]
    def run(self, prompt: str) -> str:
        return f"Executing {prompt}"

bot = protect_agent(AutonomousDevBot(), spend_cap=100.0)
bot.run("SELECT id FROM users")  # Allowed
bot.run("rm -rf /")             # Blocked with [BLOCKED BY BARTHOLOMEW] feedback
ParameterTypeDefaultDescription
agentObjectRequiredAny agent instance containing lifecycle methods or a tools list.
spend_capfloat50.0Cumulative dollar limit for billable tool executions.
strictboolTrueIf true, destructive invariant violations raise exceptions; if false, emits LLM feedback strings.

TypeScript: protectAgent(agent)

Full parity for Node.js, Vercel AI SDK, Mastra, and LangChain.js agents:

import { protectAgent } from 'btp-guard';

const agent = protectAgent(myLangChainAgent, {
  spendCap: 50.0,
  strict: true
});

// All tool calls and prompt dispatches evaluated in <35µs
const output = await agent.invoke({ input: "Analyze accounts" });
import { protectAgent } from 'btp-guard';

const customWorker = {
  name: 'DataPipelineWorker',
  tools: [sqlQueryTool, fileWriteTool],
  async run(prompt) { return `Done: ${prompt}`; }
};

const safeWorker = protectAgent(customWorker);
await safeWorker.run("Sync customer balances"); // Allowed

btp-guard run (Process Sandbox)

Execute any arbitrary command or subagent process under Bartholomew's dual-layer AST invariant check and eBPF syscall monitor:

# Safe command execution with cryptographic Merkle receipt:
btp-guard run -- python agent.py

# Destructive attacks are intercepted before kernel execve:
btp-guard run -- rm -rf /
# Output: [!] EXECUTION BLOCKED BY BARTHOLOMEW GATE (Exit code 126)
# Run any untrusted agent inside hardened non-root container sandbox:
docker run --rm -v $(pwd):/workspace bartholomew-sandbox python agent.py

Model Context Protocol (MCP) Security

Audit and sign your MCP servers for Claude Desktop, Cursor, and Windsurf:

# Audit local or remote MCP server and generate cryptographic seal:
btp-guard verify-mcp --url http://localhost:8000/sse

# Install Bartholomew MCP Proxy for Claude Desktop & Cursor:
btp-guard mcp install
{
  "mcpServers": {
    "bartholomew-guard": {
      "command": "btp-guard",
      "args": ["mcp", "start", "--port", "8000"]
    }
  }
}

Cryptographic Verification

Every execution produces an RFC 8785 Ed25519 digital signature verifiable completely offline with zero network connection:

# Verify any BTP execution receipt offline:
btp-guard verify-offline --receipt receipt.json
# Export auditor-ready SOC 2 Type II & EU AI Act compliance dossier:
btp-guard export-compliance --out soc2_dossier.json