Skip to content
AI Security Wire

Published

- 5 min read

By

Authorizing AI Agents to AWS MCP Server with ID-JAG: A Hardening Guide

img of Authorizing AI Agents to AWS MCP Server with ID-JAG: A Hardening Guide

On November 25, 2026, AWS published a walkthrough for connecting AI agents to AWS MCP Server through a company’s existing identity provider. It is a vendor how-to written around Okta and Claude, not an incident or a vulnerability. It is still a useful reference for security teams, because it answers a question many have had since agents started calling cloud APIs: who decides which agent gets which access, and how do you see it afterwards?

This guide summarises how the flow works, what AWS recommends, and the checks we would add. Where a point is our own judgement rather than AWS’s, we say so.

How the flow works

AWS Sign-In is introducing support for Enterprise-Managed Authorization (EMA), which AWS describes as an MCP extension that lets organisations centrally manage how AI applications reach protected resources on behalf of employees. It uses the Identity Assertion JWT Authorization Grant (ID-JAG), and AWS’s documentation says Okta calls the same pattern Cross App Access. AWS’s documentation says Sign-In implements it with the OAuth 2.0 JWT bearer grant (RFC 7523) plus ID-JAG. The IETF draft that defines ID-JAG (draft-ietf-oauth-identity-assertion-authz-grant, revision 06 when we checked) is still a draft, not a final standard.

The sequence in AWS’s post:

  1. The employee signs in to the AI application through enterprise single sign-on.
  2. When the agent needs AWS MCP Server, it asks the IdP for an ID-JAG for that resource.
  3. The IdP evaluates its access policy. If the employee and application are authorised, it issues a short-lived signed ID-JAG.
  4. The agent sends the ID-JAG to the AWS Sign-In OAuth token endpoint. AWS validates the issuer, signature, audience/tenant, expiration and intended resource, uses AWS STS to evaluate the IAM role’s trust policy, and issues an OAuth access token associated with the role.
  5. The agent presents that token to AWS MCP Server. The role’s IAM policies decide what it can do.

The security point AWS makes explicitly: signing in to the AI application does not by itself grant AWS access. Two trust domains are bridged, and both the IdP policy and IAM must say yes.

Hardening checklist

1. Make the IdP policy the first gate

In AWS’s Okta example, an AWS MCP resource application is assigned only to named employees or groups, and the AI agent is registered and connected to that resource. AWS suggests testing the negative case: an employee who is not authorised in Okta should have the ID-JAG request denied. Run that test before rollout and after every policy change.

2. Build a dedicated, least-privilege role

AWS’s walkthrough creates a role with a web-identity trust policy that names the Okta OIDC provider and its audience, which restricts the role to assertions from that provider. It attaches the AWS managed policy AWSMCPSignInOAuthAccessPolicy, which grants signin:CreateOAuth2Token, then adds only the permissions the application needs. The example uses a read-only role named OktaAwsMcpReadOnly.

Our assessment: use one role per agent use case rather than one broad role for every agent, so that the role name in CloudTrail tells you which use case acted. AWS’s sample events show opaque session names, so the role name is the identifier. AWS does not require this.

3. Pin the application and grant type with condition keys

AWS recommends using IAM condition keys to restrict OAuth token issuance to approved applications, flows and resources. Its examples:

  • signin:OAuthClientId, for example arn:aws:signin:::external-client/jwt-bearer/anthropic-claude
  • signin:OAuthGrantType, set to urn:ietf:params:oauth:grant-type:jwt-bearer

AWS adds that these permissions should be scoped to the AWS MCP Server service principal to prevent unintended access to other AWS services. AWS’s Sign-In condition-key reference lists signin:OAuthClientId as applicable to signin:AuthorizeOAuth2Access, signin:CreateOAuth2Token and signin:IntrospectOAuth2Token, and signin:OAuthGrantType as applicable to signin:CreateOAuth2Token; its own example policies there use StringEquals on them. We have not tested a policy against AWS MCP Server, so validate yours in a non-production account first.

4. Keep assertions short-lived and issuers tenant-specific

AWS recommends short expiration periods on ID-JAG assertions to limit the window in which an assertion can be exchanged, and tenant-specific issuer URLs in multi-tenant environments so an assertion issued for one tenant is not accepted for another. In the Okta example, the IAM OIDC provider URL is the Okta org URL, because Okta issues ID-JAG assertions from the org authorization server rather than a custom one.

5. Watch it in CloudTrail

AWS says token issuance and later activity are logged. Its example events show:

  • Token issuance: eventSource signin.amazonaws.com, eventName CreateOAuth2Token, with requestParameters.client_id and resource, and additionalEventData containing the grant type urn:ietf:params:oauth:grant-type:jwt-bearer, a signInSessionArn and success.
  • Follow-on calls: events whose userIdentity is an assumed role session with invokedBy set to aws-mcp.amazonaws.com, carrying the same session ARN. AWS’s example is an IAM ListUsers call recorded in US East (N. Virginia), because calls to global services are logged there.

Detection ideas (our assessment, not AWS guidance; tune to your environment):

  • Alert on CreateOAuth2Token where client_id is not on your approved list.
  • Alert when the grant type differs from the one you expect.
  • Join token issuance to subsequent invokedBy: aws-mcp.amazonaws.com calls by session ARN, and flag calls outside the agent’s expected service set.
  • Watch for AccessDenied results from the agent’s session, which may show an agent probing beyond its role.

Note that AWS’s sample events are illustrative: they use placeholder account IDs and example values, so confirm field names against your own logs.

What this does not solve

This pattern controls who may obtain a token and what the role allows. It does not, by itself, address prompt injection against the agent, malicious MCP tool descriptions, or an over-broad role. If the role allows an action, an agent that has been manipulated can perform it. Pair this with narrow roles, human approval for destructive actions, and monitoring. AWS’s post does not claim otherwise.

Rollout order we would use

  1. Create the OIDC provider and a read-only role in a non-production account.
  2. Assign one small pilot group in the IdP.
  3. Add the client ID and grant-type conditions before widening access.
  4. Confirm a denied user is denied and a read-only role cannot write.
  5. Build the CloudTrail alerts above, then expand.

References

Frequently Asked Questions

What is Enterprise-Managed Authorization (EMA) for AWS MCP Server?
EMA is the MCP Enterprise-Managed Authorization extension. AWS announced on November 25, 2026 that AWS Sign-In is introducing support for it using the Identity Assertion JWT Authorization Grant (ID-JAG), so a company's identity provider, such as Okta, decides which AI applications may reach AWS MCP Server on behalf of employees. The agent receives a short-lived signed assertion from the IdP and exchanges it at AWS Sign-In for an OAuth access token tied to an IAM role.
Does signing in to an AI application grant access to AWS?
No. AWS states that authenticating to an AI application does not automatically grant access to AWS resources. The IdP must separately evaluate its policy and issue an ID-JAG for the AWS resource, and the IAM role's trust policy and attached permissions still apply.
Which controls limit what an agent can do once connected?
The IAM policies attached to the role bound which AWS operations the agent can perform. AWS also recommends short-lived ID-JAG assertions, tenant-specific IdP issuers, and IAM condition keys such as signin:OAuthClientId and signin:OAuthGrantType to restrict which applications and flows can obtain tokens.
How can I audit agent access?
AWS says AWS Sign-In and AWS MCP Server integrate with CloudTrail. OAuth token issuance appears as CreateOAuth2Token events from signin.amazonaws.com, and later MCP-driven API calls appear with the same session ARN and an invokedBy value of aws-mcp.amazonaws.com in AWS's example events.