git:20260521.94c412d to git:20260521.27b4bc9
10 added, 12 removed. Audit A to A.
---
name: review-security-k8s-agents-firewall
description: Reviews Kubernetes configurations for AI agent and sandbox firewall security.
---
-
- # Instructions
- You are a security expert specializing in AI agents running on Kubernetes. Your task is to review Kubernetes network policies and firewall configurations that apply specifically to AI agent control loops and their associated execution sandboxes.
-
- ## Focus Areas & Deterministic Checks:
+ # Task
+ Review network policies and firewall configs for AI agent control loops and execution sandboxes.
- ### 1. Egress Restrictions & Sandbox Constraints
- - **Sandbox Network Constraints**: Evaluate the egress policies applied to execution sandboxes. While a strict air-gap is the most secure posture, some agent tools require limited network access. Ensure the sandbox network policy enforces a default-deny egress rule and explicitly whitelists only the absolute minimum required internal or external IP ranges/services.
- - **Internal API Protection**: Verify that neither the agent pod nor its execution sandbox can arbitrarily access internal cluster APIs, other Kubernetes services, or sensitive cloud metadata endpoints (e.g., `169.254.169.254`).
- - **Data Exfiltration Vectors**: Flag any broad egress rules (e.g., `0.0.0.0/0`) applied to agent pods, as these provide trivial pathways for a prompt-injected agent to exfiltrate sensitive data.
+ # Checks
+ ## 1. Egress Restrictions
+ - **Sandbox Network**: Enforce default-deny egress. Allowlist absolute minimum required IPs/services.
+ - **Internal APIs**: Block agent/sandbox access to internal cluster APIs, K8s services, and cloud metadata (e.g., `169.254.169.254`).
+ - **Exfiltration Vectors**: Flag broad egress (e.g., `0.0.0.0/0`) on agent pods.
- ### 2. Ingress & Invocation Security
- - **Authorized Upstream Sources**: Review ingress rules for the agent API. Ensure that only trusted upstream services (like an authentication gateway or backend orchestrator) or authorized users can invoke the agents.
- - **Bypass Prevention**: Flag any architecture where the main agent container is exposed via a LoadBalancer or NodePort without a strict ingress NetworkPolicy, which could allow internal network attackers to bypass the designated API gateway or WAF.
+ ## 2. Ingress & Invocation
+ - **Authorized Sources**: Restrict agent API ingress to trusted upstream services (auth gateways, orchestrators).
+ - **Bypass Prevention**: Flag LoadBalancer or NodePort exposure on main agent containers lacking strict ingress NetworkPolicies.