Join our Newsletter — 33% off our NHI Course

How should security teams secure container, serverless, and AI workloads in AWS environments?

Security teams should treat cloud native workloads as dynamic and short lived, then enforce controls earlier in the lifecycle and at runtime. That means scanning code and images in CI and CD, securing registries and infrastructure as code, and using runtime detection for active threats. For AI workloads, teams also need visibility into model artifacts and policies that govern how those workloads are used.

Why This Matters for Security Teams

AWS container, serverless, and AI workloads share the same core risk pattern: they are ephemeral, highly automated, and often granted far more access than a human operator would ever receive. Traditional perimeter thinking misses the point because the workload itself is the control plane. Once a task role, function, or model execution path is compromised, attackers can move quickly through S3, ECR, Secrets Manager, IAM, and adjacent services.

Machine identities are now at scale, and that scale creates blind spots. NHIMG research on the Critical Gaps in Machine Identity Management report found that 69% of organisations now have more machine identities than human ones, while 57% lack a complete inventory. That matters in AWS because container tasks, Lambda functions, and AI pipelines often mint and consume identities faster than teams can review them. In practice, many security teams discover overprivileged workload access only after an exposed secret, public image, or abused execution role has already been used.

For AI workloads, the stakes are higher because the application may also be a policy consumer, tool caller, and secret broker. Current guidance suggests treating model artifacts, orchestration layers, and runtime prompts as part of the trust boundary, not just the code repository. The LLMjacking research shows how quickly exposed AWS credentials can be abused when attackers find them, which is why runtime identity and secret hygiene matter more than static assumptions.

How It Works in Practice

Security teams should secure AWS workloads in layers that match how those workloads actually run. Start with supply chain controls in CI and CD, then enforce runtime controls that verify the workload at execution time. For containers, that means image signing, admission control, registry scanning, and tight task or pod permissions. For serverless, it means limiting IAM roles per function, restricting event sources, and monitoring invocation patterns for privilege abuse. For AI, it also means governing model files, tool permissions, prompt paths, and the APIs the agent can call.

The most useful pattern is to treat identity as workload-bound, not environment-bound. The SPIFFE workload identity specification is a useful reference for this approach because it centers cryptographic identity for workloads rather than static host trust. In AWS terms, that maps to short-lived credentials, narrowly scoped task roles, and automatic rotation of any secret that is still required. Where possible, use just-in-time access and session policies so a container, function, or AI agent receives only the access needed for the current task, then loses it immediately after completion.

Practically, teams should align controls to the workload type:

  • Containers: scan base images, sign artifacts, and block untrusted registries.
  • Serverless: reduce function permissions, validate event triggers, and inspect outbound calls.
  • AI workloads: govern model provenance, restrict tool use, and log prompt-to-action flows.
  • All workloads: centralise secrets, avoid baked-in credentials, and alert on anomalous access patterns.

For identity and lifecycle management, NHIMG’s Guide to SPIFFE and SPIRE is a strong reference point for workload authentication patterns, especially where service-to-service trust needs to be machine-verifiable. These controls tend to break down in multi-account AWS estates with inconsistent tagging and shared deployment pipelines because ownership, policy scope, and runtime telemetry all become fragmented.

Common Variations and Edge Cases

Tighter workload controls often increase delivery overhead, so organisations need to balance speed against the cost of deeper inspection and more frequent policy enforcement. The right answer is not identical for every AWS service, and current guidance is still evolving for AI workloads that dynamically call tools or chain across multiple accounts.

One common edge case is an AWS environment that mixes Kubernetes, Lambda, and managed AI services under a single platform team. In that model, a single IAM design rarely fits all workloads. Kubernetes workloads can support admission controls and sidecar-based identity checks, while Lambda often depends more heavily on invocation scoping and log-based detection. AI workloads may also need policy controls for model access, retrieval sources, and agent actions, especially where prompts can influence downstream permissions.

Another issue is secret sprawl. Teams that leave credentials in build systems, container images, or function environment variables create long-lived exposure that defeats runtime controls. The safer pattern is short-lived credentials, automated revocation, and continuous review of who or what can mint them. NHIMG’s Ultimate Guide to NHIs — Standards is useful when teams need to map these controls into a broader machine identity programme rather than handling each service in isolation.

There is no universal standard for AI workload governance yet, so security teams should document local policy decisions, define exception handling, and revisit them as the platform matures.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 Covers insecure workload identities and exposed machine secrets in cloud-native environments.
OWASP Agentic AI Top 10 A2 Relevant where AI workloads can call tools and act autonomously in AWS.
CSA MAESTRO M1 Addresses securing autonomous workloads across identity, policy, and runtime layers.
NIST AI RMF GOVERN AI workloads need governance over model access, tool use, and runtime decisions.
NIST Zero Trust (SP 800-207) SC-4 Zero trust supports per-request authorization for ephemeral cloud workloads.

Inventory AWS workload identities, remove embedded secrets, and enforce least-privilege issuance with short TTLs.