Cloud Security Wire
AWS Azure GCP RSS
AWS Hardening Guide medium

AWS STS GetScopedCredentials: Give Each AI Agent Narrower Credentials Than the Session That Started It

AWS launched sts:GetScopedCredentials on 20 November 2026 to scope down existing temporary credentials. What AWS says it does, its limits, and untested CLI, SCP and CloudTrail suggestions.

By Cloud Security Wire · ·
#AWS#STS#IAM#AI agents#least privilege#temporary credentials#CloudTrail#SCP#IAM Policy Autopilot

On 20 November 2026 the AWS Security Blog published “Scope down permissions of existing sessions using AWS STS GetScopedCredentials” by Vaishnavi Merugu and Ryan Peng. It announces a new AWS Security Token Service (STS) API that takes temporary credentials you already hold and returns new ones with reduced permissions, a shorter lifetime, or both. This is a product announcement, not a vulnerability report. We summarise what AWS says, then add suggestions of our own, which we label as such and have not run in a live account.

What AWS says the API does

  • Input and output. You call GetScopedCredentials with existing temporary credentials, such as those from aws login, an EC2 instance profile or a Lambda function, plus a scope down policy, a shorter duration, or both.
  • Permissions can only shrink. The new session’s permissions are the intersection of the calling session’s effective permissions and the scope down policy. The duration cannot exceed the remaining duration of the calling session.
  • Identity is preserved. The scoped credentials keep the caller’s IAM identity, including role session name, session tags and context keys. The SessionInfo ARN in the response matches the caller’s ARN.
  • Recursion. Scoped credentials can be scoped again, up to three scope down policies per session. Each new policy intersects with all earlier ones, and every earlier policy must allow sts:GetScopedCredentials for a recursive call to succeed.
  • Limits at launch. One inline policy of up to 2,048 characters per call; 200 requests per second per account per Region. AWS lists availability as all commercial, GovCloud (US) and China Regions, and says some services are not supported (see the API reference for the list).

AWS’s stated motivation is AI agents: an agent that decides its actions at runtime from prompts or tool output can use every permission its credentials carry, so an orchestrating agent should hand each sub-agent narrower access than its own. AWS also describes a multi-tenant pattern where a trusted credential broker issues per-tenant S3 prefix credentials after authenticating a request.

A basic call

The command below is AWS’s own example, reproduced in outline. It limits a session to reading objects from one bucket for five minutes and tags the purpose.

aws sts get-scoped-credentials \
  --policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::amzn-s3-demo-bucket/*"}]}' \
  --duration-seconds 300 \
  --scoped-session-description report-status-job \
  --region us-west-2

For the opposite approach, AWS shows an Allow with NotAction that keeps the session’s permissions except listed ones (iam:*, organizations:*, account:*, sts:AssumeRole*, and some delete actions such as ec2:TerminateInstances). AWS notes this grants nothing extra, because a scope down policy can only reduce access.

If you want a starting policy generated from code, AWS points to IAM Policy Autopilot, which analyses SDK calls. AWS warns its output can contain wildcards, for example table/*, and says to review and replace them. Its example output also includes dynamodb:WriteDataForReplication alongside dynamodb:PutItem for a single PutItem call, which is a reason to review rather than paste.

Our assessment

Everything in this section is our inference, not AWS statements.

  1. Prefer allow-lists to NotAction. The NotAction pattern is quick, but it keeps allowing any future action the parent session already allows, because the result is an intersection. For agents, a short Allow list scoped to named resources is the tighter default.
  2. This limits blast radius; it does not revoke the parent. AWS describes issuing narrower credentials. We have seen nothing in the post saying the parent session’s credentials are affected. If an agent process can also reach the parent credentials, for example through instance metadata, scoping achieves little. AWS itself recommends running agents in isolated or sandbox environments so they only see the scoped credentials.
  3. Attribution is harder. Because the identity is preserved, a scoped session’s calls carry the same role ARN as the parent. AWS says the access key ID in userIdentity.accessKeyId on later calls can be traced back to its immediate parent session, and that the call is logged in CloudTrail with the scopedSessionDescription. Set that description consistently.
  4. Gaps to plan around. The 2,048-character cap, three-policy depth and unsupported services may limit what you can express. Test that a denied call is actually denied before relying on it, and include dependent actions in the scope down policy, as AWS notes in its own examples.

Suggested controls (untested)

AWS says you can control sts:GetScopedCredentials in all relevant policy types and use sts:DurationSeconds, aws:PrincipalArn, aws:PrincipalTag and aws:SourceVpce. The following are our unrun sketches. Validate in a sandbox account.

Grant the action only to a credential-broker role:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "OnlyBrokerMayScope",
    "Effect": "Deny",
    "Action": "sts:GetScopedCredentials",
    "Resource": "*",
    "Condition": {
      "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/agent-credential-broker" }
    }
  }]
}

Hunt for use in CloudTrail (adjust to your log store):

aws cloudtrail lookup-events \
  --lookup-attributes AttributeKey=EventName,AttributeValue=GetScopedCredentials \
  --max-results 50 \
  --query 'Events[].{time:EventTime,user:Username}'

Notes: for roles, aws:PrincipalArn carries the role ARN (not the assumed-role session ARN) per the IAM condition-key reference; a role with an IAM path needs the path in the ARN; this Deny also blocks IAM users and federated principals; and SCPs do not apply to the management account (our recollection, not re-checked). CloudTrail lookup-events covers the last 90 days, one Region per call, 50 results maximum and 2 requests per second, so query each Region where you call STS. We did not confirm that this API is recorded as a management event, and Username may show only the session name for assumed-role callers, so inspect CloudTrailEvent for userIdentity.arn too.

Review callers you do not expect, empty or generic session descriptions, and calls from outside your expected network paths.

What we could not verify

The AWS post does not say whether the API is available through every SDK yet beyond “latest version”, gives no list of unsupported services (it refers to the API reference), and reports no abuse. We have not tested any behaviour described here.

Sources

← All Analysis Subscribe via RSS