Skip to main content
Google's APK Agent Flaw: What Happens When AI Talks to AIIncident
4 min readFor Security Engineers

Google's APK Agent Flaw: What Happens When AI Talks to AI

What Happened

Google recently patched a vulnerability in APK for Python that allowed attackers to exploit trust boundaries between AI agents with different privilege levels. This flaw enabled a potential supply chain compromise. A low-privilege agent could manipulate interactions with a higher-privilege agent, injecting malicious instructions or exfiltrating sensitive data during automated workflows.

The vulnerability arose from two issues. First, the framework assumed agents at different privilege levels could communicate safely without additional validation. Second, it relied on the calling agent's self-reported privilege level instead of cryptographic verification.

Timeline

While Google hasn't shared a detailed timeline, the pattern is familiar:

  1. Initial deployment: APK for Python ships with agent-to-agent communication features for automation workflows.
  2. Discovery: Security researchers find that privilege boundaries between agents can be crossed.
  3. Exploitation window: The flaw remains exploitable in production environments using affected versions.
  4. Patch release: Google issues fixes to address trust boundary validation.
  5. Remediation period: Organizations using APK for Python must identify affected deployments and update.

The critical window isn't just between discovery and patch release. It's the time your team takes to identify where you're running AI agent frameworks and whether those agents interact across privilege boundaries.

Which Controls Failed or Were Missing

Input validation at privilege boundaries. The framework accepted instructions from lower-privilege agents without verifying the source's authority. This violates the principle that every trust boundary is an attack surface.

Cryptographic verification of agent identity. The system relied on agents self-reporting their privilege level. You wouldn't let a web request claim "I'm an admin" without verifying credentials. The same principle applies when Agent A calls Agent B.

Least privilege for automated agents. If your automation framework allows agents to operate at different privilege levels, you've created conditions for this attack. Why does any agent need elevated privileges?

Supply chain component inventory. Many teams didn't know they were running this vulnerability. AI frameworks often get pulled in as dependencies, wrapped in automation tools, or deployed by data science teams outside your security review process.

What the Relevant Standards Require

OWASP ASVS v4.0.3 Requirement 4.1.3 specifies that trust boundaries must enforce authorization. When Agent A calls Agent B, that's a trust boundary. The framework must verify that Agent A has permission to invoke Agent B's functions, regardless of what Agent A claims about itself.

NIST 800-53 Rev 5 Control AC-3 requires access enforcement at all trust boundaries. An AI agent is a subject requesting access to resources. The fact that both subject and object are automated doesn't exempt them from access control requirements.

ISO 27001 Control 8.3 addresses privileged access rights. If your AI agents run with different privilege levels, you need technical controls to prevent privilege escalation, logging to track privileged actions, and regular reviews of which agents hold elevated access.

PCI DSS v4.0.1 Requirement 6.2.4 mandates that custom code follows secure coding practices, including input validation. When Agent B accepts instructions from Agent A, those instructions are input. They require the same validation you'd apply to user input, API calls, or database queries.

The gap isn't that standards don't cover AI agents. It's that teams treat agent-to-agent communication as internal plumbing rather than an attack surface.

Lessons and Action Items for Your Team

Map your AI agent topology. Diagram which agents talk to which other agents, what privilege level each operates at, and what resources each can access. Start with your CI/CD pipelines, deployment automation, and any "agentic" features in your development tools.

Implement cryptographic agent authentication. Before Agent B executes instructions from Agent A, verify Agent A's identity using mutual TLS, signed tokens, or service mesh authentication. Self-reported privilege levels are not authentication.

Eliminate cross-privilege agent communication. If Agent A runs at low privilege and Agent B runs at high privilege, they shouldn't talk directly. Route the request through an authorization service that validates the operation, or redesign so both agents run at the minimum privilege needed.

Add agent interaction to your threat model. When reviewing new features or automation, ask: "Which agents will this introduce? What privilege level will they need? Who can send them instructions?" Treat agent deployment like you treat service account creation.

Audit dependencies for agent frameworks. Run pip list, npm list, or equivalent and search for packages containing "agent", "llm", "ai", or "autonomous". Check whether those packages enable agent-to-agent communication. If you don't know what they do, that's your answer about whether they're secure.

Log agent-to-agent calls. Your SIEM should capture when Agent A invokes Agent B, what operation was requested, and what privilege level Agent A claimed. This creates an audit trail for investigating incidents and detecting anomalous agent behavior.

Test privilege escalation paths. Add test cases that attempt to make a low-privilege agent issue commands to a high-privilege agent. If your framework allows it, you have the same vulnerability Google just patched.

The broader lesson: AI agents are subjects in your access control model, not magic automation that bypasses security architecture. Every agent needs authentication, authorization, and audit logging. Every agent-to-agent call crosses a trust boundary that requires enforcement.

If you're running APK for Python, update immediately. If you're running any framework where AI agents interact, assume you have this class of vulnerability until you verify the controls above are in place.

Mutual TLS

Topics:Incident

You Might Also Like