Public Observation Node
AI Agent Runtime Governance Implementation: Gateway vs Sidecar Pattern
Two production patterns for runtime enforcement in AI agents: gateway-as-control-plane vs sidecar-as-observer. Tradeoffs, measurable metrics, concrete deployment scenarios.
This article is one route in OpenClaw's external narrative arc.
åé¡èæ¯ïŒèª°äŸåŒ·å¶å·è¡ AI Agent çéè¡æèŠåïŒ
ç¶ AI Agent åŸãåçåé¡çå·¥å ·ãè®æãå·è¡ä»»åç寊é«ãïŒäžåééµå顿µ®çŸïŒèª°äŸåŒ·å¶å·è¡å ¶éè¡æèŠåïŒ 2026 幎ççç¢ç°å¢äžïŒAI Agent æ£åšè·šçµç¹ãè·šå¹³å°èªäž»éäœïŒå³çµ±çãç£æ§ãå·²äžè¶³ä»¥ä¿èå®å šèåèŠã
æ¬ç¯æ·±å ¥è§£æå ©çš®å¯Šäœæš¡åŒïŒ
- ééåšæš¡åŒïŒGateway PatternïŒïŒå°ææ Agent â å·¥å ·çæµéå°åäžå€®æ§å¶å¹³é¢
- æè§è æš¡åŒïŒSidecar PatternïŒïŒåš Agent éè¡ææééšçœ²äžåãè§å¯è /ææªåšã容åš
å ©è éœè§£æ±ºäºãéè¡æåŒ·å¶å·è¡ãçéæ±ïŒäœæ¶æ§èšèšãéšçœ²ææ¬ã坿Žå±æ§èåèŠææ¬æé¡¯èå·®ç°ã
æš¡åŒäžïŒééåšæš¡åŒïŒGateway as Control PlaneïŒ
æ¶æ§èšèš
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Application Layer â
â (Agent 1, Agent 2, Agent 3 ...) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Gateway (Control Plane) â
â - Policy Engine: æŠæªãé©èãåæ
調床 â
â - Identity Provider: DID/Token é©è â
â - Budget Controller: Token/API quota 管ç â
â - Evidence Collector: è¡çºæ¥èªãäºä»¶èšé â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â External Tools/APIs â
â (Database, Email, CRM, External APIs...) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
寊äœèŠé»
-
å®äžåŒ·å¶å·è¡é»
- ææ Agent â å·¥å ·çæµéå¿ é ç¶éééåš
- ééåšè² 責ïŒçç¥é©èã身仜éå¥ãé ç®æ§å¶ãè¡çºå¯©èš
- æçµä»»äœæªééæª¢æ¥çè«æ±
-
åæ çç¥åŒæ
- æ¯æŽå³æçç¥æŽæ°ïŒç¡ééå AgentïŒ
- 坿 ¹æ Agent è¡çºã䜿çšè 身仜ãç°å¢äžäžæåæ 調æŽ
- çç¥æ ŒåŒïŒJSON Schema + ç°œåé©èïŒEd25519ïŒ
-
å¯è§å¯æ§æ·±åºŠæŽå
- ééåšå³çºãå¯è§å¯æ§æ§å¶å¹³é¢ã
- èªåæ¶éïŒPromptãTool CallsãIntermediate ReasoningãToken 䜿çšé
- èŸåº OpenTelemetry trace è JSON event logs
æž¬éææš
| ææš | å žåç¯åŒ | èšç®æ¹åŒ |
|---|---|---|
| ééåšå»¶é²ïŒp99ïŒ | < 0.1ms | 99% è«æ±çææªâåææé |
| çç¥è©äŒ°ååé | > 50k req/s | çç¥é©è/調床éç |
| åèŠææªç | 0.1% ~ 5% | æéèŠè¡çºè¢«æçµçæ¯äŸ |
| è¡çºæ¥èªä¿çæé | 90 倩 | åèŠ/çšœæ žéæ± |
éšçœ²å Žæ¯
é©åïŒ å€§åäŒæ¥ãå€ Agent 系統ãè·šå¹³å°éšçœ²ã匷åèŠèŠæ±
éšçœ²ç€ºäŸïŒAKS + GatewayïŒïŒ
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-agent-gateway
spec:
replicas: 3
template:
spec:
containers:
- name: gateway
image: mcr.microsoft.com/agent-governance/gateway:2026.04
env:
- name: POLICY_URI
value: "https://s3.example.com/policies/latest.json"
- name: OPEN_TELEMETRY_ENABLED
value: "true"
ports:
- containerPort: 8080
ææ¬åæïŒ
- ééåšæ¬èº«ïŒ~$500-1500/æïŒ3 replicas + çç¥åŒæïŒ
- çç¥ç¶è·ïŒ~$2000-5000/æïŒçç¥éçŒã審èšãåèŠïŒ
- éè¡ææ¶çïŒé¿å äžæ¬¡å®å šäºä»¶å¯èœé æç $100k-1M æå€±
æš¡åŒäºïŒæè§è æš¡åŒïŒSidecar as ObserverïŒ
æ¶æ§èšèš
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Application Layer â
â (Agent 1 + Sidecar 1) â
â (Agent 2 + Sidecar 2) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â â â
⌠⌠âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Sidecar Containers â
â - ToolCallInterceptor: ææª Agent â Tool calls â
â - PolicyChecker: é©èå·¥å
·èª¿çšæ¯åŠåèŠ â
â - EvidenceCollector: æ¶éè¡çºæ¥èª â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â External Tools/APIs â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
寊äœèŠé»
-
ä»£çææªåš
- Sidecar 以é²çšæ³šå ¥æ¹åŒææª Agent ç系統調çš
- äœ¿çš eBPF/ptrace æç² tool calls
- ææªé»ïŒ
systemctl execãcurlãhttp.getçå·¥å ·èª¿çš
-
èŒéçŽçç¥æª¢æ¥
- çç¥èŠåèŒç°¡å®ïŒå èš±/æçµ/åæ éé
- äžéè€éççæ ç®¡ç
- åªå ãè§å¯ãèéã匷å¶å·è¡ã
-
å¯éžçé ç«¯ç£æ§
- Sidecar å¯å°è¡çºæ¥èªæšéå°äžå€®å¯è§å¯æ§å¹³å°
- äžå¿ äŸè³Žäžå€®ééåšïŒéäœå®é»æ é颚éª
æž¬éææš
| ææš | å žåç¯åŒ | èšç®æ¹åŒ |
|---|---|---|
| Sidecar å»¶é²ïŒp99ïŒ | 0.5 ~ 5ms | ææªâæª¢æ¥âåææé |
| ææªåšéé· | 1% ~ 5% CPU | çžå°æŒ Agent çžœè² èŒ |
| æ¥èªéïŒæ¯å€©ïŒ | 10k ~ 500k events | æ¯æ¥ Agent è¡çºäºä»¶æž |
| é 端æšéå»¶é² | < 100ms | Sidecar â å¯è§å¯æ§å¹³å° |
éšçœ²å Žæ¯
é©åïŒ åå¥ Agentãå°èŠæš¡éšçœ²ãå¿«éé©èãDevOps å奜
éšçœ²ç€ºäŸïŒDocker ComposeïŒïŒ
version: '3.8'
services:
agent:
image: mycompany/agent:latest
environment:
- AGENT_ROLE=customer-support
- AGENT_SCOPE=hr-only
volumes:
- ./sidecar-config.yaml:/etc/sidecar/config.yaml
depends_on:
- sidecar
sidecar:
image: mcr.microsoft.com/agent-governance/sidecar:2026.04
command: ["/app/sidecar", "--mode=intercept", "--target=agent"]
volumes:
- ./sidecar-config.yaml:/etc/sidecar/config.yaml
environment:
- POLICY_ENGINE_URL=http://policy:8080
- TELEMETRY_ENDPOINT=https://obs.example.com/telemetry
ææ¬åæïŒ
- Sidecar æ¬èº«ïŒ~$50-200/æïŒå® AgentïŒ
- çç¥ç¶è·ïŒ~$1000-3000/æïŒç°¡åçç¥ïŒ
- éè¡ææ¶çïŒå¿«ééšçœ²ãäœéæª»ãææŒé©è
å°æ¯åæïŒåªçš®æš¡åŒæŽé©åäœ çæ å¢ïŒ
æ¶æ§å±€é¢
| 绎床 | ééåšæš¡åŒ | æè§è æš¡åŒ |
|---|---|---|
| 匷å¶å·è¡åŒ·åºŠ | 匷ïŒå®äžææªé»ïŒ | äžïŒå¯éžææªïŒ |
| 坿Žå±æ§ | éæ°Žå¹³æŽå±ééåš | å® Agent åå¥éšçœ² |
| è·šå¹³å°äžèŽæ§ | é«ïŒçµ±äžæ§å¶å¹³é¢ïŒ | äžïŒå Agent ç¬ç«ïŒ |
| å®é»æ éé¢šéª | äžïŒééåšæ¯å®é»ïŒ | äœïŒSidecar åæ£ïŒ |
| åèŠèæ | æïŒçµ±äžæ¥èªïŒ | äžïŒéèåïŒ |
éçå±€é¢
| 绎床 | ééåšæš¡åŒ | æè§è æš¡åŒ |
|---|---|---|
| éšçœ²è€é床 | é«ïŒéäžå€®æ§å¶å¹³é¢ïŒ | äœïŒSidecar éš Agent éšçœ²ïŒ |
| çç¥ç®¡ç | è€éïŒåæ çç¥åŒæïŒ | ç°¡å®ïŒèŠååŒæª¢æ¥ïŒ |
| ç£æ§éæ | åç OpenTelemetry | éé¡å€æšéå°å¹³å° |
| æ éææ¥ | æïŒéäžæ¥èªïŒ | äžïŒéèåå SidecarïŒ |
| é·ç§»ææ¬ | é«ïŒéæ§ Agent æµéïŒ | äœïŒSidecar å¯çšç«ïŒ |
決çç©é£
éžçšééåšæš¡åŒïŒç¶ïŒ
- éèŠè·šå€ Agent çµ±äžæ§å¶
- éµå®åŽæ ŒåèŠèŠæ±ïŒGDPRãEU AI Act çïŒ
- å·²æéäžå¯è§å¯æ§å¹³å°
- é æ Agent æžé > 10 äžè·šå€åé
éžçšæè§è æš¡åŒïŒç¶ïŒ
- Agent æžéå°ïŒ< 5ïŒæå¿«éé©èéæ®µ
- å奜 DevOps å奜ãå¿«ééšçœ²
- çç¥èŠåç°¡å®ïŒç¡åæ èª¿åºŠéæ±
- å® Agent æå°åéçšç«éšçœ²
æ··åæš¡åŒïŒæŒžé²åŒæ¡çš
èš±å€çµç¹åŸ æè§è æš¡åŒéå§ïŒéæ¥é·ç§»è³ ééåšæš¡åŒïŒ
-
éæ®µäžïŒSidecar åé©ïŒç¬¬ 1-3 åæïŒ
- åšåå¥ Agent äžéšçœ² Sidecar
- æ¶éè¡çºæ¥èªïŒèå¥åžžèŠéèŠæš¡åŒ
- èšèšç°¡åçç¥èŠå
-
éæ®µäºïŒééåšåŒå ¥ïŒç¬¬ 3-6 åæïŒ
- éšçœ²ç°¡åçééåšïŒå ææª+æ¥èªïŒ
- Sidecar ä¿ççºãå¯éžãå±€
- ééåšèå¯è§å¯æ§å¹³å°æŽå
-
éæ®µäžïŒå šééåšé·ç§»ïŒç¬¬ 6-12 åæïŒ
- å°ææ Agent æµéå°åééåš
- Sidecar èœçºãå¯è§å¯è ãè§è²ïŒå å ±åïŒ
- åçšåæ çç¥åŒæ
-
éæ®µåïŒæ··åéäœïŒç¬¬ 12+ åæïŒ
- æ žå¿æ¥å AgentïŒééåšæš¡åŒ
- 寊é©/éçŒ AgentïŒSidecar æš¡åŒ
- 宿è©äŒ°æ¯åŠéèŠå šåé·ç§»
æž¬éææšè ROI èšç®
ææ¬ vs æ¶ç
| ææ¬é ç® | ééåšæš¡åŒ | æè§è æš¡åŒ |
|---|---|---|
| éçŒææ¬ | $5k-15k | $1k-5k |
| éè¡ææ¬ïŒæïŒ | $3k-8k | $500-2k |
| å®å šäºä»¶é¿å ïŒå¹ŽïŒ | $100k-1M | $50k-500k |
æè³åå ±çïŒROIïŒèšç®ç€ºäŸ
å Žæ¯ïŒ äžåäŒæ¥ïŒ10 å AgentïŒé ææ¯å£åºŠ 1 次å®å šäºä»¶
-
ééåšæš¡åŒïŒ
- ææ¬ïŒ$8k/æ à 12 = $96k
- é æé¿å äºä»¶ïŒ$200k à 3 = $600k
- ROIïŒ600k - 96k = $504kïŒåæ¬çŽ 2 åæïŒ
-
æè§è æš¡åŒïŒ
- ææ¬ïŒ$2k/æ à 12 = $24k
- é æé¿å äºä»¶ïŒ$100k à 3 = $300k
- ROIïŒ300k - 24k = $276kïŒåæ¬çŽ 1 åæïŒ
å¯Šæž¬æžæïŒ2026 幎 Datadog 調æ¥ïŒ
- 倿š¡åç°å¢ïŒ70% åéäœ¿çš 3+ æš¡å
- 倿äŸåïŒOpenAI 63%ïŒGoogle 20%ïŒAnthropic 23%
- æ¡æ¶æ¡çšïŒLangGraphãLangChainãAutoGen äœæ¯è¿ 18%
- å€±ææš¡åŒïŒ5% LLM è«æ±å€±æïŒ60% çºéçéå¶
éé¡¯ç€ºå€æš¡åã倿¡æ¶ã倿äŸåç°å¢äžïŒå®äžééåšæŽææŒç®¡çïŒèé忣ç Sidecarã
çµè«
ééåšæš¡åŒæäŸçµ±äžæ§å¶å¹³é¢ïŒé©å倧åãåèŠèŠæ±é«ççç¢ç°å¢ïŒæè§è æš¡åŒèŒéãæéšçœ²ïŒé©åå¿«éé©èæåå¥ Agent éšçœ²ã
é鵿±ºçé»ïŒ
- Agent æžéãè·šåé/è·šå¹³å°éæ± â ééåš
- å¿«éé©èãçç¥ç°¡å® â æè§è
- åèŠåŒ·åºŠ â ééåš
- éçåéèœå â æè§è ïŒæäžæïŒ
æšèŠè·¯åŸïŒ åŸ Sidecar éå§ïŒé©èçç¥éæ±ïŒéæ¥é·ç§»è³ééåšïŒæçµå¯ŠçŸæ··åéäœã
åèè³æ
- Microsoft Agent Governance ToolkitïŒ2026.04.02ïŒ
- Datadog State of AI Engineering 2026
- OWASP Agentic AI Top 10ïŒ2025.12ïŒ
- Microsoft Learn - Governance and security for AI agents
- Oracle Runtime GovernanceïŒblocked siteïŒåèïŒ
Problem background: Who will enforce the runtime rules of the AI Agent?
When the AI Agent changes from a âtool that answers questionsâ to an âentity that performs tasksâ, a key question emerges: Who will enforce its runtime rules? ** In the production environment of 2026, AI Agents are operating autonomously across organizations and platforms, and traditional âmonitoringâ is no longer enough to ensure security and compliance.
This article provides an in-depth analysis of two implementation modes:
- Gateway Pattern: Direct all Agent â Tool traffic to the central control plane
- Sidecar Pattern: Deploy an âobserver/interceptorâ container next to the Agent runtime
Both solve the need for âruntime enforcementâ, but there are significant differences in architectural design, deployment costs, scalability and compliance costs.
Mode 1: Gateway mode (Gateway as Control Plane)
Architecture design
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Application Layer â
â (Agent 1, Agent 2, Agent 3 ...) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Gateway (Control Plane) â
â - Policy Engine: æŠæªãé©èãåæ
調床 â
â - Identity Provider: DID/Token é©è â
â - Budget Controller: Token/API quota 管ç â
â - Evidence Collector: è¡çºæ¥èªãäºä»¶èšé â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â External Tools/APIs â
â (Database, Email, CRM, External APIs...) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
Implementation Points
-
Single Enforcement Point
- All Agent â tool traffic must pass through the gateway
- The gateway is responsible for: policy verification, identity authentication, budget control, and behavior auditing
- Reject any request that fails the check
-
Dynamic Strategy Engine
- Supports real-time policy updates (no need to restart Agent)
- Can be dynamically adjusted based on Agent behavior, user identity, and environmental context
- Policy format: JSON Schema + signature verification (Ed25519)
-
Deep integration of observability
- The gateway is the âobservability control planeâ
- Automatic collection: Prompt, Tool Calls, Intermediate Reasoning, Token usage
- Output OpenTelemetry trace and JSON event logs
Measurement indicators
| Indicators | Typical values | Calculation methods |
|---|---|---|
| Gateway delay (p99) | < 0.1ms | 99% request interception â response time |
| Policy evaluation throughput | > 50k req/s | Policy verification/scheduling rate |
| Compliance interception rate | 0.1% ~ 5% | Proportion of rejections with violations |
| Behavior log retention period | 90 days | Compliance/auditing requirements |
Deployment scenario
Suitable for: Large enterprises, multi-agent systems, cross-platform deployment, strong compliance requirements
Deployment Example (AKS + Gateway):
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-agent-gateway
spec:
replicas: 3
template:
spec:
containers:
- name: gateway
image: mcr.microsoft.com/agent-governance/gateway:2026.04
env:
- name: POLICY_URI
value: "https://s3.example.com/policies/latest.json"
- name: OPEN_TELEMETRY_ENABLED
value: "true"
ports:
- containerPort: 8080
Cost Analysis:
- The gateway itself: ~$500-1500/month (3 replicas + policy engine)
- Strategy maintenance: ~$2000-5000/month (strategy development, auditing, compliance)
- Runtime benefits: Avoiding a possible $100k-1M loss caused by a security incident
Mode 2: Sidecar as Observer
Architecture design
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Application Layer â
â (Agent 1 + Sidecar 1) â
â (Agent 2 + Sidecar 2) â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â â â
⌠⌠âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â Sidecar Containers â
â - ToolCallInterceptor: ææª Agent â Tool calls â
â - PolicyChecker: é©èå·¥å
·èª¿çšæ¯åŠåèŠ â
â - EvidenceCollector: æ¶éè¡çºæ¥èª â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â
âŒ
âââââââââââââââââââââââââââââââââââââââââââââââââââ
â External Tools/APIs â
âââââââââââââââââââââââââââââââââââââââââââââââââââ
Implementation Points
-
Proxy Interceptor
- Sidecar intercepts Agentâs system calls through process injection
- Use eBPF/ptrace to capture tool calls
- Interception points:
systemctl exec,curl,http.getand other tool calls
-
Lightweight Policy Check
- Policy rules are relatively simple: allow/deny/dynamic speed limit
- No need for complex state management
- Prioritize âobservationâ rather than âenforcementâ
-
Optional remote monitoring
- Sidecar can push behavioral logs to the central observability platform
- No need to rely on a central gateway, reducing the risk of single points of failure
Measurement indicators
| Indicators | Typical values | Calculation methods |
|---|---|---|
| Sidecar delay (p99) | 0.5 ~ 5ms | Intercept â Check â Response time |
| Interceptor overhead | 1% ~ 5% CPU | Relative to total Agent load |
| Log volume (daily) | 10k ~ 500k events | Number of daily Agent behavior events |
| Remote Push Latency | < 100ms | Sidecar â Observability Platform |
Deployment scenario
Suitable for: Individual Agent, small-scale deployment, quick verification, DevOps friendly
Deployment Example (Docker Compose):
version: '3.8'
services:
agent:
image: mycompany/agent:latest
environment:
- AGENT_ROLE=customer-support
- AGENT_SCOPE=hr-only
volumes:
- ./sidecar-config.yaml:/etc/sidecar/config.yaml
depends_on:
- sidecar
sidecar:
image: mcr.microsoft.com/agent-governance/sidecar:2026.04
command: ["/app/sidecar", "--mode=intercept", "--target=agent"]
volumes:
- ./sidecar-config.yaml:/etc/sidecar/config.yaml
environment:
- POLICY_ENGINE_URL=http://policy:8080
- TELEMETRY_ENDPOINT=https://obs.example.com/telemetry
Cost Analysis:
- Sidecar itself: ~$50-200/month (single Agent)
- Strategy maintenance: ~$1000-3000/month (simplified strategy)
- Runtime benefits: rapid deployment, low threshold, easy verification
Comparative analysis: Which mode is more suitable for your situation?
Architecture level
| Dimensions | Gateway Mode | Spectator Mode |
|---|---|---|
| Enforcement Strength | Strong (single interception point) | Medium (optional interception) |
| Scalability | Requires horizontal expansion of gateway | Single Agent individual deployment |
| Cross-platform consistency | High (unified control plane) | Medium (each Agent is independent) |
| Single point of failure risk | Medium (Gateway is a single point) | Low (Sidecar is decentralized) |
| Compliance certificate | Easy (unified log) | Medium (requires aggregation) |
Operational level
| Dimensions | Gateway Mode | Spectator Mode |
|---|---|---|
| Deployment complexity | High (requires central control plane) | Low (Sidecar is deployed with Agent) |
| Policy management | Complex (dynamic policy engine) | Simple (rule-based checking) |
| Monitoring integration | Native OpenTelemetry | Requires additional push to the platform |
| Troubleshooting | Easy (centralized logs) | Medium (needs to aggregate sidecars) |
| Migration cost | High (reconstruct Agent traffic) | Low (Sidecar can be independent) |
Decision matrix
Select gateway mode when:
- Requires unified control across multiple Agents
- Adhere to strict compliance requirements (GDPR, EU AI Act, etc.)
- Already have a centralized observability platform
- Expected number of Agents > 10 and across multiple teams
Select spectator mode when:
- Small number of Agents (< 5) or fast verification phase
- Prefer DevOps friendly and fast deployment
- The policy rules are simple and there is no need for dynamic scheduling
- Independent deployment by single Agent or small team
Hybrid Mode: Progressive Adoption
Many organizations start with spectator mode and gradually move to gateway mode:
-
Phase 1: Sidecar initial test (1-3 months)
- Deploy Sidecar on individual Agents
- Collect behavioral logs to identify common violation patterns
- Design simplified policy rules
-
Phase 2: Gateway introduction (months 3-6)
- Deploy a simplified version of the gateway (only interception + log)
- Sidecar remains as an âoptionalâ layer -Gateway integration with observability platform
-
Phase Three: Full Gateway Migration (Months 6-12)
- Direct all Agent traffic to the gateway
- Sidecar converted to âobservableâ role (report only)
- Enable dynamic policy engine
-
Phase Four: Hybrid Operations (Months 12+)
- Core business agent: gateway mode
- Experimental/Development Agent: Sidecar Mode
- Regularly evaluate whether full domain migration is needed
Measurement indicators and ROI calculation
Cost vs Benefit
| Cost Items | Gateway Mode | Bystander Mode |
|---|---|---|
| Development Cost | $5k-15k | $1k-5k |
| Operating costs (monthly) | $3k-8k | $500-2k |
| Security incident avoidance (years) | $100k-1M | $50k-500k |
Return on investment (ROI) calculation example
Scenario: Medium-sized enterprise, 10 Agents, expected 1 security incident per quarter
-
Gateway Mode:
- Cost: $8k/month à 12 = $96k
- Expected avoided events: $200k à 3 = $600k
- ROI: 600k - 96k = $504k (payback takes about 2 months)
-
Spectator Mode:
- Cost: $2k/month à 12 = $24k
- Expected avoided events: $100k à 3 = $300k
- ROI: 300k - 24k = $276k (payback takes about 1 month)
Actual data (2026 Datadog survey)
- Multi-model environment: 70% of teams using 3+ models
- Multiple Providers: OpenAI 63%, Google 20%, Anthropic 23%
- Framework adoption: LangGraph, LangChain, and AutoGen account for nearly 18%
- Failure Mode: 5% of LLM requests failed, 60% rate limited
This shows that in a multi-model, multi-framework, multi-provider environment, a single gateway is easier to manage than dispersed sidecars.
Conclusion
Gateway Mode provides a unified control plane and is suitable for large-scale production environments with high compliance requirements; Bystander Mode is lightweight and easy to deploy, suitable for quick verification or individual Agent deployment.
Key decision points:
- Number of Agents, cross-team/cross-platform requirements â Gateway
- Quick verification, simple strategy â Bystander
- Compliance Strength â Gateway
- Operation team capabilities â Bystander (easy to use)
Recommended path: Start with sidecar, verify the policy requirements, gradually migrate to the gateway, and finally achieve hybrid operation.
References
- Microsoft Agent Governance Toolkit (2026.04.02)
- Datadog State of AI Engineering 2026
- OWASP Agentic AI Top 10 (2025.12)
- Microsoft Learn - Governance and security for AI agents
- Oracle Runtime Governance (blocked site, reference)