import { useState } from 'react' import { Copy, Check, Code2, Shield } from 'lucide-react' const TABS = [ { id: 'wrapper', label: '[TOOL GUARD DECORATOR (PYTHON)]', filename: 'agent_tool_guard.py', code: `from btp_guard import Guard # Initialize guard with spend cap and retry dampening guard = Guard(spend_cap=100.0, max_retries=5) # Protect tool execution functions (Bash, SQL, Payments) @guard.protect def execute_sql_query(query: str): # Blocked before DB execution if query contains DROP TABLE or schema corruption return db.execute(query) @guard.protect def execute_shell_command(command: str): # Enforces hermetic sandbox scoping and blocks destructive commands return run_in_sandbox(command)`, lang: 'python', }, { id: 'frost', label: '[SWARM FROST QUORUM (RFC 9591)]', filename: 'swarm_frost_cosigning.py', code: `from btp_guard.frost import frost_keygen, FrostSigner, FrostCoordinator # 1. Initialize (3-of-5) FROST threshold swarm keygens = frost_keygen(n=5, t=2) signers = [FrostSigner(kg) for kg in keygens] coordinator = FrostCoordinator(group_pubkey=keygens[0].group_pubkey, threshold=2) # 2. Round 1: Any 3 agents broadcast nonce commitments active_signers = signers[:3] commitments = [s.round1_commit() for s in active_signers] # 3. Round 2: Generate partial Schnorr signatures on tool action payload = b'{"action":"DROP_TABLE","authorized":false}' partial_sigs = [s.round2_sign(payload, commitments) for s in active_signers] # 4. Aggregation: Produce unified Schnorr signature sigma=(R, z) frost_sig = coordinator.aggregate_signature(payload, commitments, partial_sigs) assert frost_sig.verify() is True # Valid against swarm group pubkey!`, lang: 'python', }, { id: 'langchain', label: '[LANGCHAIN & CREWAI PLUGIN]', filename: 'langchain_guard_handler.py', code: `from btp_guard import Guard from langchain.agents import initialize_agent # Attach BTP invariant guard to agent tool calls guard = Guard(spend_cap=200.0, max_retries=6) # Direct tool check before execution def on_agent_action(action): result = guard.check(action.tool_input, amount_usd=5.0) if not result["allowed"]: raise PermissionError(result["reason"]) return execute_tool(action.tool, action.tool_input)`, lang: 'python', }, { id: 'typescript', label: '[TYPESCRIPT / NODE.JS SDK]', filename: 'agent_evaluator.ts', code: `import { BartholomewTrustAuthority } from '@bartholomew/btp-guard'; const authority = new BartholomewTrustAuthority(); // Evaluate agent tool call in caller memory const { allowed, reason, signature } = authority.evaluateIntent({ agentId: 'worker-01', actionType: 'EXECUTE_TOOL', payload: { command: 'git status' } });`, lang: 'typescript', }, { id: 'go', label: '[GO INVARIANT ENGINE]', filename: 'main.go', code: `package main import ( "fmt" "github.com/ivegotahunnitonit/bartholomew/sdk_go/btp" ) func main() { authority := btp.NewBartholomewTrustAuthority(300) receipt, err := authority.EvaluateIntent("agent_go", "EXEC_TOOL", map[string]any{"cmd": "ls"}) if err == nil { fmt.Printf("BTP Ed25519 Signature: %s\\n", receipt.Signature) } }`, lang: 'go', }, ] function CopyButton({ text }: { text: string }) { const [copied, setCopied] = useState(false) const handleCopy = () => { navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } return ( ) } export default function SDK() { const [activeTab, setActiveTab] = useState(TABS[0].id) const current = TABS.find((t) => t.id === activeTab) || TABS[0] return (
{/* Top ambient glowing accent line */}
{/* Background glow accents */}
[ IN-PROCESS TOOL EXECUTION GATING ]

Protect Agent Tool Execution in 3 Lines

Bartholomew gates tool execution directly in application memory. Intercepts bash, SQL, and API payloads before they execute on your host or database.

{/* Tab Buttons */}
{TABS.map((tab) => ( ))}
{/* Code Box */}
{current.filename}
            {current.code}
          
) }