Skip to content
AI Agent Access Control

Use short-lived role credentials and no long-lived access keys for the agent

Check 2 of 30: Use short-lived role credentials and no long-lived access keys for the agent. A key stored in code, a config file or a container image stays valid until someone rotates it, so a leak gives an attacker lasting access. Temporary credentials from a role expire on their own.

The whole checklist ยท The map

Why it matters

A key stored in code, a config file or a container image stays valid until someone rotates it, so a leak gives an attacker lasting access. Temporary credentials from a role expire on their own.

How, in each cloud

AWS
Have the workload use temporary credentials through an IAM role rather than IAM user access keys.
Google Cloud
Use workload identity or an attached service account instead of service account keys, which Google describes as powerful credentials that can present a security risk.
Azure
Use a managed identity; Microsoft documents that you do not manage its credentials.

What the documentation says

  • "Require workloads to use temporary credentials with IAM roles to access AWS" (source)
  • "security burden associated with service account keys." (source)
  • "You don't need to manage credentials." (source)

Sources

  1. docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html, read 10 Nov 2026
  2. cloud.google.com/iam/docs/workload-identity-federation, read 10 Nov 2026
  3. learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/over, read 10 Nov 2026

Last reviewed 16 Nov 2026.