lad
CLAUDE.md251 starsChanged 5 months agoApache-2.0View on GitHub
LAD-A2A (Local Agent Discovery for A2A) is an open protocol specification and reference implementation for discovering A2A-capable AI agents on local networks. It enables AI agents to find and connect to service agents when joining networks (hotels, offices, hospitals, etc.). Key concepts: - Discovery layer between physical networks and A2A protocol (MCP handles tools, A2A handles communication, LAD-A2A handles discovery) - Zero-configuration discovery via mDNS/DNS-SD (_lad-a2a._tcp.local), well-known endpoints (/.well-known/lad/agents), and DHCP - Security model assumes local networks are hostile by…
- Reads credentials
- Installs packages
The file
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
LAD-A2A (Local Agent Discovery for A2A) is an open protocol specification and reference implementation for discovering A2A-capable AI agents on local networks. It enables AI agents to find and connect to service agents when joining networks (hotels, offices, hospitals, etc.).
Key concepts:
- Discovery layer between physical networks and A2A protocol (MCP handles tools, A2A handles communication, LAD-A2A handles discovery)
- Zero-configuration discovery via mDNS/DNS-SD (
_lad-a2a._tcp.local), well-known endpoints (/.well-known/lad/agents), and DHCP - Security model assumes local networks are hostile by default
Common Commands
Reference Implementation
cd reference
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Run tests (conformance, security, and v0.2 hardening)
pytest tests/ -v
# Run single test
pytest tests/test_lad.py::TestDiscoveryEndpoint::test_discovery_required_fields -v
# Start server (development only - no TLS)
python -m server.lad_server --name "My Agent" --port 8080
# Start server with TLS (production)
python -m server.lad_server --name "My Agent" --port 443 \
--ssl-certfile /path/to/cert.pem --ssl-keyfile /path/to/key.pem
# Start server with AgentCard signing
python -m server.lad_server --name "My Agent" --signing-key keys/private.pem
# Run client
python -m client.lad_client --url http://localhost:8080
# Run client with verification
python -m client.lad_client --url https://agent.example.com \
--signing-public-key keys/public.pem --require-verified
# Run client with interactive consent
python -m client.lad_client --url http://localhost:8080 --with-consent
# Generate signing keys
python -c "from common.signing import generate_signing_keys; generate_signing_keys('keys/')"Demo Application
cd demo
cp .env.example .env # Add OPENAI_API_KEY
./run_demo.sh # Opens http://localhost:8000Documentation
pip install mkdocs-material
mkdocs serve # Local preview
mkdocs build # Build static siteArchitecture
Reference Implementation (reference/)
Server (server/lad_server.py):
LADServerclass handles mDNS advertisement and well-known endpoints- Advertises via
_lad-a2a._tcp.localwith TXT records (path, v, id, org) - FastAPI endpoints:
/.well-known/lad/agents(discovery),/.well-known/agent.json(A2A AgentCard) - TLS support via
--ssl-certfileand--ssl-keyfile - AgentCard signing via
--signing-key(returns JWS when client requestsapplication/jose)
Client (client/lad_client.py):
LADClientimplements layered discovery: mDNS → well-known fallback → fetch AgentCardsMDNSListenerhandles_lad-a2a._tcp.localservice discovery with proper update/remove handling- Returns
DiscoveryResultwith agents list, verification status, and errors DiscoveredAgentincludesverified,verification_method,verification_errorfields- Consent flow via
discover_with_consent()with callback interface - TLS verification enabled by default, signature verification optional
Common (common/signing.py):
SigningConfigfor JWS signing configurationgenerate_signing_keys()- Generate ECDSA P-256 key pairssign_agent_card()- Sign AgentCards as JWS tokensverify_agent_card()- Verify JWS signatures
Demo (demo/)
Two-agent system demonstrating LAD-A2A + A2A integration:
- Hotel Agent (port 8001): LAD-A2A server + A2A JSON-RPC server, GPT-4o backend
- User Agent "Aria" (port 8000): LAD-A2A client + A2A client + web UI, routes queries to discovered agents
A2A transport: JSON-RPC 2.0 over HTTP with SendMessage/GetTask/CancelTask methods.
Protocol Specification (spec/spec.md)
Version 0.1.0-draft defining:
- Discovery mechanisms (mDNS, well-known, DHCP, QR/NFC)
- Trust bootstrap and security requirements (TLS 1.2+ mandatory, signed AgentCards, DIDs)
- Response schemas and field requirements
Key Dependencies
zeroconf- mDNS/DNS-SD implementationfastapi+uvicorn- Web framework and ASGI serverhttpx- Async HTTP clientpydantic- Data validationpyjwt- JWT/JWS token handling for AgentCard signingcryptography- Cryptographic primitives for signingopenai- Demo only (GPT-4o)
Python 3.10+ required.
Security Notes
- TLS is mandatory for production (use
--ssl-certfileand--ssl-keyfile) - AgentCards must be cryptographically signed (use
--signing-key) - User consent required before agent communication (use
--with-consentordiscover_with_consent()) - Verification methods: TLS, domain matching, JWS signature
- See PRODUCTION-CHECKLIST.md for deployment guidance
- See SECURITY.md for vulnerability reporting
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

