Reference · concepts first, products second

The Platform-Agnostic Architecture

Every box of the governed agent-to-database architecture named by its role, with an open-source implementation and the Google Cloud guardrail side by side, the wire contract for every hop, and the same map for AWS and Azure.

The architecture in platform-agnostic terms

Agent Runtime, Agent Gateway, Model Armor and Private Service Connect are Google Cloud products. The reasons they exist are not Google-specific. Behind every one of them is a concept that any team can build from open-source parts: a reverse proxy in front of the agent, a forward proxy behind it, a content guardrail the proxies consult, a workload identity for the agent, a token exchange that narrows the user's authority, a private network link, a parameterized tool server, and a database that enforces rows and columns itself.

Figure 0A draws the architecture with those concepts only. Inside every box, a cyan line names an open-source implementation (Envoy Proxy is used for both proxies) and a green line names the Google Cloud guardrail that takes the same role in Figure 4 of Episode 01. The chapter badge points to where the box is introduced. Reading order is the same as the hop numbers: callers enter at hop 1, the agent exits at hop 4, and nothing reaches the database except hop 9.

OUTSIDE AGENT PLATFORM · REVERSE PROXY IN · RUNTIME · FORWARD PROXY OUT SHARED SERVICES · MODEL · REGISTRY · TOKENS · AUDIT DATA PERIMETER · identity + network boundary around the data OSS SPIFFE federation + Cilium · GCP VPC Service Controls · Ch 11 PRIVATE APPLICATION NETWORK · RFC 1918 only · no internet route OSS K8s NetworkPolicy · GCP your VPC · no external IPs · Ch 10 DATA TIER · PRIVATE SUBNET ACROSS EVERYTHING · GOVERNANCE CONTROL PLANE Callers & Apps Ch 1 Browser · mobile · CLI · partner app OSS any OAuth 2.1 clientGCP same Identity Provider Ch 6 Issues user JWT (sub, groups) · JWKS OSS Keycloak · any OIDC IdPGCP Cloud Identity · Okta/Entra Events & Schedules Ch 7 Webhooks · queues · cron mandates OSS Kafka · cron · HMAC-signedGCP Pub/Sub · Cloud Scheduler Reverse Proxy (in)L7 policy enforcement point in front of agentCh 7OSS Envoy ProxyGCP Agent Gateway (client→agent) Caller Authentication Ch 7 Verify JWT / HMAC · RBAC decision OSS Envoy ext_authz + OPAGCP IAM auth policy · IAP Inline Content Guardrail Ch 9 Screen prompt & reply before the model OSS Envoy ext_proc + classifierGCP Model Armor + Cloud SDP Rate & Budget Limiter Ch 7 Per-tenant token bucket · cost circuit OSS Envoy ratelimitGCP Gateway quotas · Cloud Armor Agent RuntimeStateless container · any frameworkCh 1OSS container on KubernetesGCP ADK 2.x on Agent Runtime Deterministic Workflow + HITL Ch 12 Code nodes · one single-turn model node OSS LangGraph · state machineGCP ADK 2.x Workflow + RequestInput Workload Identity Ch 4 Short-lived X.509 SVID · no static keys OSS SPIFFE / SPIREGCP Agent Identity (principal://…) Memory Store Ch 12 OSS Redis · PostgresGCP Memory Bank Code Sandbox Ch 12 OSS gVisor ·FirecrackerGCP Code Execution No DB credentials here · every call exits via the forward proxy Forward Proxy (out)Default-deny exit for every outbound callCh 8OSS Envoy Proxy (sidecar)GCP Agent Gateway (agent→MCP) Caller Proof Ch 6 mTLS workload cert + sender-bound token OSS SPIFFE mTLS + DPoPGCP SPIFFE mTLS Destination AuthZ Ch 8 Agent scope ∩ user scope per target OSS Envoy ext_authz + OPAGCP IAP access rules Inline Tool Guardrail Ch 9 Screen MCP / A2A args & returned rows OSS Envoy ext_proc + classifierGCP Model Armor (MCP · A2A) LLM Inference API Ch 8 Model endpoint reached only via egress proxy OSS vLLM · any hosted modelGCP Gemini on Agent Platform Tool & Agent Registry Ch 8 Signed allowlist of MCP servers, agents, skills OSS signed Git catalogue + OPAGCP Agent Registry Token Exchange Service Ch 6 Token_in → narrowed Token_obo OSS Keycloak STS · VaultGCP IdP (RFC 8693) · STS · KMS Telemetry & Audit Sink Ch 13 Trace + immutable log of user & agent per call OSS OpenTelemetry · WORM bucketGCP Audit Logs · Trace · SCC Private Network Link Ch 10 L4 bridge from proxy into private VPC OSS WireGuard · Cilium meshGCP PSC interface unidirectional: proxy → VPC onlyno transitive peering · fixed /26 Private Endpoint & DNS Ch 10 Internal VIP + split-horizon names OSS internal LB + CoreDNSGCP PSC endpoint + Cloud DNS tools.internal · db.internalperimeter rule checks caller + network Parameterized Tool Server Ch 3 MCP in · prepared SQL out · $1 = verified user OSS MCP Toolbox (OSS) · FastMCPGCP MCP Toolbox on Cloud Run north: MCP Streamable HTTP (JSON-RPC 2.0) · south: prepared statements · read / write splitnever generic execute_sql for autonomous multi-tenant agents Database with RLS / CLS Ch 5 Engine decides rows, columns, writes OSS PostgreSQL FORCE RLSGCP BigQuery · Cloud SQL · AlloyDB Row-Level · Column-Level Security · SECURITY DEFINER writesk-anonymity floor on aggregations Identity Policy & Ceiling Ch 13 Allow + explicit deny + max boundary OSS RBAC/ABAC + OPAGCP IAM allow · deny · PAB Infrastructure Guardrails Ch 13 Policy-as-code no project can skip OSS OPA Gatekeeper · KyvernoGCP Org Policy Adversarial Evaluation Gate Ch 13 Attack cases gate every deploy OSS promptfoo · garak in CIGCP adk eval · red team Kill Switch Ch 13 Deny, revoke, keep evidence OSS proxy deny + token revokeGCP kill-switch runbook no direct route agent → database 1 2 3 4 5 6 7 8 9 1 HTTPS · user JWT (OAuth 2.1 PKCE) 2 HTTPS · HMAC event · nonce + TTL 3–4 mTLS · SPIFFE cert + DPoP 6 mTLS tunnel into the private VPC (L4) 5 HTTPS/gRPC · Token_in → Token_obo · registry lookup 7–8 private DNS → MCP Streamable HTTP (JSON-RPC) 9 TLS DB wire · prepared SQL · $1 = verified user
Figure 0A — The platform-agnostic decomposition. Every box is named by its role; the two lines inside each box name an open-source implementation (OSS, cyan) and the Google Cloud guardrail (GCP, green) that plays that role in Figure 4 of Episode 01. The chapter badge tells you where the box is explained. Hop numbers 1–9 refer to this figure.
Proxy enforcement points Inline content guardrail Agent runtime & workload identity Private network, tool server, database Data perimeter

How "Model Armor" looks without the product name

The red boxes in Figure 0A are the one component that is easiest to misread as a Google-only feature. It is not: the proxy pauses a request or response, streams the body to an external processor over gRPC, and only forwards when the processor returns a verdict. Figure 0A-2 shows the four stages that processor runs. On Google Cloud the processor is Model Armor with Cloud Sensitive Data Protection; in the open-source stack it is an Envoy ext_proc callout to a classifier such as Llama Guard with a de-identification library such as Presidio.

INLINE CONTENT GUARDRAIL PIPELINE · ENVOY EXTERNAL PROCESSOR (ext_proc) OVER gRPC Ingress / Egress Proxy Envoy / Agent Gateway GCP: Model Armor + SDP envoy.filters.http.ext_proc failure_mode_allow: false Buffers payload, streams to guardrail, waits for verdict before forwarding gRPC verdict Guardrail Processor · OSS: Llama Guard + Presidio · GCP: Model Armor + Cloud SDP 1 · CANONICALIZE NFKC normalize Strip Unicode tag chars Decode Base64 / hex runs Flatten Markdown / HTML 2 · CLASSIFY Direct prompt injection Indirect injection in DB rows Malicious URL / image exfil Jailbreak & policy filters 3 · DE-IDENTIFY Detect PII (regex + ML) Replace with deterministic surrogate tokens [EMAIL_8f9a] 4 · VERDICT Clean → forward rewritten payload Match or timeout → 403 · fail closed
Figure 0A-2 — The Inline Content Guardrail is an out-of-process service the proxy consults on every request and response. On Google Cloud that service is Model Armor (with Cloud SDP for de-identification); in the open-source stack it is an Envoy ext_proc callout to a classifier.

Concept → open-source → Google Cloud: the master map

Every row below is one box in Figure 0A. The last two columns tell you which box it becomes in Figure 4 of Episode 01 and which chapter introduces it. The same strip repeats at the top of each chapter so the mapping is never more than one scroll away.

Concept (Figure 0A box)What it doesOpen-source implementationGoogle Cloud guardrailBox in Figure 4 (Episode 01)Explained in
Callers & Apps Browser · mobile · CLI · partner app OSSAny OAuth 2.1 client (PKCE) GCPSame (OAuth token) Customer Chat UI Ch. 1
Identity Provider Issues user JWT (sub, groups) · JWKS OSSKeycloak · Dex · any OIDC IdP GCPCloud Identity · Okta/Entra via Workforce IdF Corporate Sign-In Ch. 6
Events & Schedules Webhooks · queues · cron mandates OSSKafka · NATS · cron (HMAC-signed) GCPPub/Sub · Cloud Scheduler · Eventarc — (verified at the Ingress Gate; event-driven callers are covered in Episode 3) Ch. 7
Reverse Proxy (in) L7 policy enforcement point in front of agent OSSEnvoy Proxy GCPAgent Gateway (CLIENT_TO_AGENT) Ingress Gate Ch. 7
Caller Authentication Verify JWT / HMAC · RBAC decision OSSEnvoy ext_authz + OPA GCPIAM auth policy · IAP · Cloud Armor Who may invoke Ch. 7
Inline Content Guardrail Screen prompt & reply before the model OSSEnvoy ext_proc + Llama Guard + Presidio GCPModel Armor + Cloud SDP Model Armor Ch. 9
Rate & Budget Limiter Per-tenant token bucket · cost circuit OSSEnvoy ratelimit (Redis) GCPAgent Gateway quotas · Cloud Armor Rate Quotas Ch. 7
Agent Runtime Stateless container · any framework OSSContainer on Kubernetes GCPADK 2.x on Agent Runtime / Cloud Run 2. AI Agent · ADK 2.x Ch. 1
Deterministic Workflow + HITL Code nodes · one single-turn model node OSSLangGraph · state machine GCPADK 2.x Workflow + RequestInput Workflow & Quarantine Ch. 12
Workload Identity Short-lived X.509 SVID · no static keys OSSSPIFFE / SPIRE GCPAgent Identity (principal://…/AGENT_ID) Agent Identity · SPIFFE Ch. 4
Memory Store Sessions keyed by (tenant, user) OSSRedis · Postgres GCPMemory Bank OOB Session Ch. 12
Code Sandbox Generated code · no network · ephemeral OSSgVisor · Firecracker GCPAgent Platform Code Execution Code Sandbox Ch. 12
Forward Proxy (out) Default-deny exit for every outbound call OSSEnvoy Proxy (sidecar / egress gateway) GCPAgent Gateway (AGENT_TO_MCP) · Envoy sidecar Egress Gate Ch. 8
Caller Proof mTLS workload cert + sender-bound token OSSSPIFFE mTLS + DPoP (RFC 9449) GCPSPIFFE mTLS at Agent Gateway (DPoP on the exchanged token needs IdP support and an Envoy verifier) Who is calling Ch. 6
Destination AuthZ Agent scope ∩ user scope per target OSSEnvoy ext_authz + OPA GCPIAP access rules (CEL) May it call this Ch. 8
Inline Tool Guardrail Screen MCP / A2A args & returned rows OSSEnvoy ext_proc + Llama Guard GCPModel Armor (MCP and A2A) Model Armor + SDP Ch. 9
LLM Inference API Model endpoint reached only via egress proxy OSSvLLM · Ollama · any hosted model GCPGemini on Agent Platform Gemini on Agent Platform Ch. 8
Tool & Agent Registry Signed allowlist of MCP servers, agents, skills OSSGit catalogue + OPA bundle · Backstage GCPAgent Registry Agent Registry Ch. 8
Token Exchange Service User token Token_in → narrowed tool token Token_obo OSSKeycloak STS (RFC 8693) · Vault Transit GCPIdP token endpoint (RFC 8693) · Google Cloud STS · Cloud KMS Token Exchange · IdP / STS Ch. 6
Telemetry & Audit Sink Trace + immutable log of user & agent per call OSSOpenTelemetry · Loki/Tempo · WORM bucket GCPCloud Audit Logs · Cloud Trace · SCC Audit Logs · BQ Analytics · SCC Ch. 13
Private Application Network RFC 1918 only · no internet route OSSKubernetes NetworkPolicy · private subnets GCPYour VPC (no external IPs / NAT) YOUR VPC Ch. 10
Private Network Link L4 bridge from proxy into private VPC OSSWireGuard · Cilium ClusterMesh GCPPSC interface (network attachment) PSC Network Attachment Ch. 10
Private Endpoint & DNS Internal VIP + split-horizon names OSSInternal LB + CoreDNS GCPPSC endpoint + Cloud DNS private zone PSC Endpoint & DNS Ch. 10
Parameterized Tool Server MCP in · prepared SQL out · $1 = verified user OSSMCP Toolbox for Databases (OSS) · FastMCP GCPMCP Toolbox on Cloud Run (internal ingress) MCP Toolbox Ch. 3
Database with RLS / CLS Engine decides rows, columns, writes OSSPostgreSQL FORCE RLS · column GRANTs GCPBigQuery · Cloud SQL · AlloyDB 3. Database Ch. 5
Data Perimeter Identity + network boundary around data OSSSPIFFE federation + Cilium identity policy GCPVPC Service Controls VPC SERVICE CONTROLS PERIMETER Ch. 11
Identity Policy & Ceiling Allow + explicit deny + max boundary OSSRBAC/ABAC + OPA constraints GCPIAM allow, deny, PAB IAM Allow, Deny & PAB Ch. 13
Infrastructure Guardrails Policy-as-code no project can skip OSSOPA Gatekeeper · Kyverno GCPOrg Policy Org Policy Constraints Ch. 13
Adversarial Evaluation Gate Attack cases gate every deploy OSSpromptfoo · garak · CI job GCPadk eval · Evaluation and red team ADK Eval & Red Team CI Ch. 13
Kill Switch Deny, revoke, keep evidence OSSProxy deny rule + token revoke GCPKill switch runbook 3-Step Kill Switch Ch. 13

What travels on each wire (hops 1–9)

The arrows are contracts, not just lines. Each hop has a transport, an identity that must be on the wire, and a check the receiver must perform. Hop numbers refer to Figure 0A.

HopFrom → To (Figure 0A names and numbering)Transport & wire protocolIdentity on the wireWhat the receiver must verify
Hop 1Callers & Client Apps → Ingress Reverse ProxyHTTPS (TLS 1.3) · HTTP/2 · carries traceparentEnd-user OAuth 2.1 / OIDC JWT (Token_in) from Identity Provider via Authorization Code + PKCECaller Authentication (ext_authz) validates signature against IdP JWKS, iss, aud, exp; Rate & Budget Limiter applies tenant quota.
Hop 2Event & Schedule Sources → Ingress Reverse ProxyHTTPS push · JSON event envelopeDetached HMAC-SHA256 (X-Signature, X-Timestamp, X-Nonce) or short-lived scheduler OIDC JWTRecompute HMAC over raw body; reject if older than 300 s or nonce already seen; validate schema before the agent wakes up.
Hop 3Ingress Reverse Proxy → Agent RuntimeLoopback / Unix socket (sidecar) or mTLS HTTP/2 (gateway)Proxy workload cert + proxy-signed internal header with verified user_sub, tenant_idRuntime accepts only the proxy's identity; strips external headers; receives the already screened and de-identified prompt.
Hop 4Agent Runtime → Egress Forward ProxymTLS 1.3 over TCP (or UDS with peer check) · HTTP/2Agent workload cert (SPIFFE SVID) + DPoP proof (RFC 9449) + user token Token_inCaller Proof: extract SAN URI spiffe://…, verify DPoP signature matches key bound to token (cnf.jkt).
Hop 5Egress Forward Proxy → Registry · Token Exchange · LLM · AuditgRPC / HTTPS over TLS 1.3Registry: (agent_id, user_sub, target, tool) tuple · STS: subject_token=Token_in, actor_token=SVID, audience=tools · LLM: platform model token injected by proxyDestination Authorization = Agent scope ∩ User scope against the signed registry; STS returns 5-minute, audience-bound Token_obo with act claim; model output streams back through the guardrail.
Hop 6Egress Forward Proxy → Private Network LinkTCP over L4 private tunnel · carries outer mTLS sessionSource pinned to the link's /26 range + proxy workload certOnly proxy-initiated connections cross; unsolicited connections back into the agent platform are dropped.
Hop 7Private Network Link → Private Endpoint & DNSPrivate L4 routing (RFC 1918) + split-horizon DNSNetwork provenance (VPC + attachment id) + caller identityData Perimeter ingress rule requires both an allowed identity and an allowed source network.
Hop 8Private Endpoint → Parameterized Tool ServerMCP Streamable HTTP (HTTP/2 POST + JSON-RPC 2.0) over mTLSTransport: proxy client cert · Header: downscoped Token_obo (or KMS-signed context JWT for jobs)Tool server checks aud, extracts verified_sub = Token_obo.sub, validates arguments against JSON Schema; the model never supplies the user id.
Hop 9Parameterized Tool Server → DatabaseWarehouse: HTTPS/gRPC per query · OLTP: TLS 1.3 on the DB wire protocol via a poolWarehouse: per-query bearer Token_obo · OLTP: short-lived IAM DB token for the tool-server identity + $1 = verified_sub (or SET LOCAL)Database executes prepared statements only; Row-Level and Column-Level Security filter for verified_sub; writes go through SECURITY DEFINER procedures.
Hop ∗Every component → Telemetry & Audit SinkOTLP / gRPC over TLS 1.3 · append-only log streamWorkload identity with write-only permissionOne trace_id across all hops; every record carries both agent_id and user_sub.

The same map for other platforms

Because the concepts are stable, the substitution is mechanical. Google Cloud is the reference used in the episode; the other columns show that nothing in the design depends on it.

Concept (Figure 0A)Open-source / self-hostedGoogle Cloud (Figure 4, Episode 01)AWSAzure
Ingress Reverse Proxy + Caller Authentication + LimiterEnvoy + OPA ext_authz + Redis ratelimitAgent Gateway (CLIENT_TO_AGENT) + IAP + Cloud ArmorEnvoy on EKS + WAF + ALB OIDCEnvoy on AKS + App Gateway WAF + Entra EasyAuth
Inline Content Guardrail (both proxies)Envoy ext_proc → Llama Guard / NeMo Guardrails + PresidioModel Armor + Cloud SDPEnvoy ext_proc → Bedrock Guardrails + MacieEnvoy ext_proc → Azure AI Content Safety + Purview
Agent Runtime + Workload Identity + SandboxKubernetes + SPIRE + gVisorADK 2.x on Agent Runtime + Agent Identity + Code ExecutionBedrock AgentCore / EKS + IRSA + FirecrackerContainer Apps / AKS + Workload Identity + Dynamic Sessions
Egress Forward Proxy + Caller Proof + Destination AuthZEnvoy sidecar + SPIFFE mTLS + DPoP + OPAAgent Gateway (AGENT_TO_MCP) + IAM access policies (CEL), or Cloud Run Envoy sidecarEnvoy sidecar + VPC Lattice + Verified PermissionsEnvoy sidecar + APIM self-hosted gateway + NSG
Tool & Agent RegistrySigned Git catalogue + OPA bundles / BackstageAgent RegistryService Catalog + Parameter StoreAzure API Center
Token Exchange ServiceKeycloak / Ory Hydra (RFC 8693) + Vault TransitIdP token endpoint (RFC 8693) + Google Cloud STS + Cloud KMSAWS STS / Cognito + KMS SignEntra OBO flow + Key Vault HSM
Private Network Link + Private Endpoint & DNSWireGuard / Cilium ClusterMesh + CoreDNSPSC interface + PSC endpoint + Cloud DNS private zonePrivateLink interface endpoint + Route 53 private zonePrivate Link service + Private Endpoint + Private DNS zone
Data PerimeterSPIFFE federation + Cilium identity-aware policyVPC Service ControlsAWS data perimeter (SCP + VPC endpoint policies)Network Security Perimeter + Conditional Access
Parameterized Tool ServerMCP Toolbox for Databases (OSS) / FastMCPMCP Toolbox on Cloud Run (internal ingress)MCP Toolbox on Fargate + RDS Proxy IAM authMCP Toolbox on Container Apps + Managed Identity
Database with RLS / CLSPostgreSQL 16 FORCE RLS + column GRANTs + SECURITY DEFINERBigQuery (policy tags, row access policies) · Cloud SQL / AlloyDB (parameterized secure views, PG RLS)Redshift RLS/CLS · Aurora PostgreSQL RLSFabric / Synapse RLS + DDM · Azure PostgreSQL RLS
Governance Control PlaneOPA Gatekeeper / Kyverno + promptfoo / garak CIIAM allow/deny/PAB + Org Policy + adk eval + kill switchSCPs + Config + Bedrock evaluationsAzure Policy + Defender + AI Foundry evaluations

Back to the episode

Return to Figure 4 of Episode 01, where the Google Cloud column is switched on and built one box at a time from Chapter 3 to Chapter 13.