AI agents in AWS are spread across two Bedrock services, every Region and every account, and each one carries an IAM role, tools and endpoints that someone has to own. Bedrock Agents, AgentCore Runtime agents, AgentCore gateways and inline agents invoked at run time all leave different traces, and none of the console pages shows them together. This runbook builds a reconciled inventory with read-only AWS CLI calls, adds the IAM role and tool detail that makes the inventory useful for security, and uses CloudTrail to find agents that do not appear as resources at all. It then covers pausing and removal with a rollback. It is for cloud security and platform engineers working across one account or an AWS Organization. For the service's security model, see the Amazon Bedrock Security Guide and the AWS Bedrock AgentCore Security Guide.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. AgentCore APIs are changing quickly, so confirm commands and fields against the current AWS CLI reference.
Key takeaways
- There are two control planes. Classic Bedrock Agents live under
aws bedrock-agent; AgentCore runtimes, gateways, workload identities and credential providers live underaws bedrock-agentcore-control. Inventory both, in every Region. - The role is the risk.
agentResourceRoleArnon a Bedrock agent androleArnon an AgentCore runtime define what the agent can reach in AWS; record and review them with the agent. - Tools hide in action groups. Each action group points at a Lambda function or returns control to the caller, and may enable built-in signatures such as
AMAZON.CodeInterpreterorANTHROPIC.Bash. - Some agents are not resources.
InvokeInlineAgentcalls create agents at run time; only CloudTrail data events forAWS::Bedrock::InlineAgentreveal them. - Pause before you delete. Setting an alias to
REJECT_INVOCATIONSstops invocations and is reversible; deletion is not.
When you need this
- Before agents reach production: a baseline per account and Region lets every new agent be reviewed as a change rather than discovered after an incident.
- For audit or an AI register: NIST SP 800-53 CM-8 and NIST CSF 2.0 ID.AM-02 call for an inventory of system components and services. The AI Register and AI Inventory Template holds the governance record this inventory feeds.
- When cost or model invocation spikes: unknown agents often show up first as Bedrock spend or CloudTrail activity from a role nobody recognises.
- Before tightening IAM: you cannot right-size agent roles until you know which agents use them.
What counts as an agent in AWS Bedrock
| Object | List command | Identity it uses | What to record |
|---|---|---|---|
| Bedrock agent | aws bedrock-agent list-agents | Service role in agentResourceRoleArn | Model, instructions, guardrail, memory, collaboration mode, status |
| Agent alias | aws bedrock-agent list-agent-aliases | Callers need permission to invoke the alias | Version routed, aliasInvocationState, status |
| Action group | aws bedrock-agent list-agent-action-groups | Lambda execution role, or the calling application with RETURN_CONTROL | Executor, API or function schema, signature, state |
| Inline agent | None: CloudTrail InvokeInlineAgent data events | The calling principal | Calling role, frequency, source application |
| AgentCore runtime | aws bedrock-agentcore-control list-agent-runtimes | roleArn, plus a workload identity | Protocol, network mode, inbound authoriser, artefact, environment variables |
| AgentCore gateway and targets | list-gateways, list-gateway-targets | Gateway role and outbound credential providers | Which tools and APIs are exposed to agents |
| Workload identities and credential providers | list-workload-identities, list-oauth2-credential-providers, list-api-key-credential-providers | Agent identity and stored third-party credentials | Which agent uses which external credential |
| Agent Registry records | aws agent-registry list-discoverable-registry-records | Not an identity: a catalogue entry | What teams registered, compared with what you discovered |
The AWS Agent Registry is a catalogue that teams publish records into (record types AGENT, MCP, SKILL and CUSTOM), not a discovery tool. Its browse API returns only records whose latest revision is Approved, so draft and pending records are invisible there. AWS has moved the registry to the agent-registry namespace and announced that support for the preview bedrock-agentcore namespace would end on 30 October 2026; check which namespace your registries use. Treat the registry as the "declared" list and the CLI discovery below as the "actual" list.
Before you start
- Permissions: use a read-only role that allows the
bedrock:List*andbedrock:Get*agent actions, the AgentCore control plane list and get actions,iam:GetRoleand list policy actions,lambda:GetFunctionand CloudTrail read. Keep update and delete permissions in a separate role behind approval. - Scope: list the Regions enabled in each account (
aws ec2 describe-regions --query "Regions[].RegionName") and run every step per Region. Agents in an unexpected Region are a finding in themselves. - Logging: management events such as
CreateAgentare in CloudTrail by default. Agent invocation is a data event and is only logged if you add advanced event selectors forAWS::Bedrock::AgentAliasandAWS::Bedrock::InlineAgent, which incurs extra CloudTrail charges. - Record format: account, Region, agent type, ID and ARN, name, status, owner tag, IAM role, tools, data sources, inbound authoriser, last updated and decision.
Step-by-step
Steps 1 to 6 are read-only. Step 7 is reversible. Step 8 is destructive.
- List Bedrock agents in each Region.
The CLI pages automatically. Note agents inaws bedrock-agent list-agents --region <region> \ --query "agentSummaries[].{ID:agentId,Name:agentName,Status:agentStatus,Version:latestAgentVersion,Updated:updatedAt}" \ --output tableNOT_PREPAREDorFAILEDstatus: they are often abandoned experiments that still hold a role. - Read each agent's configuration and role.
Recordaws bedrock-agent get-agent --agent-id <agent-id> \ --query 'agent.{model:foundationModel,role:agentResourceRoleArn,guardrail:guardrailConfiguration,memory:memoryConfiguration,collab:agentCollaboration,orch:orchestrationType}'agentResourceRoleArn, then read the role's trust policy and attached and inline policies withaws iam get-role,list-attached-role-policiesandlist-role-policies. Flag agents with no guardrail, with memory enabled (SESSION_SUMMARYwith astorageDaysvalue up to 365), withCUSTOM_ORCHESTRATION(a Lambda in the loop) or with aSUPERVISORcollaboration mode that delegates to other agents. - Enumerate aliases and action groups.
Run action groups foraws bedrock-agent list-agent-aliases --agent-id <agent-id> \ --query 'agentAliasSummaries[].{id:agentAliasId,name:agentAliasName,status:agentAliasStatus,version:routingConfiguration[0].agentVersion}' aws bedrock-agent list-agent-action-groups --agent-id <agent-id> --agent-version <version> aws bedrock-agent get-agent-action-group --agent-id <agent-id> --agent-version <version> --action-group-id <id> \ --query 'agentActionGroup.{executor:actionGroupExecutor,signature:parentActionSignature,state:actionGroupState}'DRAFTand for every version an alias routes to, since they can differ. For each Lambda executor, record the function's own execution role. FlagENABLEDaction groups with the signaturesAMAZON.CodeInterpreter,ANTHROPIC.Computer,ANTHROPIC.BashorANTHROPIC.TextEditor, and function schemas whererequireConfirmationisDISABLEDon actions that change data. - List AgentCore runtimes and their details.
Record the protocol (aws bedrock-agentcore-control list-agent-runtimes --region <region> \ --query 'agentRuntimes[].{Name:agentRuntimeName,Id:agentRuntimeId,Status:status}' aws bedrock-agentcore-control get-agent-runtime --agent-runtime-id <id> \ --query '{role:roleArn,network:networkConfiguration.networkMode,protocol:protocolConfiguration.serverProtocol,auth:authorizerConfiguration,identity:workloadIdentityDetails.workloadIdentityArn}'MCP,HTTP,A2AorAGUI), whether the runtime runs inPUBLICorVPCnetwork mode, and the inbound JWT authoriser'sdiscoveryUrl,allowedAudienceandallowedClients. ReviewenvironmentVariablesfor anything that looks like a secret; see How to find secrets in AI agent transcripts and traces for the wider pattern. - List the AgentCore tool and credential layer. Run
list-gatewaysandlist-gateway-targetsto see which APIs and Lambda functions are exposed as tools, thenlist-workload-identities,list-oauth2-credential-providersandlist-api-key-credential-providers. Map each credential provider to the runtimes that use it: these are the third-party tokens your agents hold. The Cloud Agent Identity Services Compared guide explains how workload identities fit. - Find agents that are not resources. Query CloudTrail (Lake or your SIEM) for
eventSourcebedrock.amazonaws.comand the eventsInvokeInlineAgentandInvokeAgent, grouped by calling principal. Inline agents and callers of aliases you did not list are your shadow agents. Also search management events forCreateAgentover the retention window to find who creates agents and from where. - Reconcile, tag owners and pause (reversible). Join the results with the Agent Registry records and your AI register. Tag each agent and role with owner and purpose. For an unowned or unjustified agent, pause the alias:
The alias name is required even when only the state changes. Set an action group toaws bedrock-agent update-agent-alias --agent-id <agent-id> \ --agent-alias-id <alias-id> --agent-alias-name <alias-name> \ --alias-invocation-state REJECT_INVOCATIONSDISABLEDto remove a single tool. For an AgentCore runtime, add an explicit deny to its role or tighten the inbound authoriser's allowed clients. Hold for a full business cycle. - Delete (destructive). After owner sign-off and the hold period, delete aliases, action groups and the agent, or the AgentCore runtime, then decide separately whether the IAM role, Lambda functions and credential providers are still needed. Export the full configuration from steps 2 to 5 first: it is your only rebuild source.
Verify it worked
- Coverage: every account and enabled Region has a dated result for both control planes, including empty results.
- Paused state:
list-agent-aliasesshowsREJECT_INVOCATIONSand CloudTrail shows no successfulInvokeAgentfor that alias. - Reconciliation: every discovered agent has an owner tag and a register entry, and every Approved registry record maps to a real resource.
- No breakage: owners confirm no failed workflow during the hold period.
Rollback and common errors
| Situation | Fix |
|---|---|
| A paused agent is needed | update-agent-alias ... --alias-invocation-state ACCEPT_INVOCATIONS |
| A disabled action group is needed | Set actionGroupState back to ENABLED and prepare the agent again |
| A runtime role deny broke a needed agent | Remove the deny statement from the runtime role |
| A deleted agent is needed | No restore: rebuild from infrastructure as code or the exported configuration; callers must use new IDs |
| Empty results in a Region you expected | Check --region, the profile's account and whether the Region is enabled |
No InvokeAgent events found | Data events are not logged by default; add the advanced event selectors and re-check later |
| Registry shows fewer records than expected | The browse API returns only Approved records; draft and pending ones are excluded |
Common failure patterns
- One Region only: teams test in a Region close to the model they want, so agents appear far from the main estate.
- Inventorying agents, not roles: the agent record without its role and Lambda execution roles hides the real blast radius. The agent's reach is the union of those roles.
- Checking DRAFT only: production aliases route to numbered versions whose action groups may differ from the draft.
- Trusting the registry as the inventory: it lists what teams declared and approved, not what runs.
- Ignoring inline agents: with no resource to list, they surface only if data events are on.
Hardening afterwards
- Turn on the data events: keep advanced event selectors for agent aliases and inline agents in your organisation trail, and alert on callers outside the approved list.
- Require tags at creation: enforce owner and purpose tags on agents, runtimes and roles through infrastructure as code checks.
- Right-size roles: use IAM last accessed data on agent roles and remove unused services. See How to find unused AWS IAM roles and access keys.
- Register what you keep: publish approved agents into the Agent Registry so the declared list matches the actual list. The AI agent registry guide covers the operating model.
Single account or AWS Organization
A single team account can run steps 1 to 5 as a short script per Region and keep the output in a spreadsheet. An AWS Organization should run the same calls from a central security account that assumes a read-only role in every member account, write results to one store, and use an organisation trail for the data events. Prioritise accounts with Bedrock spend first; they are where agents actually exist.
Metrics
| Metric | Direction |
|---|---|
| Agents and runtimes without an owner tag | Zero |
Principals calling InvokeInlineAgent outside the approved list | Zero |
| Enabled action groups with code execution or shell signatures and no review | Zero |
| Agent roles with unused service permissions | Falling |
| Discovered agents not in the registry or AI register | Falling to zero |
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | CM-8 System Component Inventory; AC-6 Least Privilege; AU-12 Audit Record Generation | Agents as inventoried components; minimal role permissions; data event logging |
| NIST CSF 2.0 | ID.AM-02; PR.AA-05; DE.CM-09 | Service inventory; permission review; runtime monitoring |
| CIS Controls v8.1 | Control 2 Inventory and Control of Software Assets | Known and authorised agents only |
| MITRE ATT&CK | T1078.004 Cloud Accounts | Unowned agent roles as valid cloud credentials for abuse |
Practitioner checklist
- Enumerate enabled Regions in every account before listing anything.
- Run
list-agentsandlist-agent-runtimesin each Region. - Record the agent role, runtime role and every Lambda execution role.
- Check action groups for the draft and every aliased version.
- List gateways, workload identities and credential providers and map them to agents.
- Enable data events for agent aliases and inline agents, and group callers.
- Compare discovered agents with Approved Agent Registry records.
- Pause with
REJECT_INVOCATIONSbefore any deletion and export configuration first.
Standards and references
- AWS CLI Reference: bedrock-agent list-agents
- AWS CLI Reference: bedrock-agent get-agent
- AWS CLI Reference: bedrock-agent get-agent-action-group
- AWS CLI Reference: bedrock-agent update-agent-alias
- AWS CLI Reference: bedrock-agentcore-control get-agent-runtime
- AWS CLI Reference: bedrock-agentcore-control list-workload-identities
- AWS: Browse approved records in AWS Agent Registry
- AWS: Monitor Amazon Bedrock API calls using CloudTrail
Related NHI Mgmt Group resources: AWS Bedrock AgentCore Security Guide · Amazon Bedrock Security Guide · AI agent registry · Cloud Agent Identity Services Compared · How to inventory AI agents in Microsoft 365