DEV Community

Imran Siddique
Imran Siddique

Posted on • Originally published at Medium on

Governing Google ADK Agents with Microsoft’s Open-Source Toolkit: A GCP-Native Guide

How to add deterministic policy enforcement to your Google ADK agents on GKE

I’m going to share a combination that might initially seem counterintuitive: Microsoft’s best open-source security toolkit runs natively on Google Cloud, securing Google ADK agents. No Azure subscription is required. No vendor lock-in exists. It is a simple pip install away.

The Agent Governance Toolkit (AGT) is an MIT-licensed runtime governance layer for AI agents. It is cloud-agnostic and framework-agnostic. It functions as a Python middleware layer that intercepts agent actions, tool calls, API requests, and inter-agent messages, enforcing policies before execution occurs.

If you are building agents with Google ADK and deploying on Google Kubernetes Engine (GKE), this guide provides a path to a governed production environment in under 10 minutes.

The Problem AGT Solves

Google ADK provides a high-performance framework for agent construction, but it is not a deterministic security engine. To move beyond “vibe-based” security to a system that meets the requirements of a CISO or the EU AI Act (August 2, 2026), you need more than system prompts.

  • Runtime Action Control: Hard-coded blocking of dangerous calls like execute_code or modify_iam.
  • Audit Trails: A forensic record of why an action was permitted or denied, stored outside the LLM context.
  • Content Filtering: Preventing agents from leaking PII (SSNs, passwords) in tool arguments or model responses.
  • Deterministic Latency: Governance that runs in-process to avoid adding network hops to already latent LLM calls.

Architecture: Scale by Subtraction on GCP

Deploying AGT within your GKE cluster follows the principle of Scale by Subtraction. By integrating governance at the kernel level within your existing Python process, you subtract the complexity of managing external security proxies or cross-cloud dependencies.

Step 1: The 5-Line Quick Start

Govern your tool calls locally before containerization. Note that this logic is deterministic, not probabilistic.

from agent_os.lite import govern

# Define governance policy: Deterministic, not prompt-based
check = govern(
    allow=["google_search", "read_file", "summarize"],
    deny=["execute_code", "delete_file", "modify_database"],
    blocked_content=[r'\b\d{3}-\d{2}-\d{4}\b'], # Block SSN patterns
)
# Wrap your tool calls
def governed_tool_call(tool_name: str, args: dict):
    # Intercepts and validates before the tool executes
    check(tool_name, content=str(args)) 
    return call_original_tool(tool_name, args)
Enter fullscreen mode Exit fullscreen mode

Step 2: Full Google ADK & Vertex AI Integration

In this updated example, we use Gemini 2.0 Flash. Because AGT runs in-process, it adds sub-0.1ms overhead, preserving the low-latency benefits of the Flash model.

from google.adk.agents import Agent
from google.adk.tools import Tool
from agent_os.lite import govern, GovernanceViolation

# Governance Layer: Configured for Enterprise Standards
check = govern(
    allow=["google_search", "read_gcs", "summarize"],
    deny=["delete_gcs", "modify_iam"],
    blocked_content=[r'\b(?:\d[-]*?){13,16}\b'], # Credit Card patterns
    log=True,
)
def governed_read_gcs(bucket: str, path: str):
    """A tool that requires verified governance before access."""
    check("read_gcs") 
    # Logic to interface with GCS via Workload Identity
    return f"Contents of gs://{bucket}/{path}"
agent = Agent(
    model="gemini-2.0-flash",
    name="governed-researcher",
    tools=[
        Tool(func=governed_read_gcs, description="Read data from GCS"),
    ],
)
Enter fullscreen mode Exit fullscreen mode

Step 3: Containerize and Deploy to GKE

Dockerfile

FROM python:3.12-slim
WORKDIR /app
# Install core dependencies and GCP logging
RUN pip install --no-cache-dir agent-os-kernel google-adk google-cloud-logging
COPY agent.py .
CMD ["python", "agent.py"]
Enter fullscreen mode Exit fullscreen mode

GKE Deployment Configuration

Deploying to GKE allows governance to scale horizontally with your agent replicas.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: governed-adk-agent
spec:
  replicas: 3
  template:
    spec:
      containers:
        - name: agent
          image: gcr.io/YOUR_PROJECT/governed-adk-agent:latest
          env:
            - name: GOOGLE_CLOUD_PROJECT
              value: "your-project-id"
Enter fullscreen mode Exit fullscreen mode

Step 4: Observability and Compliance

Don’t just block actions; record them for the auditors. AGT’s audit trail integrates with Google Cloud Logging , which can then be exported to BigQuery for automated compliance reporting.

import google.cloud.logging
import logging

# Initialize GCP Logging
client = google.cloud.logging.Client()
client.setup_logging()
logger = logging.getLogger("agt.governance")
# After agent execution, flush the audit trail to GCP
for decision in check.audit_trail:
    logger.info("governance_decision", extra={"json_fields": decision.to_dict()})
Enter fullscreen mode Exit fullscreen mode

Manager’s Math: The Trade-off Analysis

Strategic Considerations for 2026

  • Workload Identity & OIDC: AGT’s AgentMesh identity layer can map directly to GCP’s Workload Identity. This allows you to verify that the “Agent” calling a GCS bucket is not just authenticated via a service account but authorized via a governance policy.
  • The 2026 Compliance Window: With the EU AI Act becoming enforceable, “best effort” security is no longer a legal defense. Moving policy enforcement from the prompt to the execution kernel is a prerequisite for high-risk AI deployment.
  • Vertex AI Extensions: While Vertex AI Extensions handle authorization, AGT handles interception and inspection. They are complementary, not competitive.

Links

The Agent Governance Toolkit is MIT-licensed and functions across all major cloud providers. Star it on GitHub if it provides value to your engineering stack.

Top comments (0)