Join our Newsletter — 33% off our NHI Course
Home› Guides› Securing AI Infrastructure: Workload Identity for AI Pipelines,…
Guide Cloud & Workload Identity

Securing AI Infrastructure: Workload Identity for AI Pipelines, Models and GPUs

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 24 October 2026 14 min read
On this page

Behind every AI agent sits an AI platform: data pipelines, notebooks, training jobs, model registries, inference endpoints, vector databases, AI gateways and GPU clusters, all authenticating to each other with non-human identities that are often over-privileged, long-lived and poorly inventoried. That platform holds some of the most valuable assets an organisation has: training data, model weights, embeddings of internal documents and paid access to expensive models and compute. This guide maps the workload identities in the AI stack, the risks specific to them and the controls for each component. It then covers how to choose identity mechanisms, what to monitor, how the controls align with common frameworks, and a phased roadmap. It is written for platform engineers, MLOps and data engineering teams, cloud security architects and the owners of AI programmes.

Key takeaways

  • AI platforms create many NHIs. Pipeline and job identities, notebook identities, serving identities, model provider API keys, vector database credentials, gateway keys and storage tokens all need an owner, a scope and a lifetime.
  • The prizes are data, weights and compute. Stolen AI credentials are used for data theft and for running models at the victim's expense, which Sysdig named "LLMjacking" in 2024.
  • Use platform-issued, short-lived identities. Kubernetes projected tokens, cloud workload identity and keyless access to model services remove most static keys from notebooks, images and code.
  • Treat registries and gateways as privileged. Whoever can write to the model registry can replace a model, and an AI gateway holds every provider key behind it.
  • Notebooks and research clusters are the weak point. They combine human access, broad data permissions, pasted credentials and, too often, unauthenticated network exposure.

The AI infrastructure stack and its identities

ComponentTypical identities and credentialsWhat they can reach
Data ingestion and preparation pipelinesPipeline service accounts, storage tokens, database credentialsSource systems, data lakes, raw and labelled data
Notebooks and research environmentsUser credentials, shared service accounts, pasted API keysData sets, compute, model providers, often production data
Training and fine-tuning jobsJob or workload identities, execution roles, registry push rightsTraining data, GPU capacity, model registry
Model registry and artefact storageCI/CD identities, registry tokens, signing keysModel weights, containers, evaluation data
Inference and model servingServing workload identities, model provider API keysModels, prompts and responses, downstream tools
Vector databases and retrievalDatabase API keys, indexing service accountsEmbeddings and chunks of internal documents
AI gateways and model routersProvider keys for many models, master keys, client credentialsAll model providers and tools the organisation uses
GPU clusters and orchestrationKubernetes service accounts, node identities, scheduler credentialsCompute, mounted data and secrets
Agent runtimesAgent identities, tool credentials, MCP server tokensBusiness systems via tools

Managed ML platforms add their own identities. Amazon SageMaker AI, for example, performs operations "on your behalf" through an IAM execution role; AWS offers the AmazonSageMakerFullAccess managed policy for this and points to more granular roles where a use case requires them. See the Cloud Workload Identity Guide.

Risks specific to AI infrastructure

MITRE ATLAS (release 2026.09) catalogues many of these as adversary techniques, including Valid Accounts (AML.T0012), Unsecured Credentials (AML.T0055), Cost Harvesting (AML.T0034), AI Supply Chain Compromise (AML.T0010) and RAG Credential Harvesting (AML.T0082).

1. Over-broad data access

Training and retrieval pipelines are often given read access to entire data lakes "because the model might need it", so a compromised pipeline identity exposes everything. In the Microsoft SAS Token Exposure 2023, a researcher sharing open-source AI models published a storage URL whose token covered the whole account with full control, and the account held 38TB of private data.

2. Credentials in notebooks, images and data sets

