Commit 6b50086
authored
feat: add agent identity verification tool (ERC-8004) (#19)
## Summary
Adds an agent identity and reputation verification tool using [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) on-chain identity registries.
As agents interact with other agents (delegating tasks, purchasing services, sharing data), they need a way to verify who they're dealing with before transacting. This tool provides that trust layer.
## Tools
**`verify_agent_identity`** — Full identity verification pipeline:
1. Queries the ERC-8004 registry for on-chain identity (ERC-721 token)
2. Checks reputation score against a configurable threshold
3. Verifies advertised capabilities match requirements
4. Detects revoked or expired identities
5. Returns a TRUST / REJECT / ERROR decision
**`lookup_agent_reputation`** — Detailed reputation lookup:
- Overall score and review counts
- Category-level scores (accuracy, reliability, speed, cost)
- Recent feedback entries with comments
## Pattern
Same structure as `x402_payment_tool`:
- `@register_function` with `FunctionBaseConfig` subclass
- `nat.components` entry point registration
- `react_agent` workflow config with NIM LLM
- Mock server for e2e testing without blockchain access
## Testing
Mock registry server includes 4 test agents:
| Agent | Status | Reputation |
|-------|--------|------------|
| `0x1234...5678` | Registered | 87.5/100 |
| `0xdead...beef` | Revoked | 12.0/100 |
| `0xaaaa...aaaa` | Expired | N/A |
| `0x0000...0000` | Not registered | N/A |
## Files
```
agent_identity_tool/
├── README.md
├── pyproject.toml
├── .gitignore
├── scripts/
│ └── mock_registry_server.py
└── src/nat_agent_identity/
├── __init__.py
├── register.py
└── configs/
└── identity-agent.example.yml
```
## CI
Pre-commit (yapf, ruff, uv-lock, markdown-link-check), Vale, and copyright checks all passing locally.
## Relationship to x402_payment_tool
Pairs with the x402 payment tool for trust-then-transact workflows: verify an agent's identity and reputation first, then pay for their service.
Authors:
- AI Agent Economy (https://github.com/up2itnow0822)
Approvers:
- Will Killian (https://github.com/willkill07)
URL: #191 parent f31dad6 commit 6b50086
8 files changed
Lines changed: 1047 additions & 0 deletions
File tree
- ci/vale/styles/config/vocabularies/nemo-agent-toolkit-examples
- examples/agent_identity_tool
- scripts
- src/nat_agent_identity
- configs
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments