A2A Server
Que es A2A
A2A (Agent-to-Agent) es el protocolo de Google para que agentes IA se comuniquen entre si. OSINT AI One expone un servidor A2A que otros agentes pueden usar para delegar tareas de investigacion.
Arrancar el servidor
osint-a2a # default: 0.0.0.0:9000osint-a2a --port 9090 # puerto personalizadoAgent Card
El servidor expone su “tarjeta de agente” en el endpoint estandar:
GET http://localhost:9000/.well-known/agent-card.json{ "name": "OSINT AI Agent", "description": "Autonomous threat intelligence and OSINT investigation platform", "skills": [ "investigate_ip", "investigate_domain", "investigate_url", "threat_feed_analysis", "risk_scoring" ], "version": "1.0.0", "streaming": true, "output_modes": ["json", "text"]}Las 5 Skills A2A
| Skill | Input | Que hace |
|---|---|---|
investigate_ip | IP address | Investigacion completa de IP con todas las herramientas |
investigate_domain | Domain name | Investigacion completa de dominio |
investigate_url | URL | Analisis de URL con URLScan y contexto |
threat_feed_analysis | Feed name + limit | Analiza los N IOCs mas recientes de un feed |
risk_scoring | IOC | Devuelve solo el score de riesgo 0-100 |
Llamar desde otro agente
from a2a_sdk import A2AClient
client = A2AClient("http://localhost:9000")
# Investigacion de IPresult = await client.send_task({ "skill": "investigate_ip", "message": "Investigate IP 185.220.101.34"})
# Con streaming de eventosasync for event in client.stream_task({ "skill": "investigate_domain", "message": "investigate domain evil-phishing.com"}): print(f"Event: {event.type} — {event.data}")Streaming
El servidor A2A soporta streaming de eventos en tiempo real. Mientras el agente investiga, envia eventos:
{"type": "tool_call", "data": {"tool": "virustotal_ip_lookup", "input": "185.220.101.34"}}{"type": "tool_result", "data": {"tool": "virustotal_ip_lookup", "result": {...}}}{"type": "tool_call", "data": {"tool": "shodan_host_lookup", "input": "185.220.101.34"}}{"type": "final", "data": {"assessment": "...", "risk_score": 94}}Esto permite que el agente cliente muestre progreso en tiempo real.
Variables de entorno
A2A_HOST=0.0.0.0 # Interfaz de escuchaA2A_PORT=9000 # PuertoCasos de uso
- Orquestador multi-agente: un agente principal delega la investigacion OSINT a OSINT AI One y usa los resultados para tomar decisiones
- Pipeline de seguridad: un sistema SOAR invoca A2A para enriquecer alertas automaticamente
- Agente de triaje: filtra y prioriza IOCs usando risk_scoring antes de escalar a analistas humanos