Notebooks mix code, output and credentials, and are shared, exported and committed. Training and serving images often have keys baked in. Data sets can contain secrets too: Truffle Security found 11,908 live secrets in a Common Crawl archive used to train LLMs (12,000 Live Secrets in LLM Training Data 2025). OWASP's LLM02:2025 Sensitive Information Disclosure covers the risk of such data surfacing in model output.

3. Model provider keys and LLMjacking

Model and cloud AI keys are spending credentials. In LLMjacking 2024 to 2026, Sysdig estimated potential victim costs at over $46,000 per day, rising past $100,000 per day with newer models, and a bait AWS key leaked by Permiso was tried within minutes. In the Microsoft Azure OpenAI Abuse 2025, Microsoft says Storm-2139 used leaked customer API keys and resold access. OWASP calls the cost side "Denial of Wallet" under LLM10:2025 Unbounded Consumption. See the LLMjacking Guide.

4. Model and artefact integrity

Whoever can write to the registry can replace a model with a backdoored one. Hugging Face warns that pickle, the default format for PyTorch weights, allows "arbitrary code execution attacks" when loaded, and ATLAS tracks Unsafe AI Artifacts (AML.T0011.000) and Manipulate AI Model (AML.T0018). Dependencies matter as well: the PyTorch torchtriton Supply Chain Attack 2022 stole SSH keys and environment variables from machines installing nightly builds. See the AI Supply Chain and AI-BOM Guide.

5. Vector stores as a data leak path

Vector databases hold embedded chunks of internal documents, often without the original access controls. OWASP LLM08:2025 lists unauthorised access and cross-context leaks in shared vector databases, and recommends "permission-aware vector and embedding stores". ATLAS adds RAG Credential Harvesting, where secrets in ingested documents are retrieved through the model. See the Permission-Aware RAG Guide.

6. Environment mixing

Research, staging and production often share identities and data, so experiments run with production credentials. This is OWASP NHI8:2025 Environment Isolation; SPIFFE likewise advises separate trust domains for environments with different security practices.

7. Exposed clusters, platforms and gateways

Oligo Security says attackers exploited exposed Ray clusters for about seven months in ShadowRay 2024, reaching model provider tokens, cloud credentials and SSH keys (Anyscale disputes that missing authentication is a vulnerability). Wiz found an unauthenticated database holding chat logs and API keys in the DeepSeek Database Exposure 2025. In the LiteLLM MCP Auth Bypass 2026, attackers harvested provider keys from AI gateways, and Wiz found 294 of 3,074 public gateways accepting a default master key.

Controls by component

Pipelines, training and fine-tuning jobs

  • Run each job under its own workload identity (cloud IAM role, managed identity, Kubernetes service account mapped to a cloud identity, or SPIFFE ID), never under a user account or shared key.
  • Scope data access to the data sets and prefixes the job needs, read-only unless it writes outputs; replace broad managed policies with granular ones.
  • Issue credentials for the duration of the job and revoke on completion.
  • Separate who can start jobs from who can publish models to the production registry.

Notebooks and research environments

  • Authenticate notebooks with the user's own identity plus a scoped workload identity for compute, not shared service accounts.
  • Provide secrets through a secrets manager integration, never pasted into cells; scan notebooks and outputs before sharing or committing. See the Secrets Management Guide.
  • Default research environments to de-identified or sampled data, with approval for production data.
  • Never expose notebook or cluster dashboards to the internet without authentication; expire idle environments and their credentials.

Model provider access and AI gateways

  • Route model calls through a gateway that holds provider credentials, so teams authenticate with their own identities instead of holding provider keys.
  • Use keyless access where offered: Microsoft says Entra ID lets code call Azure OpenAI "without storing an API key", using short-lived tokens for a managed identity granted a role on the resource.
  • Harden the gateway as a tier-zero system: no default master keys, authentication that fails closed, no direct internet exposure, and rotation of every provider key it holds after any compromise.
  • Set per-key and per-team spend limits and alerts, and add provider key patterns to secret scanning.

