Agent Integration
Build AI agents that check DeFi risk before making decisions.
AI agents making DeFi decisions should check risk before executing. Philidor provides the data layer for risk-aware autonomous agents.
Architecture
User Request → AI Agent → Philidor MCP/API → Risk Data → DecisionThe agent receives a request (e.g., "deposit USDC into highest-yield vault"), queries Philidor for risk scores, and makes an informed decision rather than optimizing purely for yield.
MCP Integration (Recommended)
The fastest path is connecting your agent to the MCP server:
claude mcp add philidor --transport http https://mcp.philidor.ioThe agent automatically gets access to 10 tools, 3 resources, and 3 prompts.
Example Agent Workflow
- User: "Find me the best USDC vault"
- Agent calls
search_vaultswithasset=USDC, sortBy=apr_net, sortOrder=desc - Agent calls
get_vault_risk_breakdownfor the top result - Agent checks if risk tier is acceptable (Prime or Core)
- Agent recommends the vault with risk context
REST API Integration
For agents that don't support MCP, use the REST API directly:
async function checkVaultRisk(network: string, address: string) {
const res = await fetch(`https://api.philidor.io/v1/vault/${network}/${address}`);
const { data } = await res.json();
const vault = data.vault;
return {
score: vault.total_score,
tier: vault.risk_tier,
isAudited: vault.is_audited,
isSafe: vault.total_score >= 8.0 && vault.is_audited,
};
}
// Agent decision logic
const risk = await checkVaultRisk('ethereum', '0x8eB67...');
if (!risk.isSafe) {
return "This vault doesn't meet the minimum safety threshold (Prime tier, audited).";
}Risk Guardrails
Agents should enforce risk guardrails before executing DeFi operations:
| Guardrail | Check | Threshold |
|---|---|---|
| Minimum risk tier | risk_tier | Prime or Core |
| Audit requirement | is_audited | Must be true |
| Minimum TVL | tvl_usd | > $1M |
| Oracle quality | Asset vector score | >= 7 |
| No recent incidents | Check events endpoint | No incidents in 90 days |
Portfolio-Level Checks
Before adding a new position, check portfolio concentration:
const positions = await fetch(`https://api.philidor.io/v1/address/${wallet}/positions`);
const { data } = await positions.json();
// Check if adding this vault would exceed protocol concentration
const protocolExposure = data.positions
.filter((p) => p.protocol_name === newVault.protocol_name)
.reduce((sum, p) => sum + parseFloat(p.balance_usd), 0);
const totalValue = parseFloat(data.summary.total_value_usd) + depositAmount;
const concentration = (protocolExposure + depositAmount) / totalValue;
if (concentration > 0.5) {
return 'Adding this position would exceed 50% concentration in one protocol.';
}Future: Agent-First DeFi
Philidor's roadmap prioritizes agent-first infrastructure:
- Structured risk data optimized for LLM consumption
- Real-time webhook notifications for risk tier changes
- Portfolio simulation endpoints (proposed allocation → projected risk)
- Agent authentication for personalized risk policies