Amazon Web Services (AWS) announced the availability of GetScopedCredentials, a new API within AWS Security Token Service (STS) that allows developers to narrow the permissions of existing temporary security credentials. This capability particularly targets scenarios where workloads or AI agents should operate with the least privilege necessary, reducing security risks.
GetScopedCredentials operates by taking the current temporary security credentials, such as those from AWS login sessions, EC2 instance profiles, or Lambda functions, and applying a scope down policy—a custom inline policy that specifies maximum allowed permissions. The resulting credentials carry an intersection of the original permissions and the policy, ensuring permissions can only be reduced, never expanded. Developers can also specify a shorter session duration for the new credentials, which cannot exceed the remaining time of the calling session.
This API addresses common use cases like limiting the capabilities of AI agents or sub-agents, which might otherwise inherit overly permissive credentials from their starter sessions. By scoping down these permissions, an agent's actions are restricted to specific resources or actions, mitigating potential damages from errors or exploits. For example, an AI agent might be given credentials only allowing read access to a single Amazon S3 bucket rather than broader roles.
Another significant use case is scoping permissions based on runtime context, such as in multi-tenant applications where each tenant’s data access must be strictly isolated. Here, an application can authenticate a user, then call GetScopedCredentials with a policy limiting access to that tenant’s data prefix, passing only scoped credentials to the handler that processes the request. This prevents cross-tenant data exposure—even though the original IAM role covers all tenants.
The GetScopedCredentials API is designed as a low-level building block, which means it fits into frameworks that orchestrate multiple components or agents, continuous integration/deployment pipelines, and bespoke applications. Recursive calls are supported, allowing multiple rounds of scoping down to further narrow credentials. However, a maximum of three scope down policies can be applied simultaneously per session.
To use GetScopedCredentials, developers first write a scope down policy, either manually or using AWS's IAM Policy Autopilot tool, which analyzes code to generate least-privilege policies. Then, they invoke the API via AWS CLI or SDKs with the defined policy and optional session parameters. Each call is logged in AWS CloudTrail for audit and security monitoring.
The solution improves security posture by employing the principle of least privilege dynamically at runtime across various workloads. Limitations include the 2,048-character size limit for inline scope down policies and the maximum of three concurrent policies per session. Additionally, the service has a quota of 200 requests per second per account per region at launch. Most AWS services support scoped-down credentials, with a few exceptions detailed in the API reference.
Overall, AWS’s GetScopedCredentials offers a practical way to enhance access control granularity and reduce risks associated with broad or inherited permissions, especially in complex, AI-driven, or multi-tenant environments.
Source & further reading
Scope down permissions of existing sessions using AWS STS GetScopedCredentials ↗Source published 2026-11-20. Claims and limitations should be checked against the original announcement or research.