
AgentPay Sentinel: Building a Trust Gateway for AI-Initiated Actions with AWS
AI agents can understand natural-language instructions, but understanding an instruction is not the same as being authorized to execute it. This article explains how AgentPay Sentinel uses deterministic policies, human approval, transaction binding, and AWS services to create a trust boundary between AI intent and consequential actions.
# AgentPay Sentinel: Building a Trust Gateway for AI-Initiated Actions with AWS
AI agents are becoming capable of doing more than generating text. They can initiate workflows, interact with APIs, modify data, and potentially trigger consequential actions such as payments.
That creates a fundamental security question:
**If an AI agent understands what a user asked for, does that mean it should be authorized to execute it?**
Not necessarily.
This is the problem I explored while building **AgentPay Sentinel**, an evidence-aware trust gateway for AI-initiated consequential actions, demonstrated through AI-agent payments.
The core principle behind the project is:
> **LLM Understands. Policies Decide.**
---
## The Problem
Traditional applications usually have a clear boundary between a user and an action.
An agentic system introduces another layer.
A user may tell an AI agent:
> "Pay the hardware supplier ₹50,000."
The agent can interpret that instruction and generate a payment request. But the generated request should not automatically become an authorized transaction.
There are several questions that need to be answered before execution:
- What exactly did the user authorize?
- Does the proposed action match that authorization?
- Is the amount within the permitted limits?
- Is the intended recipient correct?
- Is additional human approval required?
- Can an already-approved authorization be modified or replayed?
- Can the final decision be audited?
AgentPay Sentinel was designed around these questions.
---
## The Core Idea
AgentPay Sentinel acts as an authorization boundary between AI intent and execution.
The architecture deliberately separates two responsibilities:
**AI understands.**
The AI layer can extract intent and supporting evidence from natural-language requests and submitted documents.
**Policies decide.**
A deterministic policy engine independently evaluates the extracted information and produces one of three outcomes:
- `ALLOW`
- `DENY`
- `REQUIRE_HUMAN_APPROVAL`
This separation is important because the security-critical authorization decision does not depend on an LLM deciding whether an action is safe.
The model helps the system understand the request.
The deterministic policy engine makes the authorization decision.
---
## How the Authorization Flow Works
The complete flow is:
```text AI Agent │ ▼ Request + Evidence │ ▼ Intent / Evidence Extraction │ ▼ Signal Computation │ ▼ Deterministic Policy Engine │ ├── ALLOW ├── DENY └── REQUIRE_HUMAN_APPROVAL │ ▼ Human Decision │ ▼ Transaction Binding │ ▼ Sandbox Execution │ ▼ Tamper-Evident Audit
The important property is that authorization is evaluated independently from the language model.
Deterministic Policy Instead of LLM Authorization
One of the main design decisions in AgentPay Sentinel was keeping the policy engine deterministic.
For example, a policy can evaluate conditions such as:
authorized amount
proposed amount
intended payee
evidence consistency
spending limits
risk signals
approval requirements
transaction state
The result is a deterministic authorization decision.
This means the system does not ask an LLM:
"Should I allow this payment?"
Instead, the LLM helps answer:
"What does this request contain?"
The policy engine then answers:
"Given these facts and these rules, what authorization state applies?"
That distinction is central to the security model.
Human Approval for Consequential Actions
Some actions should not be automatically executed even when they pass the basic policy checks.
AgentPay Sentinel therefore supports a human approval state.
For example, a large payment can produce:
REQUIRE_HUMAN_APPROVAL
The transaction remains pending until an authorized human explicitly approves or denies it.
If approved, the system continues toward sandbox execution.
If denied, execution does not occur.
This creates an explicit authorization checkpoint between the AI agent's proposal and the consequential action.
Transaction-Bound Authorization
A major security requirement is preventing an approval from becoming a reusable blanket permission.
Consider this sequence:
Original:
₹50,000 → ABC Hardware
A human approves the transaction.
An attacker or faulty agent should not be able to modify it into:
₹75,000 → ABC Hardware
or:
₹50,000 → XYZ Traders
and reuse the original approval.
AgentPay Sentinel therefore binds approval to the exact transaction context.
The authorization flow validates the transaction identity, ownership, expiry, and cryptographic binding before execution.
This makes the approval specific to the action that was actually authorized.
Replay Protection
The same authorization should not be executable repeatedly.
After a successful sandbox execution, the transaction state changes and the execution path is guarded against replay.
The backend also performs an atomic state transition before execution.
Conceptually:
PENDING
↓
APPROVED
↓
EXECUTED
An already-executed authorization cannot simply be submitted again as if it were still approved for execution.
Tamper-Evident Auditing
Security decisions are useful only if they can also be investigated later.
AgentPay Sentinel records important authorization and execution events in an audit trail.
The audit mechanism uses cryptographic hashing to make modifications detectable.
The goal is to provide a trace of:
Request
↓
Decision
↓
Approval / Denial
↓
Execution
This gives the system accountability in addition to authorization.
Building It on AWS
The production architecture uses AWS managed services for the major infrastructure components.
The frontend is hosted using AWS Amplify.
Requests enter through Amazon API Gateway and are processed by an AWS Lambda backend running the FastAPI application.
Amazon DynamoDB stores transaction state, sessions, pending approvals, and audit records.
Amazon S3 stores submitted evidence and associated metadata.
Amazon Bedrock is integrated through the Converse API for AI-based intent and evidence extraction.
Amazon CloudWatch provides application logging and observability.
The infrastructure is defined and deployed using AWS SAM, including the serverless resources and IAM permissions.
The architecture can be summarized as:
React Frontend
│
▼
AWS Amplify
│
▼
API Gateway
│
▼
AWS Lambda + FastAPI
│
├──────────────► Amazon Bedrock
│ │
│ ▼
│ Intent / Evidence
│
├──────────────► DynamoDB
│ │
│ ├─ Transaction State
│ ├─ Sessions
│ └─ Audit Records
│
├──────────────► Amazon S3
│ │
│ └─ Evidence
│
└──────────────► CloudWatch
│
└─ Logs / Observability
Keeping the Security Boundary Independent
An important architectural choice was using adapters around infrastructure services.
The core authorization pipeline does not need to know whether it is communicating with local development storage or AWS infrastructure.
In AWS mode, the application uses services such as:
DynamoDB
S3
Bedrock
CloudWatch
For development and demonstration, local adapters can be used without changing the core authorization logic.
This allowed me to test the security-critical workflow independently while still deploying the production architecture on AWS.
What the Demo Shows
The demonstration focuses on the authorization boundary rather than simply showing a payment form.
Normal authorized request
A matching request can pass through the policy engine and be allowed.
Consequential action
A large transaction can trigger:
REQUIRE_HUMAN_APPROVAL
The human explicitly approves the exact transaction before sandbox execution.
Amount mismatch
If the proposed amount no longer matches the authorized context, the transaction is denied.
Payee mismatch
Changing the intended recipient also causes the authorization check to fail.
Audit trail
The resulting decisions and execution events are recorded for later inspection.
All payment execution in AgentPay Sentinel is sandbox simulation only. The system does not connect to a real payment network.
Testing the Security Model
The project was developed with automated tests covering the authorization workflow and AWS adapters.
The security-critical scenarios include:
authorization decisions
human approval
denial flows
transaction binding
replay protection
execution state transitions
DynamoDB persistence
S3 evidence storage
audit behavior
The goal was not simply to make the happy path work, but to verify that changing the authorized transaction context causes the authorization boundary to reject the action.
What I Learned
Building AgentPay Sentinel changed the way I think about AI application security.
The biggest lesson was that adding an LLM to an application does not automatically create a secure agent.
The model can be very useful for understanding unstructured input, but security-critical decisions should have explicit boundaries.
I learned to separate:
Understanding → Authorization → Execution → Audit
rather than treating them as one AI-driven operation.
I also learned a lot about building a production-oriented serverless application with AWS, including Lambda, API Gateway, DynamoDB, S3, Bedrock, CloudWatch, IAM, and AWS SAM.
Another important lesson was that security properties need to be demonstrated through failure cases, not only successful workflows.
A system that shows an approved payment is useful.
A system that can also demonstrate:
Modified transaction → DENY
Replay attempt → DENY
Unauthorized action → DENY
makes the authorization boundary much more tangible.
Conclusion
AI agents will increasingly interact with systems where actions have real consequences.
The challenge is not only making agents capable of understanding instructions.
The challenge is creating a trustworthy boundary between what an agent proposes and what the system actually permits.
AgentPay Sentinel explores that boundary through deterministic authorization, human approval, transaction-bound permissions, replay protection, and tamper-evident auditing.
The core principle remains simple:
LLM Understands. Policies Decide.
AI agents can propose actions quickly.
Authorization should remain explicit, deterministic, and auditable.
Project
GitHub:
https://github.com/meet2124/agentpay-sentinel
Live application:
https://main.d2qhw74txgs7ha.amplifyapp.com
Demo video:
https://youtu.be/wUgBBf49GW4
Built for AWS First Commit 2026.
#amazon-bedrock#aws-lambda#amazon-dynamodb#aws-serverless-application-repository#artificial-intelligence
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