Agentrax implements a two-tier zero-trust network security model enforced at the Kubernetes CNI layer. This prevents lateral movement between tenants, blocks unauthorized outbound internet access, and restricts operational endpoints to authorized components only.
┌─────────────────────────────┐
│ Prometheus Pod │
│ (ns: `monitoring: enabled`) │
└──────────────┬──────────────┘
│
TCP :8443 (HTTPS) │ TCP :8080 (Scrape)
┌─────────────────────────────────────────┴────────────────────────────────────────┐
│ │
▼ ▼
┌──────────────────────────────────────┐ ┌──────────────────────────────────────┐
│ Tier 1: Operator Control Plane │ │ Tier 2: Tenant Agent Pods │
│ Namespace: `agentrax-system` │ │ Namespace: `tenant-*` │
│ Selector: │ │ Selector: │
│ `control-plane: controller-manager│ │ `agentrax.io/agent: "true"` │
│ │ │ │
│ • Ingress: Only TCP :8443 from │ │ • Ingress: Only TCP :8080 from │
│ `metrics: enabled` namespaces │ │ `monitoring: enabled` │
│ • Default: Drops rogue scrapes │ │ • Egress Allowed: │
│ │ │ - Port 443 & 6443: kube-apiserver │
│ │ │ - Port 53: kube-system CoreDNS │
│ │ │ • Egress Denied (Default): │
│ │ │ - Cross-tenant network packets │
│ │ │ - External internet egress │
└──────────────────────────────────────┘ └──────────────────────────────────────┘
- Namespace:
agentrax-system - Target Pods:
control-plane: controller-manager - Policy Type:
Ingress - Rules:
- Allows TCP traffic on port
8443(HTTPS metrics) only from namespaces labeledmetrics: enabled. - Protects internal operator diagnostics and telemetry from arbitrary cluster workloads.
- Allows TCP traffic on port
- Namespace:
tenant-*(applied in each tenant namespace) - Target Pods:
agentrax.io/agent: "true"Note: The
AgentDeploymentreconciler automatically stampsagentrax.io/agent: "true"onto every managed Pod template, ensuring that every AI agent pod is automatically governed by this policy. - Policy Type:
IngressandEgress(activates Default-Deny in both directions). - Ingress Rules:
- Permits inbound TCP port
8080(Prometheus metrics scrape) strictly from namespaces labeledmonitoring: enabled.
- Permits inbound TCP port
- Egress Rules:
- Kubernetes API Server: TCP ports
443and6443(allows agents to discover services or use authorized Kubernetes cluster tools). - CoreDNS: UDP and TCP port
53to pods matchingk8s-app in (kube-dns, coredns)in namespacekube-system. - Default-Deny: All other outbound communication (such as cross-tenant probing or external internet data exfiltration) is dropped.
- Kubernetes API Server: TCP ports
The consolidated release installer (dist/install.yaml) automatically includes both NetworkPolicies under agentrax-system.
kubectl apply -f https://github.com/gitcommitankit/agentrax/releases/download/v0.2.1/install.yamlTo enforce tenant isolation in a new tenant namespace:
kubectl apply -n tenant-alpha -f config/network-policy/tenant-agent-isolation.yamlYou can verify that the network security perimeter is working using a standard ephemeral pod:
kubectl run test-dns --rm -it --restart=Never -n tenant-alpha \
--labels="agentrax.io/agent=true" \
--image=busybox -- nslookup kubernetes.default- Expected Result: Successfully resolves the IP address of
kubernetes.default.svc.cluster.local.
kubectl run test-egress --rm -it --restart=Never -n tenant-alpha \
--labels="agentrax.io/agent=true" \
--image=busybox -- wget -T 3 -qO- http://1.1.1.1:80- Expected Result: Connection times out (
wget: download timed out). Unapproved egress is blocked cold.