The AI-to-AI Protocol Layer that catches unreliable agent outputs before they cost you money. Claim-level verification, escrow, and slashing. 224 tests, 12/12 adversarial patterns caught.
nexus is an early-stage Python project in the AI payments / x402 ecosystem, focused on a2a, agent-to-agent, agent-verification, ai. It currently has 2 GitHub stars and 0 forks, and sits alongside related tools like capiscio-mcp-python, tap, capiscio-sdk-python, capiscio-python, Sae, awesome-agent-protocols.
The verification layer for AI agent networks. A2A and IATP prove agents are who they say they are. Nexus checks if they're telling the truth.
Today's agent protocols verify the sender and the delivery. None of them verify the answer.
But Agent B can return a cryptographically-signed, schema-valid, on-time response that is factually wrong — and every layer above passes it through. Partial cheaters, style mimics, semantic swaps, coordinated collusion: all defeat identity-based trust because they aren't lying about who they are. They're lying about what they know.
Nexus is the missing verdict. Claim-level semantic verification that runs over A2A, IATP, or standalone. Verified outputs settle escrow. Failed verifications slash trust. Every step is audited.
A2A is the right transport. Nexus is the verdict on top.
| Layer | A2A / IATP | PayCrow / ERC-8004 / Nava | Nexus |
|---|---|---|---|
| Sender authenticity | ✅ Signed Agent Cards | — | (delegated to A2A) |
| Identity reputation | ✅ Trust score 0-1000 | — | (delegated to IATP) |
| Delivery / schema match | — | ✅ Smart-contract escrow | (delegated) |
| Content correctness | ❌ | ❌ | ✅ Claim-level verification |
| Adversarial test coverage | Identity attacks | Replay / non-delivery | 12/12 caught: partial cheat, style mimic, omission, collusion, meaning swap, negation, context shift |
Use A2A for who and whether. Use Nexus for what.
One script shows the entire story:
git clone https://github.com/timmeck/nexus.git
cd nexus
pip install -r requirements.txt
python demo_cheat.py
What happens:
We ran 4 rounds of adversarial testing against the verification system. Every round exposed weaknesses, every weakness was fixed and regression-tested.
| Adversarial Pattern | Verdict | Score | Result |
|---|---|---|---|
| Baseline (2 honest agents) | PASS | 100% | Correct |
| Dumb Liar (obvious garbage, high confidence) | FAIL | 100% | CAUGHT |
| Plausible Liar (correct format, wrong facts) | FAIL | 65% | CAUGHT |
| Partial Cheater (80% correct, wrong penalties) | FAIL | 82% | CAUGHT |
| Style Mimic (exact format, EU->US, euros->dollars) | FAIL | 66% | CAUGHT |
| Lazy Agent (generic fluff, no data) | FAIL | 100% | CAUGHT |
| Confidence Gamer (99% confidence, vague output) | FAIL | 86% | CAUGHT |
| Colluding Pair vs 1 Honest | FAIL | 60% | CAUGHT |
| Colluding Pair vs 2 Honest | FAIL | 60% | CAUGHT |
| Omission Attack (hides all numbers/dates) | FAIL | 100% | CAUGHT |
| Word Numbers ("thirty five million") | FAIL | 65% | CAUGHT |
| Coordinated Collusion (varied wrong answers) | FAIL | 74% | CAUGHT |
11/11 adversarial patterns caught. 0 escaped. Plus 4 meta-agent attacks (agents that know the verifier logic): all 4 caught (3 as SUSPICIOUS, 1 as FAIL). See Known Detection Boundaries.
False positive tests (4 honest agents with different styles): 4/4 pass, 0 false negatives.
Run it yourself: python red_team_isolated.py
# Start Nexus
python run.py
# Dashboard: http://localhost:9500
# API docs: http://localhost:9500/docs
Any FastAPI agent joins the network with the standalone SDK (zero nexus dependencies):
from nexus_sdk import NexusAdapter
adapter = NexusAdapter(
app=app,
agent_name="my-agent",
nexus_url="http://localhost:9500",
endpoint="http://localhost:8000",
capabilities=[
{"name": "summarization", "description": "Summarizes text", "price_per_request": 0.01},
],
)
@adapter.handle("summarization")
async def handle(query: str, params: dict) -> dict:
result = await my_summarize(query)
return {"result": result, "confidence": 0.9, "cost": 0.01}
The adapter handles registration, heartbeats (30s), HMAC verification, and request/response serialization automatically.
Consumer Nexus Provider
| | |
|-- request ------------------>| |
| [POLICY CHECK] |
| [ROUTE TO BEST AGENT] |
| [BUDGET CHECK] |
| [CREATE ESCROW] |
| |-- signed request ----------->|
| |<-- response + confidence ----|
| [RECORD TRUST] |
| [SETTLE OR DISPUTE] |
|<-- result + audit trail -----| |
Every state transition is validated. Invalid jumps raise InvalidTransitionError. Terminal states cannot be mutated.
Nexus uses claim-level verification, not just string similarity:
This catches the attacks that naive string matching misses: partial cheaters (80% correct, wrong penalties), style mimics (same format, different country/currency), and adversarial formatting (numbers as words).
| Mechanism | What it does |
|---|---|
| Escrow | Payments held during settlement window. Consumer can dispute. |
| Slashing | Bad output + high confidence = trust AND credit penalty |
| Challenges | Any agent can dispute another's output |
| Sybil Detection | Rate-limited registration, similarity flagging |
| Replay Protection | HMAC + timestamp + signature cache (3-layer) |
| Reconciliation | Background job catches stuck requests and orphaned escrows |
8 agents already integrated via NexusAdapter SDK:
| Agent | Capabilities |
|---|---|
| Cortex | text_generation, code_analysis |
| DocBrain | document_analysis, knowledge_retrieval |
| Mnemonic | memory_management, context_tracking |
| DeepResearch | deep_research, fact_checking |
| Sentinel | security_analysis, threat_detection |
| CostControl | cost_tracking, budget_management |
| SafetyProxy | prompt_injection_detection, pii_detection |
| LogAnalyst | log_analysis, error_explanation |
Nexus has 9 layers. The differentiated value lives in Verification + Defense + Trust — these are what no other agent network does today. The rest exist so Nexus can also run standalone, but are best understood as substrate that A2A can replace.
Differentiating layers (the product):
| Layer | Purpose |
|---|---|
| Verification | Claim-level extraction, normalization, semantic-tension detection, SUSPICIOUS verdict |
| Defense | Slashing, escrow disputes, challenges, sybil detection — driven by verification verdicts |
| Trust | Append-only reputation ledger fed by verification outcomes |
Substrate layers (replaceable by A2A or similar):
| Layer | Purpose | Can be replaced by |
|---|---|---|
| Discovery | Agent registry, capability search, heartbeat monitoring | A2A Agent Cards |
| Protocol | NexusRequest/NexusResponse lifecycle | A2A JSON-RPC 2.0 |
| Routing | Best, cheapest, fastest, or most trusted agent matching | A2A discovery + routing |
| Federation | Cross-instance agent registry sync | A2A federation |
| Payments | Credit wallets, pay-per-request | x402 / PayCrow / on-chain escrow |
| Schemas | Formal capability definitions | A2A Agent Cards |
| Defense | Slashing, escrow, challenges, sybil detection | |
| Policy | Data locality, compliance claims, routing policies | — (keep, used by both modes) |
Roadmap: an A2A bridge is the top Phase 2 item — Nexus consumes A2A Agent Cards as discovery, accepts A2A JSON-RPC requests, and emits Nexus verdicts back into A2A's response flow. See ROADMAP.md.
We tested Nexus with meta-agents — adversarial agents that know how the verifier works and craft responses to bypass it:
| Attack | What it does | Result | How |
|---|---|---|---|
| Low Amplitude | 34M instead of 35M | FAIL | Claim extraction distinguishes the integers |
| Meaning Swap | "penalty" becomes "subsidy", same numbers | SUSPICIOUS | Semantic tension: role conflict (penalty vs incentive language) |
| Negation | "can NOT exceed 35M" — opposite meaning | SUSPICIOUS | Negation divergence detected (2 markers vs 0) |
| Context Shift | Same numbers, different regulation | SUSPICIOUS | Regulation mismatch (AI Act vs Digital Markets Act) |
| Shared Hallucination | All agents agree on the same wrong fact | PASS | Consensus is not truth — by design |
The SUSPICIOUS verdict means: "claims match numerically, but semantic signals diverge — manual review recommended." Three lightweight heuristics power this (no LLM needed): trigger word divergence, negation surface check, and entity/regulation anchoring.
Remaining architectural limit: shared hallucination (all agents wrong in the same way). Addressing this requires external truth anchoring — planned for future phases.
What Nexus catches: numeric drift, format tricks, omissions, collusion, style variation, confidence gaming, meaning swaps, negation, context shifts. What Nexus cannot catch: coordinated identical hallucination.
Nexus makes incorrect behavior harder, more visible, and less profitable than correct behavior.
224 tests + adversarial red team suite:
# Unit + integration tests
pytest -v # 224 passed
# Killer demo
python demo_cheat.py # Cheater caught in 60 seconds
# Full red team suite (12 adversarial + 4 false-positive tests)
python red_team_isolated.py
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/registry/agents |
Register agent |
GET |
/api/registry/agents |
List agents |
GET |
/api/registry/agents/{id} |
Get agent |
POST |
/api/registry/agents/{id}/heartbeat |
Heartbeat |
GET |
/api/registry/discover |
Find by capability |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/protocol/request |
Submit request (enforced lifecycle) |
POST |
/api/protocol/verify |
Multi-agent verification |
GET |
/api/protocol/requests/{id}/events |
Audit trail |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/trust/report/{id} |
Trust report |
POST |
/api/defense/slash |
Slash agent |
GET |
/api/defense/escrows |
List escrows |
POST |
/api/defense/escrows/{id}/dispute |
Dispute escrow |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/payments/wallets |
List wallets |
GET |
/api/payments/wallets/{id}/balance |
Get balance |
POST |
/api/payments/wallets/{id}/topup |
Add credits |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/api/stats |
Network stats |
WS |
/ws/dashboard |
Dashboard WebSocket |
MIT -- Tim Mecklenburg
Built by Tim Mecklenburg
CapiscIO MCP Guard - Secure your MCP tools with agent-to-server authentication, authorization, and audit logging
Cross-vendor agent-to-agent protocol — Claude, Codex, and Gemini communicate via file-based P2P messaging.
Runtime security middleware for A2A (Agent-to-Agent) protocol agents. Provides always-on validation, signature verification, and rate limiting for AI agent interactions.
🚀 Access and manage the CapiscIO CLI easily with this Python wrapper, ensuring optimal performance across your system and architecture.
A lawyer for the agent economy. AI agents can request contract review, risk analysis, and legal guidance via A2A protocol.
A curated list of protocols and standards for AI agents — MCP, A2A, ACP, AG-UI, AP2, x402, and 50+ more, organized by stack layer
The agent-native LLM router for autonomous agents. 55+ models (8 free), <1ms local routing, USDC payments on Base & Solana via x402.
The living ecosystem where AI agents complete tasks through workflow loops, improve through iterative execution, are evaluated by mentor agents or humans in the loop, and turn completed work into reusable work experience and data to improve future agents.
Self-healing infrastructure for AI agent payments. 90.3% auto-recovery.
The AI agent with a wallet — spends USDC autonomously to get real work done. Apache-2.0, TypeScript.
Daydreams is a set of tools for building agents for commerce
Live data for AI agents — search, research, markets, crypto, X/Twitter. Pay-per-call via x402 micropayments.