An analyst looking at a leaked string, a CloudTrail record or a resource policy often has to decide in seconds whether an AWS identifier is a long-term key, a short-lived session key, a role or an IAM user, and the four-character prefix answers that question before any lookup is run. AWS assigns every IAM user, group, role, managed policy, instance profile and server certificate a unique ID, and access key IDs follow the same prefix scheme. This reference lists every prefix AWS documents, explains what each tells you and what it does not, and shows how to use prefixes in detection rules, policy design and leak triage. It is written for cloud security engineers and SOC analysts who work with AWS logs and secret scanning alerts. For how IAM policies and roles work in general, see the AWS IAM Policies and Roles 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. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- AKIA means long-term, ASIA means temporary. AWS states that access key IDs beginning with AKIA are long-term credentials for an IAM user or the root user, and those beginning with ASIA are temporary credentials created by AWS STS.
- Twelve prefixes are documented. The IAM User Guide lists ABIA, ACCA, AGPA, AIDA, AIPA, AKIA, ANPA, ANVA, APKA, AROA, ASCA and ASIA; treat anything else as unverified and look it up rather than guess.
- Unique IDs survive name reuse. A deleted user called John and a new user called John share an ARN pattern but never a unique ID, which is why AIDA and AROA IDs matter in resource policies and in your own identity inventory.
- The prefix tells you type, not state. STS GetAccessKeyInfo returns the owning account for a key ID but, as AWS notes, does not say whether the key is active, inactive or deleted.
- Triage differs by prefix. An AKIA key needs deactivation and rotation; an ASIA key needs the issuing role's sessions revoked, because deactivating a user key does nothing to a session that has already been issued.
Why prefixes matter
Most day-to-day AWS work uses friendly names and ARNs, and AWS recommends ARNs in policies. Unique IDs earn their place in three situations.
- Name reuse: friendly names for users, groups, roles and policies must be unique within an account but can be reused after deletion. The IAM User Guide gives the example of a deleted user John whose replacement, also called John, inherits whatever a policy granted to the name. A unique ID such as
AIDACKCEVSQ6C2EXAMPLEis never reissued, so a resource policy that names the ID does not silently extend to the new person. - Logs: CloudTrail's
userIdentity.principalIdcarries the unique ID. For an IAM user it is the AIDA ID; for an assumed role it is the AROA role ID followed by a colon and the session name, for exampleAROAIDPPEZS35WEXAMPLE:AssumedRoleSessionName. - Leaked strings: secret scanners, paste-site monitoring and incident tickets usually surface an access key ID alone. The prefix tells the responder which playbook to open before anyone has console access.
The unique ID is not shown in the IAM console. Retrieve it with get-user, get-role, get-group, get-policy, get-instance-profile, get-server-certificate or get-caller-identity in the AWS CLI, or the matching IAM and STS API calls.
Prefix table
The table lists the prefixes in the IAM User Guide's "Unique ID prefixes" section, in the same alphabetical order. AWS notes that prefixes may vary based on when a resource was created, so build detections that tolerate older formats.
| Prefix | Resource type (AWS wording) | Where you usually see it | Secret or identifier? |
|---|---|---|---|
| ABIA | AWS STS service bearer token | accessKeyId in CloudTrail for services that use bearer tokens, such as CodeArtifact | Credential: token valid only for the issuing service and Region |
| ACCA | Context-specific credential | Records for context-specific credentials | Credential identifier: treat as sensitive until confirmed |
| AGPA | User group | get-group output, inventory exports | Identifier only |
| AIDA | IAM user | principalId for IAMUser events, resource policy Principal, aws:userid | Identifier only |
| AIPA | Amazon EC2 instance profile | get-instance-profile output | Identifier only |
| AKIA | Access key | Credentials files, environment variables, code repositories, accessKeyId in CloudTrail | Key ID of a long-term secret pair |
| ANPA | Managed policy | get-policy output (PolicyId) | Identifier only |
| ANVA | Version in a managed policy | Policy version metadata | Identifier only |
| APKA | Public key | Public key metadata | Identifier only |
| AROA | Role | principalId for AssumedRole events (before the colon), resource policies, aws:userid | Identifier only |
| ASCA | Certificate | Certificate metadata | Identifier only |
| ASIA | Temporary (AWS STS) access key ID | Session credentials from AssumeRole, GetSessionToken, instance and task roles; accessKeyId in CloudTrail | Key ID of a temporary credential, unique only with its secret and session token |
Identifier-only prefixes are not secrets. Seeing an AIDA or AROA value in a ticket or a policy file is not an exposure by itself, although it does tell an outsider something about your account structure.
Access keys: AKIA and ASIA
An access key has two parts, the access key ID and the secret access key, and both are needed to sign a request. The ID alone cannot authenticate, but AWS still warns against sharing keys "even to help find your account identifiers", because the pair grants access until revoked.
| Property | AKIA (long-term) | ASIA (temporary) |
|---|---|---|
| Issued to | An IAM user or the root user | A role session, federated user or GetSessionToken caller via AWS STS |
| Parts | Key ID and secret access key | Key ID, secret access key and session token |
| Lifetime | Until deactivated or deleted | Until the session expires |
| Limit | Two access keys per IAM user | Set by role and session duration settings |
| Find the owner | Credentials report or list-access-keys per user; root keys via root sign-in | STS events in CloudTrail (AssumeRole and similar) that returned the key ID |
| Contain | Deactivate, rotate, then delete | Revoke the issuing role's active sessions, fix whatever leaked the session |
| Recover a lost secret | Not possible: delete and create a new key | Request new temporary credentials |
AWS recommends temporary credentials such as IAM roles over long-term access keys, so a healthy estate should see the share of AKIA keys in CloudTrail fall over time. See the AWS Access Keys Security Guide for the controls around long-term keys and the AWS STS and AssumeRole Guide for session design.
ABIA bearer tokens: some services, CodeArtifact being AWS's documented example, use bearer tokens instead of Signature Version 4. AWS states that the token's access key ID begins with ABIA so that you can identify these operations in CloudTrail, and that the token works only for the service and Region that issued it. Generating one requires sts:GetServiceBearerToken, so that action is a useful control point. See the AWS CodeArtifact Security guide.
Principals: AIDA, AROA and others
AIDA and AROA are the prefixes analysts meet most often after the key prefixes, because they appear in CloudTrail and in policies.
- AIDA in policies: a resource-based policy can list a user's unique ID in the
Principalelement, for example"AIDACKCEVSQ6C2EXAMPLE", so access does not pass to a later user with the same name. - AROA with
aws:userid: theaws:useridglobal condition key holds the AIDA ID for an IAM user andAROA...:role-session-namefor a role session. A condition such as"AROA1234567890EXAMPLE:*"matches every session of one role, and a specific session name narrows it further. See the AWS IAM Global Condition Keys Reference. - Role recreation: deleting and recreating a role with the same name produces a new AROA ID. Policies that reference the old unique ID stop matching, which is a safety feature but can also explain a sudden AccessDenied after an infrastructure rebuild. See the AWS AccessDenied Troubleshooting Guide.
- ANPA, AGPA, AIPA: useful as stable keys in a configuration database or identity inventory, because names change and are reused while IDs do not.
Unique IDs complement ARNs rather than replacing them. AWS's general advice is to use ARNs in policies, and to reach for unique IDs where name reuse would otherwise grant unintended access.
Using prefixes in detection and leak triage
Detection ideas
| Signal | Prefix logic | Why it matters |
|---|---|---|
| Long-term key use in production | userIdentity.accessKeyId starts with AKIA | Tracks progress away from static keys; any AKIA use from an unexpected network is a priority |
| Root key use | userIdentity.type = Root with an AKIA key ID | Root access keys should not exist in normal operation |
| Bearer token issuance | accessKeyId starts with ABIA | Shows which principals obtain service bearer tokens and from where |
| Session from a known role used off-platform | ASIA key with a principalId beginning AROA, source IP outside expected ranges | Possible stolen session credentials; GuardDuty's InstanceCredentialExfiltration.OutsideAWS finding covers EC2 role credentials |
| New long-term keys | CreateAccessKey events (response contains an AKIA ID) | Persistence technique, mapped to ATT&CK T1098.001 Additional Cloud Credentials |
Note that CloudTrail may omit accessKeyId or show it as an empty string for security reasons, so rules should fall back to userIdentity.type, principalId and sessionContext. Amazon GuardDuty adds findings such as CredentialAccess:IAMUser/CompromisedCredentials and UnauthorizedAccess:IAMUser/MaliciousIPCaller. See the Amazon GuardDuty Guide.
Leak triage by prefix
- Read the prefix. AKIA or ASIA tells you the playbook; an AIDA, AROA or ANPA value on its own is not a credential and needs no rotation.
- Confirm ownership. Call STS
GetAccessKeyInfofrom your own account to return the account ID that owns the key. If it is not yours, report it to the owner through the relevant channel and stop. The call does not indicate whether the key is active. - For AKIA, find the user. Pull a credentials report or search
list-access-keysoutput; checkget-access-key-last-usedfor the last service, Region and time. - For AKIA, contain. AWS's guidance is to create a replacement key, update applications, deactivate the exposed key (do not delete it yet, so you can reactivate if something breaks), then delete it once the new key works.
- For ASIA, find the session. Search CloudTrail STS events for the key ID to identify the role and who assumed it, then revoke active sessions. AWS adds an inline policy named
AWSRevokeOlderSessionsthat denies all actions for sessions issued before the revocation time usingaws:TokenIssueTime. This does not affect requests signed with long-term IAM user keys, and it cannot be used on service-linked roles. - Review activity. Look for new users, access keys, roles, policies and resources in every Region, and preserve evidence (for example snapshots) before deleting anything. See How to Investigate CloudTrail for a Compromised Access Key.
- Respect AWS's quarantine policy. If AWS has attached the
AWSCompromisedKeyQuarantineV3managed policy to an exposed user, do not remove it; follow the instructions in the support case AWS opened.
For the full response sequence across clouds, use the Cloud Access Key Leak Playbook.
Framework mapping
| Framework | Reference | How prefixes help |
|---|---|---|
| MITRE ATT&CK | T1552.001 Credentials In Files | Scanners flag AKIA and ASIA strings in files and repositories |
| MITRE ATT&CK | T1078.004 Cloud Accounts | Prefix and principalId separate user, role and root activity in hunts |
| MITRE ATT&CK | T1098.001 Additional Cloud Credentials | Alert on new AKIA keys created outside approved pipelines |
| NIST SP 800-53 Rev 5 | IA-5 Authenticator Management, AC-2 Account Management | Inventory long-term keys and owners by unique ID |
| NIST SP 800-53 Rev 5 | AU-6 Audit Record Review, Analysis, and Reporting | Prefix-aware CloudTrail rules |
| NIST CSF 2.0 | PR.AA-01, DE.CM-03 | Credentials managed for users and services; activity monitored |
Practitioner checklist
- Add the twelve documented prefixes to your SOC runbook and secret scanning triage notes, with AKIA and ASIA playbooks linked.
- Build a CloudTrail report of AKIA key use by principal and track it down month on month.
- Alert on any Root identity using an access key, and on
CreateAccessKeyoutside approved automation. - Store AIDA and AROA unique IDs alongside names in your identity inventory so deleted and recreated principals are distinguishable.
- Use unique IDs in resource policies or
aws:useridconditions where name reuse would grant unintended access. - Restrict
sts:GetServiceBearerTokento principals that need ABIA bearer tokens. - Rehearse revoking role sessions with
AWSRevokeOlderSessionson a non-production role so the team knows the side effects. - Do not treat identifier-only prefixes as secrets in alerting, to keep scanner noise down.
Standards and references
- AWS: IAM identifiers (unique ID prefixes)
- AWS: GetAccessKeyInfo API reference
- AWS: CloudTrail userIdentity element
- AWS: Service bearer tokens
- AWS: Manage access keys for IAM users
- AWS: Revoke IAM role temporary security credentials
- AWS: GuardDuty IAM finding types
- MITRE ATT&CK: T1552.001 Credentials In Files
Related NHI Mgmt Group resources: AWS IAM Policies and Roles Guide · AWS Access Keys Security Guide · How to Investigate CloudTrail for a Compromised Access Key · Cloud Access Key Leak Playbook