Building Trustworthy AI Agents: ERC-8004 Onchain Reputation System
AI agents need reputation systems to operate safely in economic environments, but traditional web2 ratings are siloed and gameable. ERC-8004 brings onchain reputation to AI agents, creating a trustless system where autonomous agents can build and verify their track record across protocols. WAIaaS implements the complete ERC-8004 specification, letting you deploy agents with verifiable onchain reputation from day one.
Why Onchain Reputation Matters for AI Agents
As AI agents become economic actors — trading tokens, providing services, managing DeFi positions — we need systems to evaluate their trustworthiness. A trading agent with a proven track record should command higher trust than a newly deployed agent with no history.
Traditional reputation systems fail in multi-agent environments. Centralized ratings are platform-locked. An agent's stellar performance on one protocol doesn't transfer to another. Worse, these systems are vulnerable to manipulation through fake reviews or wash trading.
ERC-8004 solves this by moving reputation onchain. When an agent completes actions, other protocols can attest to their performance directly on the blockchain. This creates a portable, tamper-proof reputation score that follows the agent across all protocols and applications.
ERC-8004: Trustless Agents Standard
ERC-8004 defines how AI agents register, accumulate reputation, and prove their identity onchain. The standard includes three core components:
Agent Registration: Each agent gets a unique onchain identity tied to their wallet address. This prevents agents from abandoning bad reputations and starting fresh with new addresses.
Attestation System: Protocols can submit positive or negative attestations about an agent's performance. These attestations are weighted based on the attester's own reputation, preventing spam attacks.
Validation Queries: Any protocol can query an agent's reputation score, validation status, and attestation history before allowing the agent to participate.
WAIaaS provides 15 DeFi protocol providers integrated with this reputation system. When your agent trades on Jupiter, lends on Aave, or provides liquidity on Kamino, these actions can generate reputation attestations automatically.
How WAIaaS Implements ERC-8004
WAIaaS includes a complete ERC-8004 provider that handles agent registration, attestation management, and reputation queries. Here's how to register an agent and start building onchain reputation:
# Register your agent onchain
curl -X POST http://127.0.0.1:3100/v1/actions/erc8004/register \
-H "Content-Type: application/json" \
-H "Authorization: Bearer wai_sess_<token>" \
-d '{
"agentName": "trading-bot-v2",
"agentType": "TRADING",
"metadata": {
"description": "Automated arbitrage trader",
"version": "2.1.0",
"strategies": ["arbitrage", "market-making"]
}
}'
The registration creates an onchain record linking your agent's wallet address to its identity and capabilities. Other protocols can now track this agent's performance and submit attestations.
To check an agent's current reputation:
# Get agent reputation data
curl http://127.0.0.1:3100/v1/actions/erc8004/reputation/<agent-address> \
-H "Authorization: Bearer wai_sess_<token>"
This returns the agent's reputation score, validation status, total attestations, and performance metrics across different categories.
Policy Integration: Reputation-Based Access Control
WAIaaS policy engine includes REPUTATION_THRESHOLD policies that restrict actions based on onchain reputation scores. This lets you create agent hierarchies where higher-reputation agents get more privileges:
# Create reputation-based policy
curl -X POST http://127.0.0.1:3100/v1/policies \
-H "Content-Type: application/json" \
-H "X-Master-Password: my-secret-password" \
-d '{
"walletId": "<wallet-uuid>",
"type": "REPUTATION_THRESHOLD",
"rules": {
"minimum_score": 750,
"required_attestations": 10,
"max_negative_ratio": 0.1
}
}'
This policy blocks actions unless the agent has a reputation score above 750, at least 10 attestations, and negative attestations below 10% of total attestations. You can use different thresholds for different action types — requiring higher reputation for large trades but allowing smaller operations for newer agents.
Building Multi-Agent Systems with Reputation
ERC-8004's power emerges when multiple agents interact. Here's a pattern for creating agent hierarchies:
Supervisor Agent: High-reputation agent that coordinates strategy and risk management. Has broad permissions and can approve actions by subordinate agents.
Specialist Agents: Medium-reputation agents focused on specific tasks (arbitrage, yield farming, NFT trading). Can execute actions within their specialty but require supervisor approval for cross-domain operations.
Scout Agents: Low-reputation agents that gather market data and identify opportunities. Cannot execute trades but can submit recommendations to specialist agents.
The MCP integration makes this pattern natural. Each agent gets its own MCP server instance with different reputation thresholds and policy configurations:
{
"mcpServers": {
"supervisor-agent": {
"command": "npx",
"args": ["-y", "@waiaas/mcp"],
"env": {
"WAIAAS_AGENT_ID": "019c47d6-51ef-7f43-a76b-d50e875d95f4",
"WAIAAS_AGENT_NAME": "supervisor"
}
},
"arbitrage-specialist": {
"command": "npx",
"args": ["-y", "@waiaas/mcp"],
"env": {
"WAIAAS_AGENT_ID": "019c4cd2-86e8-758f-a61e-9c560307c788",
"WAIAAS_AGENT_NAME": "arbitrage-bot"
}
}
}
}
The supervisor can query subordinate agents' reputation and performance before delegating tasks or approving their proposed actions.
Real-Time Reputation Monitoring
WAIaaS provides MCP tools for agents to monitor their own reputation and respond to changes:
// Agent checks its own reputation before major actions
const reputation = await client.executeAction('erc8004', 'get-reputation', {
agentAddress: await client.getAddress()
});
if (reputation.score < 800) {
console.log('Reputation below threshold, reducing position sizes');
maxTradeSize = maxTradeSize * 0.5;
}
// Check if recent attestations indicate performance issues
const recentNegative = reputation.attestations
.filter(a => a.timestamp > Date.now() - 86400000) // Last 24h
.filter(a => a.score < 0);
if (recentNegative.length > 3) {
console.log('Multiple negative attestations, entering conservative mode');
pauseHighRiskStrategies();
}
This self-monitoring creates a feedback loop where agents automatically adjust their behavior based on reputation changes, reducing risk when their standing drops.
Cross-Protocol Reputation Portability
Unlike platform-specific ratings, ERC-8004 reputation follows agents across all protocols. An agent that performs well on Aave lending carries that reputation to Jupiter trading or Polymarket prediction markets.
This portability accelerates agent adoption. New protocols can bootstrap trust by accepting agents with strong reputation from other protocols, while agents can leverage their track record to access new opportunities immediately.
WAIaaS tracks attestations across all 15 integrated DeFi protocols, creating a unified reputation profile that reflects the agent's performance across lending, trading, staking, and prediction markets.
Quick Start: Deploy a Reputation-Enabled Agent
Here's how to launch an AI agent with onchain reputation in under 10 minutes:
Deploy WAIaaS:
docker run -d -p 3100:3100 ghcr.io/minhoyoo-iotrust/waiaas:latestCreate agent wallet:
waiaas wallet create --chain ethereum --name reputation-agentRegister agent onchain: Use the ERC-8004 provider to register your agent with its identity and capabilities
Configure reputation policies: Set minimum reputation thresholds for different action categories
Start building reputation: Execute small, low-risk actions to begin accumulating positive attestations
Your agent now has verifiable onchain identity and can begin building reputation across protocols. As it performs successful actions, other protocols will attest to its performance, gradually increasing its trustworthiness and access to higher-value opportunities.
The key insight is starting with conservative actions to build initial reputation, then expanding capabilities as trust increases. This mirrors how humans build professional reputations — proving competence in small tasks before being trusted with larger responsibilities.
Looking ahead, onchain reputation systems like ERC-8004 will become critical infrastructure as AI agents become more autonomous and economically active. The agents that establish strong reputations early will have significant advantages in accessing protocols, securing favorable terms, and participating in high-value opportunities.
Ready to build trustworthy AI agents with onchain reputation? Start with the WAIaaS repository or explore more at waiaas.ai.