Skip to content

5. Gateway

What will the gateway add?

Put agentgateway between the agent and three boundaries: MCP read tools, A2A clients, and an OpenAI-compatible model endpoint. The host profile stays account-free with Ollama/Qwen3; Chapter 6 moves the same listener contract to k3d and optional GKE overlays.

AAIF project

agentgateway was created by Solo.io and donated to the Linux Foundation; it is now an Agentic AI Foundation (AAIF) project. This chapter uses it as the connectivity and traffic-policy layer while keeping application approval and transactions in ADK/Python.

This chapter covers:

  • 5.0. Gateway: The connectivity and security problem agents face, and an agentgateway overview.
  • 5.1. Gateway Setup: Run the digest-pinned gateway image through its loopback-only host wrapper.
  • 5.2. MCP Gateway: Front exactly six reads with fail-closed authorization.
  • 5.3. A2A Gateway: Route agent-to-agent traffic with the a2a route policy.
  • 5.4. Model Gateway: Stabilize the agent on one endpoint while choosing local Qwen3 or GKE Vertex Gemini upstream.
  • 5.5. Gateway Security: Active allowlists, limits, prompt guards, identity, and residual risk.
  • 5.6. Gateway Observability: JSON logs, internal metrics, OTLP traces, and content-capture privacy.

The chapter checkpoint tests fail-closed MCP, A2A discovery, local model translation, prompt rejection, and telemetry through gateway ports only.