agentcore-iam-audit
Find the IAM paths that let one Amazon Bedrock AgentCore agent read or poison another agent's memory, invoke other agents, use their code interpreters, or let a developer run code as a more powerful role.
Why this exists
- Agent "God Mode" (Unit 42, April 2026). Execution roles auto-created by the AgentCore starter toolkit granted access to
memory/*,runtime/*,code-interpreter/*andrepository/*. Any agent could pull another agent's image, find its memory ID, then dump or poison that agent's memory, and invoke any other agent. AWS's answer: the default roles are for development and testing and "should never be used in a production system". The toolkit template was scoped down on 2025-12-09, but roles created before that still exist in accounts. (Unit 42) - Code-interpreter privilege escalation (Sonrai, 2025). A principal with
iam:PassRole+CreateCodeInterpreter+InvokeCodeInterpreterruns code as the interpreter's role, and CloudTrail attributes the calls to the interpreter, not to the person. (Sonrai, CSA) - AWS's own managed policy feeds that path.
BedrockAgentCoreFullAccess(v21) grantsbedrock-agentcore:*andiam:PassRoleon every role whose name containsBedrockAgentCore. That includes the toolkit's default roles and any admin role someone named...BedrockAgentCore....
General IAM scanners don't model AgentCore resources. This tool asks the concrete question for each role: can it reach a resource belonging to a different agent? It evaluates Allow, Deny, NotAction/NotResource and permission boundaries against probe ARNs.
Install
pipx install agentcore-iam-audit # offline mode, zero dependencies
pipx install "agentcore-iam-audit[live]" # + live mode (boto3)
Usage
# Offline: no credentials on the machine running the audit
aws iam get-account-authorization-details > gaad.json
agentcore-iam-audit --gaad gaad.json
# Live, read-only: IAM + AgentCore inventory (code interpreters, runtimes, browsers)
agentcore-iam-audit --live --profile audit --region us-east-1 --region us-west-2
# Before deploying: check one execution-role policy (e.g. from CDK/Terraform output)
agentcore-iam-audit --policy role-policy.json --trust trust-policy.json --role-name my-agent-role
agentcore-iam-audit --gaad gaad.json -f json --fail-on medium
Live mode needs iam:GetAccountAuthorizationDetails plus bedrock-agentcore:List*/Get* on code interpreters, runtimes and browsers. The AWS managed SecurityAudit policy covers the IAM part. Exit code 1 when anything is at or above --fail-on (default high).
Checks
| ID | Severity | Who | Finding |
|---|---|---|---|
| ACIA-001 | high | agent role | Read or write memory not owned by this agent (memory dump / poisoning) |
| ACIA-002 | high | agent role | InvokeAgentRuntime on other agents |
| ACIA-003 | high | agent role | Invoke other code interpreters in the account (code runs as their roles) |
| ACIA-004 | medium | agent role | Pull other agents' container images (memory IDs and config inside) |
| ACIA-005 | medium | agent role | GetSecretValue on all AgentCore Identity credential-provider secrets (bedrock-agentcore-identity!default/oauth2/*, /apikey/*) |
| ACIA-010 | high / medium | any principal | Privilege escalation: PassRole an AgentCore role + Create/InvokeCodeInterpreter. High when a passable role is admin-equivalent |
| ACIA-011 | medium | any principal | Run code in existing custom code interpreters as their execution roles |
| ACIA-020 | low | agent role | Starter-toolkit default role (AmazonBedrockAgentCoreSDKRuntime-*, ...SDKCodeBuild-*, AgentCoreEvalsSDK-*) |
| ACIA-021 | medium | agent role | Trust policy for bedrock-agentcore.amazonaws.com without aws:SourceAccount/aws:SourceArn (confused deputy) |
| ACIA-030 | medium | live | Custom code interpreter with an execution role in PUBLIC network mode (credential exfiltration path) |
"Agent role" means a role that bedrock-agentcore.amazonaws.com can assume. Findings marked (conditional) came from a statement with a Condition the tool didn't evaluate; check it by hand.
How it was tested
- Real policy documents, not invented ones:
- the starter toolkit's execution-role template from just before the 2025-12-09 scoping fix, and the current version, both rendered with Jinja2 as the toolkit does;
- its trust policy;
- AWS's managed
BedrockAgentCoreFullAccess(v21, from the MAMIP archive).
- Results:
- The pre-fix role produces every Unit 42 path.
- The current role produces only ACIA-005 and the default-role notice.
- A user holding only
BedrockAgentCoreFullAccessis flagged for escalation to an admin role namedMyBedrockAgentCoreDeployRole, but not toprod-admin.
- Negative cases: explicit
Deny+NotResource, a read-only permission boundary, PassRole limited to another service (iam:PassedToService), region-scoped policies, and admin principals (nothing to escalate to). - Live mode: tested with botocore's
Stubber, so every request and response is validated against AWS's real API model forbedrock-agentcore-control. - CI: Linux/macOS/Windows × Python 3.11–3.14. CI also rebuilds the account fixture from the source documents and fails if it drifts.
Limits
- SCPs, resource-based policies and session policies aren't evaluated. A finding means "identity policy allows it". An SCP may still block it, as Sonrai and CSA recommend.
- Conditions other than
iam:PassedToServiceare reported, not evaluated. - "Admin-equivalent" means the role can modify IAM role policies or create user access keys.
Responsible use
For accounts you own or are authorized to assess. The tool is read-only: offline mode reads a JSON file, and live mode calls only Get*/List* APIs.
License
Metadata
Release files for agentcore-iam-audit 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentcore_iam_audit-0.1.1.tar.gz | 27.9 kB | With provenance | Details for agentcore_iam_audit-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentcore_iam_audit-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for agentcore_iam_audit-0.1.1-py3-none-any.whl |
Total release size: 44.0 kB
Release files / agentcore_iam_audit-0.1.1.tar.gz
| Download URL | agentcore_iam_audit-0.1.1.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d43502a0a29e0c81897ec783e09f61c94c244a735ab2d01cb085b67613d546ac
|
|
BLAKE2b-256 checksum How to use checksums |
5660f372cee9df5f2e00bc8e7c752a2cbc23a064baa3b26cb497b1c0cb6cc522
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / agentcore_iam_audit-0.1.1-py3-none-any.whl
| Download URL | agentcore_iam_audit-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
179c8a5e1f2140044291dfc6af7842a341f9886e80df4cb1bd14cf204b2ba8f0
|
|
BLAKE2b-256 checksum How to use checksums |
6e1704a64ed685869facdf54115587ce550410db8fec6bc0385883ac284886bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for agentcore-iam-audit 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agentcore_iam_audit-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.