Skip to main content
When complete, each agent workload will have a pod-scoped containment policy committed alongside its Kubernetes manifests and enforced at the VPC boundary by the Aviatrix controller. Permitted destinations (model provider APIs, tool endpoints, MCP servers) are declared per agent. Everything else is denied and logged. East-West policy prevents a compromised agent from pivoting to adjacent workloads in the cluster or the transit fabric. For the business case and architecture overview, see Securing AI Agent Workloads.

Prerequisites

  • Aviatrix Controller 8.2 or later
  • CoPilot 4.31 or later
  • DCF for Kubernetes enabled with Log Enrichment turned on
  • A cloud account onboarded in CoPilot for the cloud provider hosting the Kubernetes cluster
  • AI agent workloads deployed as Kubernetes pods (LangGraph, AutoGen, CrewAI, or a custom runtime)

Procedure

1

Deploy an Aviatrix spoke gateway in the cluster VPC

An Aviatrix spoke gateway in the same VPC as your Kubernetes cluster is the enforcement point where the Aviatrix controller applies containment policy to MCP server egress traffic.
  1. In CoPilot, navigate to Cloud Fabric > Gateways > Spoke Gateways and click + Spoke Gateway.
  2. Provide the following details:
  3. In the Instances section, select a subnet in the cluster VPC for the gateway instance.
  4. Click Save.
Wait for the gateway status to show Up before continuing. You can monitor progress at CoPilot > Monitor > Notifications > Tasks.
2

Install the Aviatrix Kubernetes Firewall Helm chart

The Aviatrix Kubernetes Firewall Helm chart deploys the in-cluster components that allow the Aviatrix controller to reconcile and enforce containment policies on the cluster.Run the following command against the target cluster, replacing <chart-version> with the current chart version from the Aviatrix k8s-firewall-charts repository:
3

Verify Aviatrix CRD installation

The Helm chart installs two Aviatrix CRDs on the cluster. Verify both are present before continuing:
Expected output:
If either CRD is missing, re-run the Helm installation and check the output for errors.
4

Onboard the Kubernetes cluster to Aviatrix DCF

  1. Navigate to Cloud Resources > Cloud Assets > Kubernetes Clusters.
  2. Click Onboard next to the target cluster.
  3. Choose the appropriate access method for your cloud provider:
    • AWS (EKS): Select Terraform or Command Line, apply the generated access entry and RBAC configuration, check the confirmation box, then click Onboard.
    • Azure (AKS): Select Permissions on Cloud Account if the Aviatrix service principal has the required permissions, or Kubeconfig File to upload a kubeconfig. Click Onboard.
  4. Wait for the cluster status to show Yes (green) on the Kubernetes Clusters tab.
EKS clusters require a view-nodes ClusterRole so the Controller can discover node metadata. The CoPilot onboarding dialog generates the required YAML automatically — apply it before clicking Onboard.
5

Label agent pods

Aviatrix containment policies target pods by Kubernetes label selector. Ensure each agent Deployment includes a label that uniquely identifies the agent workload.The following example uses app: research-agent:
Use a consistent label scheme across your agent fleet, for example agent: <name> or app: <name>. The same label is referenced in the containment policy in the next step.
6

Author a containment policy for each agent

A FirewallPolicy resource defines the allowed egress destinations for pods matching a label selector. Create one policy per agent workload and commit it to the same repository as the agent’s Deployment manifest.The following example permits pods labelled app: research-agent in the ai-agents namespace to reach a model provider API and a single tool endpoint. All other egress is denied.
Apply the policy:
Repeat for each agent workload, adjusting the name, matchLabels selector, and domains list to match that agent’s identity and permitted destinations.
Commit the FirewallPolicy manifest to the same directory as the agent’s Deployment. This ensures it travels through the same review, CI/CD, and rollback process as the workload definition it protects.
7

Verify containment

  1. Check policy events to confirm the policy was applied successfully:
    A successful apply produces an event with Reason: UpdatePolicyListSuccess.
  2. Navigate to Security > Distributed Cloud Firewall and select the cluster. Confirm the policy appears with the correct egress allow-list for each agent.
  3. Invoke the agent and confirm that connections to declared destinations appear as PERMIT events in CoPilot FlowIQ.
  4. To verify egress blocking, attempt a connection from an agent pod to a destination not in its domains list and confirm it is denied. The denied attempt appears in CoPilot per-connection logs alongside the agent’s allowed traffic.