Model registry and artefacts

  • Treat registry write access as privileged; only controlled pipelines publish to production.
  • Sign models and verify signatures before loading. The Sigstore model-transparency project, built with the OpenSSF, supports Sigstore, public-key and certificate signing; prefer non-executable formats over pickle.
  • Record provenance: which data, code and identity produced each model. SLSA's build track describes provenance "showing how the package was built", signed at Build L2.

Inference and serving

  • Give each serving deployment its own identity with access only to its model and required downstream services.
  • Authenticate callers to inference endpoints, even internally.
  • Keep serving identities separate from agent tool credentials. See the MCP Security Guide.

Vector databases and retrieval

  • Carry source-document permissions into the index and filter retrieval by the requesting user's entitlements.
  • Partition collections or tenants by sensitivity, and scrub secrets before indexing.
  • Replace shared database API keys with per-service identities; scope indexing and query rights separately.

GPU clusters

  • Use projected service account tokens: Kubernetes says they "expire automatically" and the kubelet rotates them, whereas Secret-based tokens "don't expire and don't rotate". Set automountServiceAccountToken: false where a pod needs no API access.
  • Map Kubernetes service accounts to cloud roles with GKE Workload Identity Federation or EKS Pod Identity, which Google and AWS describe as replacing service account key files and node-wide credentials.
  • Isolate tenants with namespaces, network policies and separate identities, remembering AWS's warning that containers are not a security boundary. See the Kubernetes NHI Security Guide.

Agent runtimes

  • Give each agent its own identity, distinct from the serving deployment and from the user it acts for, so its actions can be traced and revoked.
  • Broker tool credentials at run time with short lifetimes and narrow scopes; never store them in prompts, agent memory or configuration files the model can read.
  • Treat MCP servers and agent tools as workloads with their own identities and owners. See the Agentic AI Identity Guide.

Choosing the identity mechanism

Where the workload runsPreferred mechanismAvoid
Kubernetes (any)Projected, audience-bound service account tokens via TokenRequestLong-lived Secret-based tokens
GKEWorkload Identity Federation for GKEService account key files
Amazon EKSEKS Pod Identity or IAM roles for service accountsNode instance role shared by all pods; static access keys
AzureManaged identities with Entra ID role assignmentsResource API keys in configuration
Across clouds and on-premisesSPIFFE IDs with X.509-SVIDs (SPIFFE advises X.509 over JWT where possible)Shared secrets copied between environments
External model providersGateway-held keys with per-team identities, or federation where supportedProvider keys in notebooks, images or client code

Small teams on one cloud can rely on that provider's native mechanism and a managed gateway. Organisations training across clouds, on-premises GPU clusters and external providers usually need a common identity layer such as SPIFFE so that policy and audit work the same way everywhere. See the Workload Identity Federation Guide.

Detection and monitoring

  • Spend and usage anomalies: sudden model invocations, new regions or new models are often the first sign of stolen keys.
  • Unexpected workloads: new clusters, auto scaling groups or GPU jobs; AWS describes miners running within 10 minutes in the Amazon AWS Crypto-Mining Campaign 2025.
  • Credential use from outside the platform: a job or serving identity used from an unfamiliar network or interactively.
  • Registry and index changes: model uploads, tag moves and bulk index exports outside the pipeline.
  • Secrets in logs: prompt, request and application logs often capture keys; the DeepSeek database held API keys in a log table.
  • Exposure scans: regular checks for internet-reachable notebooks, dashboards, gateways and vector databases.

Framework mapping

This is an indicative alignment prepared by NHI Mgmt Group, not an official mapping. IDs were checked against the NIST CSF 2.0 text, the NIST SP 800-53 Rev. 5 catalogue, a published ISO/IEC 27001:2022 Annex A list, the OWASP NHI and LLM Top 10 (2025) and MITRE ATLAS 2026.09; CIS Controls v8.1 are given at control level.

