QuestionQ57

VerifiedSecuring and governing agentic workflows

You are deploying an autonomous coding agent on Google Kubernetes Engine (GKE) to run user-requested Python scripts. To isolate untrusted code execution, you enabled GKE Agent Sandbox with gVisor to intercept container system calls in user space. During a security audit, you find that an untrusted Python script generated by a prompt injection attack successfully fetched IAM identity tokens by sending an HTTP request to the link-local instance metadata server at 169.254.169.254.

You need to prevent sandboxed code from exfiltrating metadata tokens while maintaining container kernel isolation.

What should you do?

Explanation

An egress NetworkPolicy can prevent the sandbox Pod from initiating requests to the metadata server while gVisor continues to provide kernel isolation. Configure the policy so that no applicable egress rule permits metadata access; the effective metadata address depends on the GKE dataplane. (docs.cloud.google.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!