Join our Newsletter — 33% off our NHI Course
Home› Glossary› Authentication, Authorisation & Trust› STS Temporary Credentials
Authentication, Authorisation & Trust

STS Temporary Credentials

← Back to Glossary
By NHI Mgmt Group Updated November 4, 2026 Domain: Authentication, Authorisation & Trust

STS temporary credentials are short-lived AWS credentials issued after a session or role exchange. They reduce exposure compared with long-term keys because they expire automatically and can be scoped to a narrower set of actions. They are a common fit for agent workflows that should not retain persistent access.

What STS Temporary Credentials Are Used For

STS temporary credentials are the AWS-native way to convert a trusted session or role assumption into a short-lived access grant. They are designed to replace persistent keys for workloads, operators, and automated workflows that need time-bounded access, narrower permissions, and automatic expiry instead of standing access.

The practical value is not just that they are temporary, but that they create a smaller blast radius than long-term credentials. When a session ends, the credentials stop working, which makes them better suited to ephemeral automation, cross-account access, and role-based delegation than static access keys.

How STS Credentials Change Access Design

STS is part of AWS identity and access design, because it sits between the actor and the permissions they actually receive. A caller first proves it can assume a role or exchange a session, then AWS issues temporary credentials that inherit the role’s policy scope and session limits. That model shifts security away from storing reusable secrets and toward issuing access only when it is needed.

This is why STS is often paired with workload identity patterns rather than embedded secrets. A well-designed STS flow can remove hardcoded keys from code, CI/CD jobs, and automation, while still allowing the application or agent to authenticate when it legitimately needs to act.

For a broader view of the surrounding design pattern, see Cloud Workload Identity Guide for the role of AWS STS in keyless workload access, and AWS STS and AssumeRole Guide for trust conditions, session tags, and revocation mechanics.

Common Failure Modes With Temporary Credentials

STS credentials reduce exposure, but they do not remove access risk. If the underlying role is too broad, the temporary session can still be overprivileged. If trust policy conditions are weak, the wrong principal can obtain a valid session. If session duration is too long, temporary access starts to behave like de facto standing access.

Another failure mode is treating temporary credentials as a substitute for governance. They still require lifecycle design, scope control, and monitoring. The main security improvement comes from bounded authority and expiry, not from the word “temporary” itself.

That is why temporary access should be compared with a static-key model, not with “secure by default.” The control is only as strong as the role trust relationship, the permissions attached to the role, and the surrounding detection for unusual session use.

External guidance on the same access pattern is available in the OWASP Non-Human Identity Top 10, which addresses short-lived credentials, secret leakage, overprivilege, and third-party identity risk, and the NIST Privacy Framework, where applicable governance concerns around access minimisation and controlled use of sensitive data are relevant.

Where STS Fits in Detection and Access Governance

Because these credentials are short lived, detection focuses less on rotating the secret and more on understanding who assumed the role, from where, for how long, and with what effective permissions. In practice, the important questions are whether the session was expected, whether its scope matched the task, and whether the resulting actions fit the workload or operator profile.

Governance also matters at issuance time. Session tags, source identity, trust policy conditions, and role chaining limits all help preserve attribution and constrain misuse. Without those controls, temporary credentials can still create ambiguity in incident response and access review.

For authoritative implementation guidance, the OWASP Cheat Sheet Series is useful for secure session and secret-handling patterns, while NIST Privacy Framework reinforces the broader discipline of limiting access to what is necessary.

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 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-07 — Long-Lived SecretsSTS temporary credentials reduce dependency on long-lived secret material.
NHI-05 — Overprivileged NHISTS sessions can still inherit excessive permissions from the assumed role.
Recommendation — Prefer short-lived credentials over persistent secrets for workload access. Scope assumed-role permissions to the minimum actions required.
NIST SP 800-53 Rev 5IA-9 — Identification and Authentication (Service Accounts and Workload Identities)STS is a service-to-service and workload authentication pattern.
AC-6 — Least PrivilegeTemporary sessions still need tight privilege scoping to limit abuse.
Recommendation — Use IA-9 to authenticate workloads with bounded, short-lived credentials. Apply AC-6 to limit each assumed role to the minimum necessary access.
CIS Controls v8CIS-6 — Access Control ManagementSTS belongs to access issuance, restriction, and revocation discipline.
Recommendation — Manage role-based access paths and revoke unnecessary session authority promptly.

Practitioner Guidance

Why practitioners should care: STS temporary credentials are strongest when they replace reusable long-term keys, not when they are layered on top of poor role design. The real decision is whether the workload or operator can obtain only the authority it needs, only for as long as it needs it.

What to watch for: Session duration, trust-policy scope, and role permissions should be reviewed together. If a temporary credential can be minted too easily, used too broadly, or traced poorly after the fact, the access model is still too permissive.

Practitioner takeaway: Treat STS as an access boundary, not just a credential format, and design the role, trust, and audit model so the temporary session is truly constrained.

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
Reviewed and updated by the NHIMG editorial team on November 4, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org