How to hand each agent and sub-agent its own narrowed, short-lived credentials without creating a new IAM role for every task
The problem: agents inherit everything
Most agent stacks on AWS share one awkward habit. The orchestrator runs under an IAM role (a Lambda execution role, an ECS task role, an EC2 instance profile or a developer's aws login session), and every tool call, sub-agent and code-execution step quietly reuses those same credentials. The model decides at runtime which API to call, often based on prompts or tool output it does not fully control. If the role can delete a table, so can the agent, whether or not that was ever part of the task.
The usual fixes are heavy. You can create a dedicated role per agent and per task and chain AssumeRole calls, but that means more trust policies, more roles to govern and a role-sprawl problem that grows with every new tool.…