Agentic Network: Gateway 디자인 패턴
원본 링크:https://github.com/ybjeon/research-note/blob/main/ai-agent-security/agentic-network.md
Gateway Design Pattern
Agent끼리 통신을 하는 Agentic Network를 만든다고 했을 때, access control이나 auditing을 하기 위해서는 gateway가 필요하다. 겉으로는 Agent들이 서로 직접 대화하는 것처럼 보여도, 실제 구현에서는 중앙 Gateway나 Orchestrator가 메시지를 관리하는 경우가 많다. Agent 간 통신을 중간에서 처리하거나, 연결만 도와주거나, 암호화된 메시지만 전달하는 역할을 할 수도 있다. Gateway가 어디까지 개입하느냐에 따라 네트워크 구조와 보안 모델이 달라진다.
1. Centralized Gateway/Orchestrator
Gateway는 모든 메시지를 중계하므로 다음이 가능하다.
- 모든 요청과 응답 검사
- 트래픽 로깅
- 인증과 권한 부여 강제
- 메시지 수정
- 비용 추적
대부분의 AI Gateway, MCP Gateway, API Gateway, Agent Router 구현은 이 패턴을 따른다 [1][2].
2. Gateway Used Only for Initial Connection
- Gateway는 연결 설정 단계만 볼 수 있다
- 그 이후의 메시지 내용은 Gateway에 보이지 않는다
- Agent들은 네트워크 레벨에서 직접 통신한다
Service discovery와 P2P 시스템에서 흔하다 [3].
3. End-to-End Encrypted Communication
트래픽은 Gateway를 거치지만 다음과 같은 특징이 있다.
- Gateway는 ciphertext만 볼 수 있다
- 내용은 복호화할 수 없다
- Metadata, 즉 누가 누구와 통신했는지는 여전히 보인다
Signal 서버가 메시지를 처리하는 방식과 유사하다 [4].
4. Most Common Pattern in Multi-Agent LLM Systems
AutoGen, CrewAI, LangGraph, OpenAI Agents SDK 같은 framework는 일반적으로 central orchestrator를 사용한다 [5][6].
Agent들이 직접 통신하는 것처럼 보여도, 실제로는 central orchestrator가 모든 메시지를 가지고 있는 경우가 많다. 이유는 다음과 같다.
- Context management: 대화 기록을 유지하고 필요에 따라 추가 context나 instruction을 주입할 수 있다
- 비용 추적
- Debugging
- Audit logging
- Retry logic: 실패한 메시지에 대한 retry와 error handling 구현
- 인증과 권한 부여 강제
What gateway can see/do?
| Content | 1. Centralized Gateway | 2. Initial Connection Only | 3. End-to-End Encrypted | 4. Central Orchestrator (Multi-Agent LLM) |
|---|---|---|---|---|
| Session establishment | Yes | Yes | Yes | Yes |
| Sender Identity | Yes | Yes | Yes (metadata) | Yes |
| Message Existence | Yes | No | Yes | Yes |
| Message Visibility | Yes | No | No | Yes |
| Message Modification | Yes (예: 민감 정보 redact) | No | No | Yes (예: context 추가) |
| Audit Logging | Yes | Limited (connection event) | Limited (metadata only) | Yes |
| Cost Management | Yes (message별 비용 추적) | No | No | Yes |
| Access Control | Yes | Limited (connection-level) | No | Yes |
| Context Management | Yes (session별 context 주입/수정) | No | No | Yes (전체 대화 기록 유지) |
| Retry Logic | Yes | No | Limited (transport-level only) | Yes |
Reference
[1] Top 5 MCP Gateways in 2025: The Complete Guide to Enterprise-Ready AI Agent Infrastructure
[2] MCP Gateway: How It Works, Capabilities and Use Cases
[3] Building a Decentralized, Agent-Friendly Communication Ecosystem
[4] Trustworthy AI Agents: End-to-End Encryption
[5] Technical Comparison of AutoGen, CrewAI, LangGraph, and OpenAI Swarm
[6] Multi-Agent Architecture: Patterns, Use Cases & Production Reality