← Blog

Google ADK Security: A Production Deployment Acceptance Guide

Parminder Singh
Parminder Singh··6 min read
Summarize with AI

Google ADK exposes security controls across identity, tool authentication, callbacks, plugins, Model Armor, sandboxing, network controls, session handling, and observability. This guide turns those separate mechanisms into a production acceptance record with failed-request tests, named owners, and a precise boundary for routed LLM traffic.

Platform & Architectureai-securityagentic-aiidentity-and-authorizationpolicy-enforcementarchitecture
Google ADK Security: A Production Deployment Acceptance Guide

Google Agent Development Kit (ADK) places security decisions across the application and its surrounding infrastructure. Tool identities constrain external actions. Callbacks and plugins can inspect model or tool activity. Model Armor can screen selected model input and output. Credential services hold tool secrets. Sandboxes and network controls contain execution and egress. Production approval requires evidence that each mechanism operated at its assigned boundary.

I would run this as a deployment acceptance test, not a settings review. The record should contain denied requests and blocked content; expired credentials and isolated sessions; constrained tools and attempted egress. A polished architecture diagram is context. Failed operations under the production configuration are the evidence.

TL;DR

  • ADK security spans agent identity and controlling-user identity; tool authorization and credentials; callbacks and plugins; sandboxing, sessions, plus egress.
  • Model Armor can screen recent user input and model output, while tool function_response parts are skipped.
  • Production acceptance needs negative tests for each boundary. Every residual path also needs a named owner.
  • DeepInspect covers only authenticated model input and output deliberately routed through its HTTP enforcement point.

Start with the ADK threat and control boundaries

The ADK safety and security guide names prompt injection and jailbreak attempts; indirect injection through tools and unsafe actions; sensitive-data leakage and data exfiltration among the risks an agent deployment should assess. It then distributes mitigations across identity and tool design; model safety features and callbacks; plugins and sandboxing; evaluation and tracing; network controls such as VPC Service Controls.

That list should become an owner map. Assign one owner to model input and output screening and another to tool authorization and credential custody. Name the owners of session storage, code execution, network egress, UI rendering, traces, and incident evidence. Some owners may be the same team, but the tests remain separate because the mechanisms fail differently.

This deployment baseline complements the wider AI agent security guide. It avoids retelling a named ADK incident. The question here is direct: can this exact build pass the controls required for production under its configured identities, tools, routes, and data stores?

Agent identity and user identity require separate tests

ADK describes two common ways a tool reaches an external system. The tool may act as the agent through a service account, or it may act with the controlling user's delegated credential. A shared service account can fit a task where every user has the same permitted access. It becomes risky when users have different rights because downstream events appear under the agent's identity unless the application preserves user attribution.

Delegated user authorization narrows actions to what the user can perform, subject to the scopes and controls of the external system. OAuth scopes can still be broader than one agent task needs. Tool implementation should therefore enforce deterministic limits using developer-controlled context and downstream permissions rather than trusting model-supplied arguments.

Test both identities with two authenticated users who have visibly different resource access, plus one service account. Ask each principal to read a permitted object and a prohibited one. Then attempt a write through a read-only tool. The post-authentication gap appears when verified user context disappears before the downstream authorization decision.

Tool credentials need production custody and lifecycle evidence

ADK's tool authentication documentation warns that access tokens and especially refresh tokens stored directly in session state can create security risk. For hosted production deployments, it recommends an authentication manager service that handles secrets and OAuth tokens. A dedicated secret manager is the documented alternative when the application manages authentication itself. In-memory storage is positioned for early development and testing.

The acceptance record should identify where client secrets and service-account material live, along with access tokens and refresh tokens. It should show encryption and read permissions; rotation and revocation; expiry handling; the binding between a credential and its authenticated user. Short-lived references in session memory reduce exposure, but the long-lived source still needs an owner and access record.

Run a revoked-token test and an expired-token test. Confirm that the tool receives a denial and clears or replaces stale cached material according to the application design. It must also avoid replaying a secret into logs or model context. I would reject a production design that uses session state as the long-term refresh-token store simply because the demo flow already works there.

Callbacks, plugins, and Model Armor have distinct coverage

ADK callbacks can validate behavior around a particular agent or model operation, as well as a tool operation. Plugins apply reusable policy at the runner or application level. Their registration scope matters. Acceptance should enumerate every runner and agent entry point, then prove that the intended callback or plugin fires on each one.

