AWS

Three AWS releases that make agents easier to trust

Cognito token exchange, a faster AgentCore runtime and a local AWS emulator, and why they are more interesting together than apart.

Picture an agent acting for a signed-in user. The user asks a question, and the agent calls a backend API to answer it. To make that call it forwards the user’s own token, which also happens to be good for everything else that user can reach. The API, for its part, sees a perfectly valid user token and has no way of knowing that an agent was on the other end of the request.

I have run into this from the building side. When you put agents alongside existing APIs, the hard questions are rarely about the model. They tend to be about identity, about how quickly an agent can start when someone is waiting on it, and about how you test any of it without deploying first.

Three AWS releases from last week each take on one of those questions. None of them is a headline feature on its own, but I think they are more interesting together than apart, so this post walks through what each one gives you and why I am glad to see it.

A token that only does one job

Amazon Cognito now supports OAuth 2.0 token exchange, the flow described in RFC 8693. A service or agent acting for a user can hand Cognito the user’s token and receive a new one aimed at a single downstream service. The new token can carry a narrower scope than the original, it is bound to one audience, and it can be issued without a refresh token.

Until now you had two options, and neither was comfortable. You could forward the user’s original token and accept that every service in the chain held something far more powerful than it needed, or you could write and maintain your own token-minting logic. The first is much the easier to reach for, usually with a promise to revisit it later. Having the identity provider do the exchange removes a piece of security-sensitive code that nobody really wanted to own.

The benefit I would put first is the smaller blast radius. If a token leaks from an agent’s tool call, or a prompt injection persuades the agent to try something it should not, the token in play is good for one service and a handful of scopes. That is least privilege applied per call, where previously it was applied per session at best.

The second benefit is the act claim. When the exchange request includes an actor token, Cognito adds a claim that identifies the intermediary, so a downstream service can tell a call an agent made on someone’s behalf from one the person made directly. AWS uses an MCP server as its example: the server swaps the user’s token for a narrowly scoped one before calling a backend API, and the claim records the server as the actor.

The backend only sees a token scoped to itself Signed-in user asks the agent for help Agent or MCP server acts for the user Backend API checks scope and actor Amazon Cognito token exchange (RFC 8693) user token scoped token with act claim user token + actor token one audience, narrower scope
The agent swaps the user's token before it calls the backend.

That distinction matters wherever actions have to be accounted for. It gives you an audit trail that says who asked and who acted, which is the first thing anyone will want to see when an agent-initiated change is queried. It also opens the door to policy that treats the two differently, for example letting an agent read a record while reserving an irreversible step for the person alone.

The exchange is available through the token endpoint or a new GetDerivedToken API, on the Essentials and Plus feature plans, in every Region where Cognito runs.

Agents that start in two seconds

The next-generation AgentCore runtime is now the default for new runtimes in Amazon Bedrock AgentCore. Each session is restored from a snapshot of an already initialised agent, so the agent no longer boots from cold every time. AWS quotes a session start of under 2 seconds at P75 on a 2 GB image, against 29.7 seconds on the previous generation.

Session start drops from about 30 seconds to under 2 P75 session start on a 2 GB image, as reported by AWS Previous generation 29.7 s Next generation under 2 s
AgentCore session start, previous generation against next generation.

That number changes what you can sensibly build. Thirty seconds is a long time in a conversation, and it pushes you towards keeping agents warm, or towards using them only for background work where nobody is watching a spinner. Two seconds puts an agent within reach of interactive use without that workaround.

The cost side has moved as well. Idle agents scale to zero, compute and memory grow with the workload up to 8 vCPU and 32 GB, and memory is reclaimed within minutes of being released. For multi-turn agents AWS reports billed memory per session falling by up to 68%.

Scaling to zero is the part I find most useful architecturally. If an idle runtime costs nothing, it becomes easier to justify separate runtimes with separate boundaries, where the economics previously nudged you towards sharing one. The isolation story is unchanged, since every session still runs in its own Firecracker microVM.

Adoption is about as gentle as it could be. New runtimes get the new generation by default in 19 Regions, London among them, and existing runtimes stay where they are until you set platformVersion to V2. You can also pin a new runtime to V1 if you need a like-for-like comparison, which is exactly what I intend to do before quoting anyone’s numbers but my own.

AWS on localhost

AWS Emulator lets you point your existing SDK and CLI calls at a local process in place of AWS. Responses come back in milliseconds, there is nothing to deploy, and you do not need an AWS account to use it. State lives in memory until the emulator stops.

The obvious benefit is the feedback loop. A test that creates a DynamoDB table, writes to it and checks an event was published can run on a laptop or in CI in the time it used to take to assume a role. Valid calls to supported operations return what AWS would return, and invalid calls return the same errors, so a mistake in a key schema surfaces at the point you make it.

The benefit I think will matter more over time is isolation. Every running copy gets its own port, its own keys and its own in-memory state, so test suites, CI jobs and coding agents cannot see each other’s resources. Anyone who has run several coding agents against one shared development account will know why that is welcome. Each agent can have a private AWS to break, and nothing needs cleaning up afterwards.

Each agent, test suite and CI job gets its own emulator Coding agent Test suite CI job Emulator instance Emulator instance Emulator instance own port, keys and state own port, keys and state own port, keys and state
One private emulator instance per client.

I also like how the coverage is built. Services are generated from the same published API models that sit behind the SDKs, so a new service or API appears in the emulator when AWS adds it, with its behaviour filled in and verified release by release. An operation that is not supported yet returns HTTP 501 Not Implemented, and AWS publishes a fidelity report comparing the emulator’s responses with the real thing.

That strikes me as a sensible way to handle gaps. A clear 501 tells you where local testing ends and where a deployed environment still has to take over, which is much better than a response that looks plausible and is subtly different. There is no additional charge, and the source is published under CC0.

Why they belong together

Taken in order, the three releases cover most of an agent’s path to production. You build and test against a local emulator, with each agent or pipeline in its own sandbox. You deploy to a runtime that starts quickly enough for a person to be waiting on it and costs nothing while it sits idle. Then every call the agent makes downstream carries a token that is scoped to that one service and says plainly that an agent is acting.

What I appreciate is that this is all plumbing. None of it makes an agent cleverer, but it does make one easier to trust, test and pay for, and in my experience those are the things that decide whether an agent gets past a proof of concept.

I have not yet run any of this in anger, so treat the figures above as AWS’s own. There are two things I plan to try and write up:

  1. An MCP server on Lambda behind API Gateway that exchanges the caller’s token for a narrowly scoped one before it calls a backend API, with an audit trail driven by the act claim.
  2. A Lambda, DynamoDB and EventBridge flow tested against the emulator locally and in CI, with honest notes on which calls come back as 501.

Sources


All writing