initializdocs
DeveloperAgent SDK

Govern an ADK agent

Run a Google ADK (Python) agent as a governed adk runtime — the initializ-adk package, zero-code activation via the shipped .pth, the serve entrypoint and the ADK App option for context caching, authenticated A2A, gateway egress for Gemini, and the wheel-image wrapper build.

Agents built on Google ADK run on the platform as the governed adk runtime — the third governed runtime beside claude-agent and strands. The shape matches the Strands package exactly: your CI installs the initializ-adk Python package into the agent's unchanged image, and the package activates itself on every interpreter start — zero agent-code change and zero change to the agent's locked dependency set.

What's different from Strands is what the package hooks. ADK agents are driven by an ADK Runner, so initializ-adk instruments the Runner itself: one injected plugin observes the model, tool, agent, and run lifecycle callbacks for the whole agent tree — the root agent, every sub-agent it transfers to, and their tools — without touching any of them.

The initializ-adk package

initializ-adk (Python ≥ 3.10) has zero hard runtime dependencies — Google ADK itself is your app's dependency, and the governance calls use only the standard library. One extra exists: [a2a], which the governed image installs so the serve entrypoint can expose the agent over A2A.

Activation is zero-code: the wheel ships an initializ_adk.pth file that Python executes on interpreter start — the same mechanism as initializ-strands, and the Python analog of the Node loader's import flag. It instruments the ADK Runner so the audit plugin rides along in whatever process your image runs. The hook is guarded: when ADK isn't importable, or INITIALIZ_ADK_AUTO=0 is set, it is a safe no-op.

What governance does to an ADK agent

  • Audit of the full run lifecycle. Session start, every model call — with the model, the provider, and per-call token usage taken from the model response's own usage metadata, counted once per inference so the Usage view sums correctly — every tool call's start and end, agent transfers within the tree, and run completion. Failed runs close their timeline too.
  • A populated executions list. A per-invocation session snapshot is pushed to the platform — for failed runs as well — so the agent's execution list and per-run transcripts fill in the console like any platform-built agent's.
  • Payload capture on the standard evidence fields. By default audit events carry content hashes and lengths; when the deploy spec enables audit.capture, bounded raw prompts, completions, and tool arguments/results are attached on the same fields the console renders for every runtime. Raw payloads only ever travel the audit ingest path — the local fallback log is content-free.
  • Model traffic pinned to the managed gateway. The deploy spec's model.provider selects the gateway; for gemini the package routes the Google GenAI client — both the ADK model calls and tools' direct grounding calls — onto the gateway's native Gemini endpoint, with the platform-injected credential wired in. The image carries no model credential of its own.

Two governance features of the other runtimes are not yet wired for ADK: per-call policy enforcement (ADK tool and model calls are fully audited, but a policy deny does not cancel the call yet) and platform MCP connections injection. Both arrive runtime-side; the deploy spec surface is already uniform.

The serve entrypoint

Unlike the Strands kit, you write no server code at all: the package's serve entrypoint loads your agent and exposes it over A2A using ADK's own native A2A support, fronted by platform authentication. The agent to serve is named module:attribute — the same reference adk web uses:

python -m initializ_adk.serve webapp.agent:root_agent

The reference can also come from the INITIALIZ_ADK_AGENT environment value, which is how a platform deploy supplies it — type: adk deploys start the image through this entrypoint. The served endpoint:

  • Builds the Agent Card and A2A skills from the agent itself — there is no executor to author.
  • Authenticates inbound calls, fail-closed. ADK's native A2A serving has no auth of its own, so the package fronts it: each caller's bearer token is verified against the platform and must belong to the agent's workspace; verification failures are rejected and every check is audited. The card discovery path stays public, as the A2A spec expects. a2a.auth: none in the deploy spec opts out (local development).
  • Correlates the task end-to-end. The inbound task becomes the audit invocation for everything the run does, exactly as for the other governed runtimes.

Serving an ADK App

The agent reference may name a bare agent or an ADK App. Point it at an App when you need App-level configuration — chiefly context caching (context_cache_config): a multi-agent ADK tree re-sends the accumulated prompt after every agent transfer, and without App-level caching each re-send is uncached, which multiplies input-token cost on orchestrator-style agents. App resumability and event compaction settings apply the same way.

INITIALIZ_ADK_AGENT=webapp.agent:root_agent   # bare agent
INITIALIZ_ADK_AGENT=webapp.agent:app          # ADK App — context caching etc.

Governance is identical either way — the audit plugin is injected into the App's plugin set, and the served card and skills are the App's root agent's.

Ship the governed image

Identical in shape to the Strands wrapper build: the governance wheel ships as an OCI image (ghcr.io/initializ/adk-pkg), and a wrapper build step copies the wheel out of it and pip-installs it into the same interpreter your app uses — your app's Dockerfile and lockfile stay untouched. Pin a v<version> tag; v0 tracks latest.

deploy/initializ-governance-adk.Dockerfile
ARG ADK_PKG_IMAGE=ghcr.io/initializ/adk-pkg:v0
ARG AGENT_IMAGE
ARG INITIALIZ_ADK_AGENT=webapp.agent:root_agent

FROM ${ADK_PKG_IMAGE} AS adkpkg

FROM ${AGENT_IMAGE}
ARG INITIALIZ_ADK_AGENT
COPY --from=adkpkg /wheels /tmp/initializ-wheels
RUN pip install --no-cache-dir "$(ls /tmp/initializ-wheels/initializ_adk-*.whl)[a2a]" \
 && rm -rf /tmp/initializ-wheels

ENV INITIALIZ_ADK_AGENT=${INITIALIZ_ADK_AGENT}
EXPOSE 8080
CMD ["python", "-m", "initializ_adk.serve"]

Build → wrap → push → deploy, with agent.type: adk:

initializ-deploy.yaml (excerpt)
agent:
  name: research-orchestrator
  type: adk

model:
  provider: gemini

No platform configuration is baked into the image: identity, the gateway endpoint and credential, and audit wiring are injected at deploy time, so one governed image promotes across environments — including to an AWS AgentCore environment with runtime: agentcore. See the adk runtime reference for the full spec surface and Deploy a CI-built agent for the surrounding pipeline.

On this page