Build With Bouclier _

Developers

Integrate policy-enforced guardrails into any autonomous agent. SDKs, code samples, and framework-specific guides.

Early Development Phase

SDKs are under active development in the monorepo. The API surface shown below represents the intended design — interfaces may change before the stable release.

5-Minute Integration
01

Clone

Clone the monorepo and build the SDK

02

Deploy

Deploy registry + policies to Base Sepolia

03

Register

Register your agent with policy bindings

04

Validate

Wrap agent actions with validate() calls

Terminal — Full Setupbash
# Clone the monorepo
git clone https://github.com/incyashraj/bouclier.git && cd bouclier

# Install & build
npm install && cd contracts && forge build && cd ../sdk && npm run build

# Deploy to Base Sepolia (set PRIVATE_KEY and BASE_SEPOLIA_RPC)
cd ../contracts
forge script script/DeployRegistry.s.sol --rpc-url $BASE_SEPOLIA_RPC --private-key $PRIVATE_KEY --broadcast

# Run tests
forge test -vvv
Framework Integrations
LangChainWrap any LangChain agent tool with Bouclier policy validation before execution.
langchain-integrationtypescript
import { BouclierClient } from "@bouclier/sdk";
import { DynamicTool } from "langchain/tools";

const bouclier = new BouclierClient({ /* config */ });

// Wrap a tool with Bouclier validation
const safeTool = new DynamicTool({
  name: "safe-transfer",
  description: "Transfer tokens with policy enforcement",
  func: async (input) => {
    const action = parseTransferInput(input);
    
    // Validate against all attached policies
    const check = await bouclier.validate({
      agentId: AGENT_ID,
      target: action.contract,
      value: action.value,
      data: action.calldata,
    });
    
    if (!check.valid) {
      return `Blocked: ${check.reason}`;
    }
    
    return await executeTransfer(action);
  },
});
AutoGPT / Custom AgentsAdd a pre-execution hook to any agent loop — validate every outbound transaction.
autogpt---custom-agents-integrationtypescript
import { BouclierClient } from "@bouclier/sdk";

const bouclier = new BouclierClient({ /* config */ });

// Agent execution loop
async function agentStep(agentId, action) {
  // 1. Validate before execution
  const result = await bouclier.validate({
    agentId,
    target: action.to,
    value: action.value,
    data: action.data,
  });

  if (!result.valid) {
    console.error("Policy blocked:", result.reason);
    return { success: false, reason: result.reason };
  }

  // 2. Execute the validated action
  const tx = await wallet.sendTransaction(action);
  return { success: true, hash: tx.hash };
}
Python (AI/ML Pipelines)Call the Bouclier registry directly from Python using web3.py for ML agent pipelines.
python--ai-ml-pipelines--integrationpython
from web3 import Web3

w3 = Web3(Web3.HTTPProvider("https://sepolia.base.org"))

# Load the registry contract
registry = w3.eth.contract(
    address="0x...RegistryAddress",
    abi=REGISTRY_ABI,
)

# Check if an agent is active
is_active = registry.functions.isActive(agent_id).call()

# Get attached policies
policies = registry.functions.getPolicies(agent_id).call()

# Validate via policy contract directly
policy = w3.eth.contract(address=policies[0], abi=POLICY_ABI)
is_valid = policy.functions.validate(
    agent_id, target, value, calldata
).call()
SDK Packages
@bouclier/sdkTypeScript
In Development

Core SDK for registering agents, attaching policies, and querying the registry. Built on viem.

View source
@bouclier/reactReact
Planned

React hooks — useBouclier(), useAgent(), usePolicy(). Built on wagmi + the core SDK.

View source
bouclier-rsRust
Planned

Native Rust client for sentinel nodes and high-performance contract interaction.

View source
bouclier-pyPython
Planned

Python bindings for AI/ML pipelines. Integrates with web3.py for direct contract calls.

View source
Design Patterns

Pre-Execution Hook

Validate every agent action before it hits the mempool. Block invalid transactions at the SDK layer.

Composable Policies

Stack multiple policy contracts per agent. Transfer limits + scope restrictions + rate limiters — all enforced together.

Framework Agnostic

Works with LangChain, AutoGPT, CrewAI, or any custom agent. One validate() call wraps any outbound action.

Start Building

Clone the repo, check the docs, and ship your first policy-enforced agent.

[SYS] BOUCLIER.ETH v0.1.0-alpha