Vertex AI Double Agents: When Service-Agent Defaults Become an Agentic Cloud Boundary
Unit 42 showed how a deployed Vertex AI Agent Engine workload could become a "double agent" by extracting Google-managed service-agent credentials from its runtime and using those permissions to read customer project storage, inspect restricted Google-managed artifacts, and expose sensitive deployment files. Google updated documentation and recommends Bring Your Own Service Account (BYOSA), but the larger lesson is broader: an AI agent's cloud identity, runtime scopes, deployment artifacts, and network reach are one security boundary.
Threat Analysis
- The agent runtime inherited a powerful managed identity. Unit 42 focused on Vertex AI Agent Engine's P4SA, a Google-managed service account used by Vertex AI to access service resources.
- Credential exposure turned agent code into cloud access. A malicious agent tool queried Google's metadata service, extracted the service-agent token, and used that identity outside the normal agent flow.
- The first pivot crossed into the customer project. With the token, the researchers reported read access to Google Cloud Storage buckets in the consumer project.
- The second pivot exposed provider-side artifacts. The same identity could read restricted Google-owned Artifact Registry repositories and download internal Vertex AI Reasoning Engine images. Google said separate controls blocked production image modification.
- The tenant project added deployment leakage. Files such as
Dockerfile.zip,code.pkl, andrequirements.txtrevealed internal paths and implementation details. Pickle-based serialization also raised a code-execution concern if the file could be manipulated. - The mitigation is not just one patch. Google revised documentation and pointed users toward BYOSA; defenders still need least-privilege identities, scoped OAuth access, artifact controls, segmentation, and monitoring.
Applicable AIDEFEND Defenses (8)
code.pkl file make artifact governance part of the lesson. Agent packages, container images, and runtime bundles should be promoted only from approved registries with signatures, immutable digests, provenance records, and checks that reject unsafe serialization or unexpected dependencies.What Defenders Should Do Now
- Inventory every Vertex AI Agent Engine deployment and record its runtime identity, P4SA, BYOSA status, OAuth scopes, staging bucket, Artifact Registry access, and owner.
- Move production agents to dedicated BYOSA identities where available. Give each identity only the storage buckets, model endpoints, registries, and APIs needed for that specific agent workflow.
- Block or tightly control metadata-service token access from agent tools. Treat any agent function that reads instance metadata, environment credentials, or cloud tokens as a high-risk action that needs review and logging.
- Review GCS and Artifact Registry permissions granted to Vertex AI-related service accounts. Remove broad list/read permissions that are not required, especially across tenant, build, staging, and production boundaries.
- Promote agent code and container artifacts through signed release gates. Prefer non-executable or safer serialization formats where possible, and reject unexpected pickle-based execution paths in production deployment flows.
- Add detections for service-agent anomalies: unusual bucket enumeration, reads from restricted registries, metadata-token access, Workspace API attempts, and actions from managed identities outside their normal project or service path.
1 additional consideration
Managed AI service identity transparency
Conclusion
The Vertex AI case is not just about one cloud permission surprise. It shows how an AI agent platform can turn managed identity, runtime packaging, metadata services, and provider-side artifacts into one connected trust boundary. AIDEFEND maps strongly to secure baselines, service authentication, agent identity governance, capability scoping, segmentation, artifact release gates, and monitoring. The practical goal is simple: a deployed agent should have a name, a narrow job, a narrow identity, a narrow network path, and evidence for every place it is allowed to reach.