AI Agent Integration
The BRO Oracle is designed for autonomous agents. Structured responses, MCP-native tooling, and machine-readable risk verdicts enable agents to make security-informed decisions without human review.
Built for Agents First
Every response includes machine-readable risk verdicts (strong/moderate/weak/critical) -- no parsing needed.
First-class MCP server. Drop into Claude Code, Cursor, or any MCP-compatible agent with one config line.
Protocol IDs are keccak256 hashes of slugs -- agents can compute them locally without lookup calls.
MCP Server (Recommended)
The fastest path for AI agents. Add to your project's .mcp.json:
{
"mcpServers": {
"bro-oracle": {
"command": "npx",
"args": ["@blackhart/bro-mcp"],
"env": {
"BRO_API_KEY": "your-key-here"
}
}
}
}Tool Schema
Each MCP tool exposes a typed JSON Schema input. Agents can discover tools dynamically:
{
"name": "bro_get_score",
"description": "Get the BlackHart Risk Index (BRI) score for a DeFi protocol",
"inputSchema": {
"type": "object",
"properties": {
"slug": {
"type": "string",
"description": "Protocol identifier (e.g., 'uniswap-v4', 'aave-v3', 'sky')"
}
},
"required": ["slug"]
}
}Programmatic Agent Usage
For custom agents built with the MCP SDK:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "npx",
args: ["@blackhart/bro-mcp"],
env: { BRO_API_KEY: process.env.BRO_API_KEY },
});
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);
// Get score for a protocol
const result = await client.callTool({
name: "bro_get_score",
arguments: { slug: "aave-v3" },
});
// Use in risk decision
const score = JSON.parse(result.content[0].text);
if (score.bri < 650) {
console.log("Protocol below risk threshold — skipping");
}Agent-Optimized Responses
Every API response includes pre-computed verdicts and staleness checks so agents don't need to implement threshold logic:
{
"slug": "aave-v3",
"bri": 934,
"forge_scale": "MITHRIL",
"forge_scale_num": 6,
"risk_acceptable": true,
"dimensions": {
"access_control": { "score": 90, "weight": 18, "verdict": "strong" },
"economic_soundness": { "score": 91, "weight": 13, "verdict": "strong" },
"oracle_integrity": { "score": 88, "weight": 13, "verdict": "strong" },
"compositional_risk": { "score": 85, "weight": 10, "verdict": "strong" },
"governance": { "score": 92, "weight": 10, "verdict": "strong" },
"maturity": { "score": 95, "weight": 12, "verdict": "strong" },
"adversarial_resilience": { "score": 100, "weight": 10, "verdict": "strong" },
"supply_chain": { "score": 90, "weight": 4, "verdict": "strong" },
"opsec": { "score": 85, "weight": 10, "verdict": "strong" }
},
"staleness": {
"updated_at": "2026-05-04T14:00:00Z",
"age_seconds": 3600,
"is_stale": false,
"max_age_seconds": 86400
},
"evidence": {
"ipfs_hash": "QmX7b2...",
"methodology_version": "2.0"
}
}OpenAPI Spec
For agents using function-calling or tool-use with OpenAPI schemas:
openapi: "3.1.0"
info:
title: BlackHart Risk Oracle API
version: "1.0"
servers:
- url: https://oracle.blackhart.io/api/v1
paths:
/scores/{slug}:
get:
operationId: getProtocolScore
summary: Get BRI score and all dimensions for a protocol
parameters:
- name: slug
in: path
required: true
schema:
type: string
responses:
"200":
description: Protocol score
content:
application/json:
schema:
$ref: "#/components/schemas/Score"Agent Use Cases
Gate transactions on risk scores before swapping, lending, or providing liquidity. Reject protocols below a BRI threshold.
Monitor score changes via WebSocket. Trigger rebalance when a held protocol drops below DAMASCUS.
Automatically assess new protocols before integration. Compare dimensions against your risk policy.
Subscribe to score change events. Page humans when a protocol's BRI drops by more than 50 points.
Filter yield opportunities by risk. Only route to protocols rated MITHRIL or above.
Inform DAO governance votes with risk data. Flag proposals that integrate low-rated protocols.
Agent Decision Framework
Always check staleness first. A stale score should be treated as unknown risk, not the last known value.
Use dimension scores for nuanced decisions. A protocol with high overall BRI but low oracle score may still be risky for oracle-dependent operations.
Batch reads save latency. When evaluating multiple protocols, use batchGetScores() or the batch API endpoint.
Cache locally, validate freshness. Cache scores for up to 1 hour, but always verify staleness before high-value decisions.