Control areaNIST CSF 2.0NIST SP 800-53 Rev. 5ISO/IEC 27001:2022 Annex ACIS v8.1OWASP / ATLAS
Workload identity per componentPR.AA-01, PR.AA-03IA-9, IA-5A.5.16, A.5.175NHI4, NHI7
Least-privilege data accessPR.AA-05AC-3, AC-6A.5.15, A.8.36NHI5
Secrets out of notebooks, images and dataPR.DS-01IA-5(7)A.5.173, 16NHI2, LLM02, AML.T0055
Model integrity and provenanceID.RA-09, PR.PS-06SI-7, SR-4A.5.21, A.8.2516LLM03, LLM04, AML.T0010
Permission-aware retrievalPR.AA-05AC-3, AC-4A.8.33, 6LLM08, AML.T0082
Environment separationPR.IR-01SC-7A.8.3112NHI8
Spend and compute monitoringDE.CM-09SI-4, AU-6A.8.168LLM10, AML.T0034

NIST AI 600-1, the Generative AI Profile, frames the same concerns as maintaining "the integrity and (when applicable) the confidentiality of the GAI code, training data, and model weights", and suggests measuring unauthorised access attempts and provenance verification (MS-2.7-004).

Common failure patterns

  • Over-scoped, long-lived share links: a full-control storage token later extended to 2051, as Wiz reported in the Microsoft SAS case.
  • Unauthenticated control planes: Ray dashboards, databases and gateways reachable from the internet, as in ShadowRay and DeepSeek.
  • Default admin keys: AI gateways shipped and left with a known master key.
  • Keys in shared places: platform-hosted app secrets. Hugging Face revoked tokens and told users to refresh keys after unauthorised access to Spaces secrets (Hugging Face Spaces Breach 2024).
  • One identity for everything: a single execution role or service account shared by research, training and serving.
  • Index everything, filter nothing: retrieval that ignores the requester's permissions.
  • No spend alarms: stolen keys discovered from the invoice.

Metrics that show progress

MetricWhat it showsTarget direction
AI workloads using platform-issued, short-lived identitiesStatic key reductionUp
Static provider and cloud keys in notebooks, images and repositoriesSecret sprawlDown, towards zero
AI identities with a named owner and documented scopeAccountabilityUp, to 100%
Production models with verified signatures and provenanceArtefact integrityUp
Internet-exposed AI services without authenticationExposureZero
Retrieval indexes enforcing source permissionsData leak riskUp
Time from spend anomaly to key revocationResponse speedDown

Implementation roadmap

PhaseActionsOutcome
First 30 daysInventory AI identities and keys; scan notebooks, images and repositories; close internet exposure of clusters, notebooks and gateways; rotate default and leaked keys; set spend alertsThe easiest routes to data and compute are closed
Days 31 to 90Move jobs and serving to workload identity; centralise provider keys in a hardened gateway; split research, staging and production identities; restrict registry writesFew static keys, clear separation of duties
Days 91 to 180Sign and verify models; add provenance; enforce permission-aware retrieval; add detection for unexpected workloads and registry changes; report metricsIntegrity, least privilege and monitoring across the stack

Practitioner checklist

  • Inventory every identity in the AI stack, with owner, scope and credential lifetime.
  • Replace static keys with platform-issued, short-lived workload identities.
  • Scope data access per job and per service; no data-lake-wide read by default.
  • Keep secrets out of notebooks, images and training data, and scan all three.
  • Centralise model provider keys in a hardened gateway with per-team identities and spend limits.
  • Never expose notebooks, clusters, gateways or vector databases without authentication.
  • Protect registry writes as privileged; sign and verify models; avoid pickle from untrusted sources.
  • Enforce permission-aware retrieval and scrub secrets before indexing.
  • Separate research, staging and production identities and data.
  • Alert on spend anomalies, unexpected workloads and credential use from outside the platform.

Standards and references

Related NHI Mgmt Group resources: Cloud Workload Identity Guide · Kubernetes NHI Security Guide · LLMjacking Guide · Agentic AI Security Guide · NHI Lifecycle Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 24 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.