
How to Turn Your Existing Workflows and APIs Into Reliable AI Agent Tools
Agents must know which user they act for, and the model must not be able to change it. Three identity patterns on AWS, from cross-Region trusted identity propagation to Cedar-scoped tools, plus a checklist.
Who Is Your Agent Acting For? Designing User Identity for AI Agents on AWS
Most agent tutorials show how an agent calls a tool. Fewer show how the tool knows whose data it is allowed to touch. When an agent acts on behalf of a person, that question decides whether your system is safe. Two AWS items from late October 2026 point at the same problem from different directions, and together they make a useful design checklist.
The first is AWS IAM Identity Center's cross-Region trusted identity propagation, announced on October 26. The second is a customer write-up on the AWS Machine Learning Blog, published October 29, in which MoEngage describes turning roughly 400 private APIs into agent tools with Amazon Bedrock AgentCore Gateway. They are separate features, and I am not claiming one is built on the other. What they share is a principle: identity should travel with the request, outside the model's control.
The problem: the model should not decide who it is acting for
If a tenant ID, user ID, or role is a normal tool parameter, a language model can get it wrong, or be talked into changing it. MoEngage's engineers state the requirement plainly: identity must be structurally out of the model's reach. Their agents call internal APIs that depend on tenant, user, role, and database context, so that context is injected by the calling service and never shown to the model as something it can set.
The alternative failure mode is the opposite: giving the agent one broad role that cannot tell users apart. Then every request runs with the same permissions, and your audit log cannot say who accessed what.
Pattern 1: Carry the user's identity with the request
Trusted identity propagation carries a user's identity along with their request, so AWS services can grant permissions based on who the user is and their group memberships, and log that user's access for auditing.
Until October 26, it had a practical limit: every AWS service that needed to read the user's identity had to run in the same Region. If you wanted to separate compute from data, use capacity where it was available, or plan for disaster recovery in another Region, you had two poor options. You could grant access through broad IAM roles that cannot distinguish individual users, or you could consolidate everything into one Region.
With cross-Region support, the user's identity now travels automatically to services in other Regions. AWS lists it as available at no additional cost in every Region where IAM Identity Center is available. For agent builders, this matters because agents often span services: a Region for the model, another for the data, another for the workflow. You can now keep per-user access control across all of them.
Pattern 2: Pass identity out of band, not as an argument
MoEngage's design shows what "out of the model's reach" looks like in practice. Their agents are services that already have IAM roles, so the internal gateway authenticates with SigV4 signing rather than issuing new tokens. Tenant, user, role, and database context are converted by a client library into request headers. The model never sees them and cannot set or override them.
They also separated discovery from execution. Listing and searching tools carries no tenant identity. Only a tool call does. That keeps discovery cheap and makes the audit trail clear: every request that carries identity is an actual data access.
Pattern 3: Show each agent only the tools it may use
Four hundred tool definitions at roughly 50 tokens each would cost over 20,000 tokens on every connection. Filtering on the client side does not help, because the full catalog has already been sent, and filtering by convention is not an authorization boundary.
MoEngage instead uses Cedar policies in AgentCore Gateway. Each agent authenticates as its own IAM role, and the policy decides which tools it can see and call. An agent that should not write never receives write tools in its list. For discovery, agents use a single search tool: they describe the task, the gateway's semantic search returns candidates, and only those become callable.
A checklist you can apply today
- List every identity attribute your tools depend on (tenant, user, role). Remove each one from the model's tool parameters.
- Inject those attributes from the authenticated session, in headers or request context.
- Give each agent its own role, and write down what that role can see and call.
- Scope the tool list on the server, so unauthorized tools are never sent.
- If your workload spans Regions, check whether per-user identity can now travel with the request instead of falling back to a shared role.
- Log every identity-bearing call so you can answer "who accessed what, through which agent."
Results worth noting, with context
MoEngage reports running this in production for three months, with roughly 400 operations available to 10 internal agents across seven Regions. They estimate it saved about six months of platform engineering and cut the time to onboard a new API from days to hours. These are the company's own figures from a customer story, so treat them as one team's experience rather than a benchmark.
Takeaway
Safe agents are not only about better models or better prompts. They depend on knowing, at every tool call, which person the agent is acting for, and on making sure the model cannot change that answer. Keep identity out of the model's hands, scope tools per agent, and carry the user's identity across services. The two October announcements make each of those easier to do on AWS.
Sources: AWS "What's New" post on cross-Region trusted identity propagation (October 26, 2026); "How MoEngage turned over 400 APIs into agent tools with AgentCore Gateway," AWS Machine Learning Blog (October 29, 2026).
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article