Traditional infrastructure security assumes a perimeter: protect the network boundary and everything inside is trusted. AI infrastructure breaks this model entirely. The attack surface of an AI system extends from training data collection (months before deployment) through model serving (real-time, internet-facing) to model artifacts themselves (valuable intellectual property). A zero trust approach — "never trust, always verify" — is the only viable security model for AI infrastructure.
The AI-Specific Threat Landscape
AI systems face threats that don't exist in traditional software:
Training Data Attacks
- Data poisoning: Injecting malicious samples into training data to create backdoors or degrade model performance. Example: adding subtly mislabeled images to a fraud detection training set
- Data exfiltration: Stealing proprietary training data, which often contains sensitive business information or personal data
- Data supply chain attacks: Compromising public datasets or third-party data providers used for model training
Model Attacks
- Model theft/extraction: Using model APIs to reconstruct the model through repeated queries (model distillation attacks)
- Adversarial inputs: Crafting inputs that cause models to produce incorrect outputs — imperceptible image perturbations, semantic text manipulations
- Model inversion: Extracting training data from model parameters — particularly dangerous for models trained on personal or confidential data
- Prompt injection: Manipulating LLM inputs to bypass safety guardrails or extract system prompts
Infrastructure Attacks
- GPU side-channel attacks: Extracting information from shared GPU memory in multi-tenant environments
- Supply chain compromise: Malicious code in ML frameworks, pre-trained models, or container images
- Model serving exploitation: Attacking inference endpoints as entry points to the broader infrastructure
Zero Trust Architecture for AI
Apply zero trust principles across every layer of the AI lifecycle:
1. Training Data Security
Data Provenance and Integrity
- Signed data artifacts: Cryptographically sign all training datasets at creation. Any modification invalidates the signature. Use Sigstore/cosign for container-native environments
- Data supply chain verification: For external datasets, verify source authenticity and integrity. Maintain a Software Bill of Materials equivalent for data (Data BOM)
- Immutable data storage: Training data stored in WORM (Write Once Read Many) storage. Historical training sets are never modified — only new versions are created
Data Access Controls
- Attribute-based access control (ABAC): Access to training data based on user attributes, data sensitivity, purpose, and context — not just role membership
- Just-in-time access: Temporary, time-bounded access grants for training runs. No standing access to sensitive training data
- Audit logging: Every data access logged with user identity, purpose, timestamp, and data accessed. Tamper-proof audit logs stored separately from the data platform
Data Poisoning Detection
- Statistical anomaly detection: Automated analysis of training data distributions to detect outliers that could indicate poisoning attempts
- Data validation pipelines: Schema validation, range checks, consistency checks, and cross-reference validation before data enters training pipelines
- Provenance tracking: Traceability from every training sample back to its original source, enabling investigation when poisoning is suspected
2. Training Pipeline Security
Critical: ML Supply Chain Security
- Pin ML framework versions — Don't use
latesttags for PyTorch, TensorFlow, or any ML library - Verify container images — Sign and verify all training container images using Sigstore/cosign with a private transparency log
- Scan for vulnerabilities — ML frameworks have extensive native code with regular CVEs. Scan containers with Trivy/Grype before training runs
- Isolate training environments — Training workloads should not have network access beyond data sources. No internet access during training unless specifically required
- Verify pre-trained models — Models from Hugging Face or other hubs can contain malicious code (pickle deserialization attacks). Use safetensors format and verify checksums
Compute Security
- GPU isolation: In multi-tenant environments, ensure GPU memory isolation between training jobs. Use MIG (Multi-Instance GPU) on NVIDIA A100/H100 or dedicated GPU allocation
- Confidential computing: For highly sensitive models, use confidential computing (AMD SEV-SNP, Intel TDX) to protect training data and model weights in use
- Ephemeral training environments: Training environments created on-demand and destroyed after completion. No persistent state that could be compromised
3. Model Artifact Security
Model Storage and Distribution
- Encrypted model storage: Model weights encrypted at rest using customer-managed keys (not provider-managed). Key rotation on a regular schedule
- Signed model artifacts: Every model version cryptographically signed by the training pipeline. Serving infrastructure verifies signatures before loading models
- Model registry access controls: Role-based access with separation between model developers (write), validators (read), and serving infrastructure (read-only specific versions)
Intellectual Property Protection
- Model watermarking: Embed verifiable watermarks in model weights that survive extraction attempts
- Rate limiting and query budgets: Limit API query rates and total query budgets per consumer to prevent model extraction attacks
- Output perturbation: Add calibrated noise to model outputs to make extraction attacks less effective while maintaining utility
4. Inference Security
Input Validation
- Schema validation: Strict input schema enforcement — reject malformed inputs before they reach the model
- Adversarial input detection: Statistical analysis of input distributions to detect adversarial examples. Anomaly detection on input features
- Prompt injection defenses: For LLMs: input sanitization, system prompt isolation, output filtering, and canary token detection
- Input size limits: Enforce maximum input sizes to prevent resource exhaustion attacks
Output Security
- Output filtering: Post-processing layers that detect and block sensitive information leakage (PII, confidential data, system prompts)
- Confidence thresholds: Reject or flag predictions below confidence thresholds rather than serving potentially unreliable outputs
- Output logging: All inference requests and responses logged for audit, with sensitive fields masked
5. Network Security
- Microsegmentation: Kubernetes Network Policies isolating training, validation, and serving workloads. No lateral movement possible between environments
- Service mesh with mTLS: All inter-service communication encrypted and authenticated using Istio or Linkerd
- API gateway: All external access through an API gateway with authentication, rate limiting, and WAF protection
- Egress controls: Explicit egress allowlists. Training environments cannot reach the internet. Serving environments can only reach approved downstream services
Kubernetes Recipes
Practical guide for container orchestration and deployment — hands-on patterns you can use today.
View on Amazon →Identity and Access for AI Systems
AI systems require identity management beyond human users:
- Workload identity: Every ML pipeline, training job, and serving instance gets a unique cryptographic identity (SPIFFE/SPIRE)
- Service-to-service auth: Models authenticate to data sources, feature stores, and downstream services using workload identity — never shared credentials
- Human access: Data scientists and ML engineers access training environments through identity-aware proxies with MFA and session recording
Kubernetes Security Implementation
Zero Trust AI Platform on Kubernetes
- Pod Security Standards: Restricted profile for all AI workloads — no privileged containers, no host networking
- Network Policies: Default-deny with explicit allowlists for each workload
- RBAC: Namespace-scoped roles separating training, validation, and production environments
- Admission Control: Kyverno/OPA policies enforcing signed images, resource limits, and security configurations
- Secret Management: External Secrets Operator with Vault backend for credentials and encryption keys
- Runtime Security: Falco monitoring for anomalous container behavior (unexpected network connections, file access, process execution)
- Image Scanning: Trivy operator scanning all images in the cluster, blocking deployments with critical CVEs
- Audit Logging: Kubernetes audit policy capturing all API server requests with user identity and resource details
Learn Ansible Automation in 250+ Examples
Comprehensive Ansible training with real-world use cases.
Start on Educative →Incident Response for AI Systems
AI security incidents require specialized response procedures:
- Detection: Automated alerting on model performance anomalies, unusual access patterns, and data integrity failures
- Containment: Ability to instantly disable model serving, quarantine training data, or revoke access to model artifacts
- Investigation: Audit logs enabling forensic analysis of what data was accessed, which models were affected, and what outputs were served
- Remediation: Model rollback to last known good version. Retraining with clean data if poisoning is confirmed. Credential rotation and access review
- Communication: Regulatory notification procedures (required under DORA, NIS2) with AI-specific impact assessment
Security Compliance Mapping
How AI security maps to regulatory frameworks:
- EU AI Act: High-risk AI systems require cybersecurity measures "appropriate to the risks." Zero trust architecture satisfies the "state of the art" expectation
- DORA: ICT risk management requirements apply to AI systems in financial services. Model security is part of operational resilience
- NIS2: Essential and important entities must secure AI systems as part of their network and information systems
- ISO 27001: AI security controls map to Annex A controls for access management, cryptography, operations security, and supplier relationships
AI Readiness Checklist
50-point interactive checklist covering strategy, data, infrastructure, governance, and people. Score your organisation's AI readiness.
Get Free Checklist →
Luca Berton
