AWS Builder Center

Kiro Web for all your accounts

How you can configure Kiro Web with fine grained permissions across all your accounts

Building in the fast lane
Kiro Web is a great tool for working in the secure remote sandbox environment that it provides. However, Kiro Web wasn't always able to interact with all your AWS accounts. Many orgs and individuals operate a multi account AWS Organization (following practices from the AWS Well-Architected Framework) and allowing Kiro to only assume a single role made it hard for Kiro to work effectively across applications, teams or environments. In this post I'll look at how you can configure this set up.
When Kiro Web first launched it wasn't able to run the AssumeRole STS command, so you were stuck with the role that was configured. That has recently changed, and with Kiro Web now generally available it's possible to configure Kiro to work across many accounts. This post will expand on some of the detail  available in the Kiro Docs . We'll take advantage of the   sts:AssumeRole   command to allow Kiro to assume a scoped role in any account it needs access to.
The first thing we need is the role that Kiro Web itself assumes. Usually this would contain all the permissions it needs to do things. Instead we'll make it deliberately thin. This role can do exactly one thing: call  sts:AssumeRole  against roles in your other accounts. It can't read a log group, it can't list a bucket, it can't describe an instance. On its own it is useless, and that's the point. All the actual permissions live in the other roles, in the accounts where the work happens, owned by whoever owns those accounts. This follows the hub and spoke approach, where we have that thin central hub role and the specific and dedicated spoke roles.
Because it's thin, it also belongs somewhere central. Put it in a platform or security account rather than in one of your workload accounts, and the team that owns that account owns the blast radius of Kiro Web across your entire organization from a single place. That gives them two levers worth having. The first is the OU boundary: you can say "this role may only assume into accounts under the non-production OU", so a misconfiguration in a spoke account can't quietly hand Kiro a path into production. If your org units are split by environment, or by team, this maps onto your existing structure. The second is a permissions boundary, which caps what the hub role can ever be granted, no matter what someone attaches to it later.
A nice detail with this pattern is that the source identity Kiro Web sets on the first hop persists through the chain. Assume the hub role, chain into a spoke role, and every call in that spoke account still carries your Kiro user ID in CloudTrail. You get per-user attribution in accounts the user was never directly granted access to, and there's nothing to configure to get it.
This permissions policy may look something like this:
JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AssumeKiroSpokeRolesInNonProdOu",
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::*:role/kiro-web/*",
"Condition": {
"ForAnyValue:StringLike": {
"aws:ResourceOrgPaths": [
"o-a1b2c3d4e5/r-ab12/ou-ab12-11111111/*"
]
}
}
}
]
}
This policy is saying that Kiro can perform the AssumeRole action on any role in any of your accounts where the role name starts with  kiro-web  as long as it is inside an Org Unit path. In your specific accounts you may have a naming convention you follow for the name, or have your Org structure set up differently, but ultimately you have control over this to configure how you need. Next you need the Trust Policy that is attached to this Role. This is how you ensure that only Kiro Web can assume this initial role.
JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowKiroWebToAssume",
"Effect": "Allow",
"Principal": { "Service": "q.amazonaws.com" },
"Action": [
"sts:AssumeRole",
"sts:SetSourceIdentity"
],
"Condition": {
"StringLike": {
"sts:SourceIdentity": "d-xxxxxxxxxx.*"
}
}
},
{
"Sid": "AllowKiroWebSessionTags",
"Effect": "Allow",
"Principal": { "Service": "q.amazonaws.com" },
"Action": "sts:TagSession",
"Condition": {
"ForAllValues:StringEquals": {
"aws:TagKeys": ["GroupIds", "KiroSessionId"]
}
}
}
]
}
This Trust Policy is from Kiro's own examples and the docs. Line 14 ( "sts:SourceIdentity": "d-xxxxxxxxxx.*" ) is set up so anyone logging into Kiro Web via your own Identity Center can have Kiro Web assume this role.
This Trust Policy should be attached to the Role with the Permission Policy we created above. Now Kiro is able to assume a role in your central account with the sole permission of then being able to assume other Roles you have configured for it.
In each account you want Kiro to reach, you create a spoke role, and this is where the real permissions live. The trust policy is similar to what we just built but it names the hub role as the only thing allowed in:
JSON
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowKiroWebHubRole",
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111111111111:role/kiro-web-hub" },
"Action": "sts:AssumeRole"
}
]
}
If you want an additional condition, source identity does survive into the chained session, so you can require it here too.  "StringLike": { "aws:SourceIdentity": "d-xxxxxxxxxx.*" }  alongside a Null check to make sure it's actually present. That means even something holding the hub role's credentials outside Kiro Web can't take the second hop.
Then attach whatever that account's work actually needs. Read-only CloudWatch Logs for a debugging role, read-only across the account for an investigation role, something narrower for a specific job. Keep it read-only unless you have a concrete reason not to. I would only ever have write permissions scoped to a low tier environment, and with a very strict set of write actions. Maybe a specific application needs some writes for an integration test, so I'd allow that here. But I'd be very cautious about granting write in an unbounded way.
If you manage accounts with Control Tower, Terraform or a similar baseline, this is a good candidate for the baseline itself. You can deploy the role everywhere at the right path and Kiro can reach any account in scope the moment it needs to, with no per-account setup.
Role chaining caps the session at one hour, regardless of what MaxSessionDuration says on either role. A long agent session will re-assume periodically, and you'll see a fair amount of CloudTrail volume as a result.
Now that Kiro Web is able to assume a central role and then assume a role in your accounts to actually do things, it's important to be able to trace and log what happened. Thankfully, CloudTrail captures all the role assumptions and, provided you used the trust policy above, is able to trace those back to the identity that started the Kiro Web session.
First we have the initial AssumeRole into our Hub Role:
JSON
{
"eventTime": "2026-09-03T14:31:40Z",
"eventSource": "sts.amazonaws.com",
"eventName": "AssumeRole",
"awsRegion": "us-east-1",
"sourceIPAddress": "q.amazonaws.com",
"userAgent": "q.amazonaws.com",
"userIdentity": {
"type": "AWSService",
"invokedBy": "q.amazonaws.com"
},
"requestParameters": {
"roleArn": "arn:aws:iam::111111111111:role/kiro-web-hub",
"roleSessionName": "d-1234567890.a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"durationSeconds": 900,
"sourceIdentity": "d-1234567890.a1b2c3d4-5e6f-7890-abcd-ef1234567890"
},
"responseElements": {
"assumedRoleUser": {
"arn": "arn:aws:sts::111111111111:assumed-role/kiro-web-hub/d-1234567890.a1b2c3d4-5e6f-7890-abcd-ef1234567890"
}
}
}
There's no IAM principal in this event at all.  userIdentity.type is  AWSService  and  invokedBy  is  q.amazonaws.com , because Kiro Web itself is the caller rather than anything in your account. The human is in  sourceIdentity  which is your Identity Center directory ID, then the user ID of whoever started the session, which you can resolve to a name with  aws identitystore describe-user . That value is set by the service and can't be changed for the life of the session, which is what separates it from  roleSessionName .
Kiro takes 15-minute sessions, so a working agent re-assumes frequently.
Then we have the AssumeRole into the Spoke Role:
JSON
{
"eventTime": "2026-09-03T14:38:50Z",
"eventSource": "sts.amazonaws.com",
"eventName": "AssumeRole",
"awsRegion": "us-east-1",
"recipientAccountId": "222222222222",
"sharedEventID": "98bdf4e9-1b5e-4bd4-bcff-96a4255b9e2c",
"userIdentity": {
"type": "AWSAccount",
"principalId": "AROAEXAMPLEHUBROLEID:d-1234567890.a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"accountId": "111111111111",
"invokedBy": "q.amazonaws.com",
"sourceIdentity": "d-1234567890.a1b2c3d4-5e6f-7890-abcd-ef1234567890"
},
"requestParameters": {
"roleArn": "arn:aws:iam::222222222222:role/kiro-web/cloudwatch-reader",
"roleSessionName": "kiro-web-session"
}
}
This is the event that proves the chain is real rather than something else reaching your spoke role. The caller isn't a user or a service. It's the hub role's session, identified by the hub role's unique ID plus the session name from the first hop, in your central account. And  sourceIdentity  is still there, because it persists through role chaining. The same event is written to both accounts' trails with a matching  sharedEventID , so you can see it from either side.
From here, every API call the agent makes in the spoke account carries the same  sourceIdentity , alongside  requestParameters  showing exactly what it touched, and a  userAgent  ending in  md/command#logs.tail . If you've ever wanted to know what an agent did rather than what it was allowed to do, that's the field.
This allows us to follow what the agent was doing, scoped to specific Roles, initiated by a human identity.
In this blog post I've shown how you can configure Kiro Web to securely assume roles across your AWS Accounts, track what it is doing and ensure you're following an audited way for the agent to carry out work. Are you using Kiro Web? Let me know what you've been using it for and if this will help you work across all your accounts.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article