The ADK Model Armor integration uses model callbacks to screen the most recent user content before model execution and the model reply before or during delivery. Input and output templates are independently optional. Screening failures block by default unless block_on_screening_failure is set to false. A blocked turn carries model_armor_blocked metadata.

Model Armor coverage has an explicit edge because the plugin skips tool results that arrive as function_response parts. Test a direct user prompt and a model response, followed by a Model Armor outage and sensitive content returned by a tool. The last case should reach the separately assigned tool-result control. A single successful prompt-injection block proves one path, not application-wide coverage. The prompt injection detection guide provides the wider request-level test pattern.

Tool actions, code execution, egress, and UI output retain their own owners

ADK recommends designing narrow tools that expose only intended actions and validating model arguments against developer-controlled tool context. Downstream permissions should constrain the actual resource operation. A model instruction can ask for a write, but a read-only database identity should still reject it.

Model-generated code needs a sandbox with explicit filesystem and process limits, plus resource and network limits. Network controls should restrict destinations that the agent and its tools can reach. UI output needs context-appropriate escaping before rendering. Session storage needs tenant isolation, encryption, deletion rules, and access controls. Traces and debug files need their own retention and investigator grants because they can contain prompts and tool-side state, including arguments.

Put these checks on one release page. Draw the authenticated user in a blue box at the left and the ADK runner in the center. Place every model or tool destination on the right. Mark each credential in orange and every stored copy below the flow. That picture usually exposes an unowned callback or export, including a session copy, before the test begins.

Build a deployment acceptance record

A production decision should include at least these artifacts:

  • Identity: tested agent and user principals, denied cross-user access, delegated scopes, and downstream permissions.
  • Credentials: storage service, encryption, reader roles, rotation, expiry, revocation, and session references.
  • Model screening: callback or plugin registration, input and output templates, failure posture, blocked metadata, and uncovered content types.
  • Tools: allowed operations, developer-controlled constraints, prohibited-action tests, and user attribution.
  • Runtime: sandbox profile, filesystem and process limits, resource ceilings, and network egress policy.
  • State and evidence: tenant isolation, retention, debug-file handling, traces, exports, and investigator access.
  • Model routes: endpoint inventory, authentication, bypass test, versioned policy, and correlation to the ADK run.

For every case, record the exact build and configuration revision; the test timestamp and principal; the expected and actual results; the evidence location. An exception needs a named owner and expiry date. Security acceptance is a release decision with retrievable proof, not a permanent label attached to the framework.

DeepInspect

DeepInspect covers authenticated model input and output deliberately routed over HTTP from the ADK application to an LLM endpoint. The application supplies caller identity and role context. DeepInspect evaluates prompt classification and destination under versioned policy before forwarding allowed traffic, then records the request decision independently.

That boundary excludes tool authorization, OAuth exchanges, credential stores, session state, callbacks, code sandboxes, VPC controls, UI escaping, local execution, traces, and cloud exports. Those controls retain the owners named in the ADK acceptance record. Direct model calls that bypass the configured route also remain outside DeepInspect's visibility.

Book a technical deep dive at deepinspect.ai.

Frequently asked questions

Does Google ADK secure every tool action automatically?

ADK supplies patterns and hooks for authentication and deterministic tool constraints, along with callbacks and plugins. The application still defines tool permissions and credential custody, plus downstream authorization and developer-controlled validation. Test the prohibited action against the actual external system instead of stopping at a mocked callback result.

Does Model Armor inspect tool responses in ADK?

The documented plugin screens recent user content and model output. It skips tool results represented as function_response parts. Assign tool-return validation to a separate control and test it directly. Also test the configured behavior when the Model Armor service returns a failure rather than a successful verdict.

Should ADK store OAuth refresh tokens in session state?

ADK warns that sensitive credentials in session state carry risk. Its production guidance favors authentication-manager or secret-manager services. If session memory holds a short-lived token or reference, document its lifetime and tenant binding; its encryption and exposure to clients; its deletion behavior.

What proves an ADK deployment passed security acceptance?

The record should contain actual denied and blocked operations under the release configuration. Include identity tests and credential lifecycle failures; tool permission checks and Model Armor coverage; sandbox restrictions and egress attempts; session-isolation tests and model-route evidence. Preserve configuration revisions and raw results so another reviewer can reproduce the decision.