Identity is the control plane for an AI agent that can touch money. Before the agent can investigate a failed payment, prepare a refund or invoke a payment API, the surrounding application must decide which workload is acting, which customer and transaction it may act for, and which operation is permitted now.
Teams often compress these decisions into one question: which IAM role should the agent use? That question matters, but it is incomplete. AWS IAM controls access to AWS resources. It does not decide whether a ÂŁ2,000 refund is commercially valid, whether the requester owns the transaction or whether a second approver is required.
A defensible architecture therefore treats agent identity as a chain of controls. Each link should remain effective even when the model misunderstands the task, follows malicious content or proposes an operation outside policy.
The four identities inside one agent action
A single agent request can involve four different identities. Combining them into one undifferentiated “agent user” makes both authorisation and investigation harder.
- Human identity: the employee, customer or operator who initiated or approved the request.
- Workload identity: the Lambda function, container, Bedrock agent or orchestration service running the workflow.
- Agent identity: the named business actor, version and purpose represented by the workflow.
- Transaction identity: the customer, merchant, payment, amount and operation the request concerns.
IAM can authenticate and authorise the workload. Application controls must bind that workload to the initiating principal and the exact transaction. The audit trail must preserve all four so an investigator can answer who requested, who executed, what was authorised and what changed.
Core principle: Never let the model convert possession of a credential into permission to move money.
1. Give the runtime temporary credentials
AWS recommends that workloads use IAM roles and temporary credentials rather than long-term access keys. For a payment agent running on Lambda, ECS, EKS or another AWS compute service, attach a role to the runtime and let AWS issue rotating credentials. For workloads outside AWS, use an appropriate federation pattern or IAM Roles Anywhere instead of embedding access keys in prompts, source code or configuration files.
Keep the trust policy as deliberate as the permissions policy. Restrict which service or principal can assume the role. Where an AWS service assumes a role on behalf of a resource, apply supported source conditions such as aws:SourceArn andaws:SourceAccount to reduce confused-deputy risk.
Temporary credentials reduce the lifetime of a stolen credential. They do not make a broad role safe. The permissions issued during the session still need to be narrow.
2. Separate reasoning from execution
The model should not hold a general-purpose payment role. Let the reasoning layer produce a structured proposal, then send that proposal to a deterministic execution service. That service validates the request and assumes or uses only the permissions required for the approved operation.
This design creates an enforceable boundary between “recommend refund” and “execute refund.” A read-only investigation tool can retrieve a constrained transaction view. A refund tool can invoke one controlled endpoint. A payout-destination change should use a different workflow, role and approval policy.
With Amazon Bedrock Agents, action groups define the actions available to an agent and a service role supplies the AWS permissions needed by the agent. Treat those as separate reviews: a narrow action schema is not a substitute for a narrow IAM policy, and a narrow IAM policy is not a substitute for business validation inside the action implementation.
3. Design permissions around business capabilities
Start with the smallest business capability, not the list of services the agent might eventually use. “Investigate settlement exception” is a better boundary than “access DynamoDB, S3 and Lambda.” Map each capability to explicit actions, resources and conditions.
- Use separate roles for investigation, recommendation and execution.
- Scope resources to the tables, queues, functions, keys and secrets required.
- Use resource tags and policy conditions where the service supports them.
- Apply permissions boundaries and organisation guardrails to cap maximum privilege.
- Block administrative, identity-management and logging changes from payment-agent roles.
AWS managed policies are designed for broad reuse and may be wider than a production payment workflow needs. IAM Access Analyzer can generate policy suggestions from access activity recorded in CloudTrail. Review, test and refine the result; observed activity is evidence for policy design, not automatic proof that every observed permission is safe.
4. Enforce transaction authority outside IAM
IAM answers whether a role may call a resource. The payment service must answer whether this operation is permitted for this transaction. Enforce customer and merchant ownership, payment state, remaining refundable amount, currency, velocity, cumulative limits, separation of duties and approval thresholds in trusted code.
The model may select from a constrained set of intents, but it should not be the policy engine. Convert its proposal into a typed request and validate every material field. Retrieve authoritative values from systems of record rather than trusting amounts, account identifiers or approval claims copied from the conversation.
Bind the decision to an operation identifier. If the amount, destination or transaction changes after approval, invalidate the decision and evaluate the new request again.
5. Make human approval cryptographically and operationally meaningful
Human review is only useful when the reviewer sees the exact action and has the authority to approve it. Present the original payment, proposed operation, amount, currency, destination, reason, risk signals and policy result. Record the approver identity, timestamp, expiry and a digest or immutable reference to the approved payload.
The execution service—not the agent—must verify the approval. A message saying “approved” is untrusted text. For high-risk operations, require a second principal or a separate privileged workflow, and prevent the initiating workload from approving its own request.
6. Keep secrets out of the agent context
A payment agent should call a tool that uses a credential, not retrieve the credential itself. Store provider secrets in AWS Secrets Manager or an equivalent controlled store. Permit the execution component to retrieve only the named secret it requires, and avoid returning secret values through tool responses, traces or model context.
Use distinct credentials for environments and capabilities. Rotation should not depend on changing a prompt or rebuilding a model. Monitor secret access separately from payment operations so unusual retrieval remains visible even if no transaction completes.
7. Preserve attribution through the workflow
CloudTrail records AWS API activity and includes identity information for assumed-role sessions. Preserve a stable source identity or session naming convention where supported, then correlate it with your business operation ID, agent version, tool call, policy decision, approval reference and provider response.
Do not rely on the model's narrative as evidence. The control record should show which principal initiated the work, which runtime role acted, which deterministic checks ran and which exact state transition occurred. Protect those logs against alteration and separate the agent's ability to execute payments from any ability to modify audit evidence.
8. Treat every agent identity as a governed system account
PCI DSS v4.0.1 includes controls for application and system accounts in Requirement 8.6, alongside broader requirements to restrict access by business need and maintain accountability. An agent runtime that can access a cardholder data environment should be inventoried and governed as a non-human identity, not treated as an informal extension of a developer account.
Document its owner, purpose, authentication method, permissions, allowed interactive use, credential lifecycle, review frequency and disablement process. Confirm the exact PCI DSS scope and evidence expectations with your QSA; an IAM design or generated policy does not establish compliance by itself.
A reference control flow for payment agents
- The user authenticates and submits a request through a trusted application.
- The application records the initiating principal, tenant and operation ID.
- The agent receives only the minimum context required to classify or propose an action.
- A tool gateway validates the schema and maps the proposal to an allowed capability.
- A policy service evaluates transaction ownership, state, limits and approval requirements.
- A human approves the exact payload when the risk policy requires it.
- A narrow execution component performs the operation with temporary AWS credentials.
- The system records the request, decision, identity chain and resulting payment state.
The model participates in steps three and four. It does not replace authentication, authorisation, approval or settlement controls.
IAM anti-patterns that fail under payment scrutiny
- One shared role for every agent: destroys isolation and makes attribution ambiguous.
- Administrative access during prototyping: tends to survive into production and expands blast radius.
- Letting the model choose arbitrary ARNs or API paths: turns free-form output into resource selection.
- Using the developer's identity at runtime: mixes human and workload accountability.
- Approval stored only in chat history: cannot reliably bind the approver to the executed payload.
- Long-lived provider keys in prompts or environment files: increases exposure and complicates rotation.
- Allowing the execution role to change its own policy or logs: weakens both containment and evidence.
Release checklist
- Does every agent workload have a named owner and defined business purpose?
- Are temporary credentials used without embedded AWS access keys?
- Are read, recommend, approve and execute capabilities separated?
- Can the role access only the required actions and resources?
- Are transaction ownership, state and limits checked outside the model?
- Is approval bound to the exact payload and independently verified?
- Can operators disable the agent without disabling the wider payment platform?
- Can one operation be reconstructed across application logs, CloudTrail and provider records?
- Are permissions reviewed when tools, prompts, models or workflows change?
Move from a policy document to an enforceable boundary
Agent identity design is not a one-time IAM exercise. It is the connection between workload credentials, tool boundaries, transaction policy, approval and evidence. Start with a narrow identity for one production use case, test it against manipulated inputs and denied operations, then expand only when the evidence supports the change.
Use the Agent Identity Designer to document the workload, permitted resources and prohibited actions and to generate editable IAM and Terraform output. For teams that need the identity boundary reviewed alongside payment flows, PCI DSS evidence and wider AWS architecture, Sync Your Cloud membership provides the structured assessments and architecture support to take it from draft policy to governed implementation.
Sources and further reading
- AWS IAM security best practices
- AWS: Temporary security credentials in IAM
- AWS: Create a service role for Amazon Bedrock Agents
- AWS IAM Access Analyzer policy generation
- AWS: The confused deputy problem
- AWS CloudTrail userIdentity element
- OWASP LLM01:2025 Prompt Injection
- OWASP Top 10 for Agentic Applications 2026
- PCI SSC Document Library: PCI DSS v4.0.1
Payment Architecture & Evidence Workspace
Turn this guidance into a structured decision
Open the relevant workspace tool to apply the article to your payment environment. Eligible membership access may be required; the tool page shows access before you begin.