Inspiration
AI agents are increasingly able to use tools, APIs, and payment services on a user’s behalf. That creates a practical question: before an agent takes an action involving money, how can an application check that the action is within the agent’s authority and matches what the user actually asked for?
I built AgentGuard to explore that question. The goal was to put a policy and safety layer between an AI agent and a payout action, and to make the result understandable to the person using the app.
What it does
AgentGuard is a dashboard and API for checking payout requests. A request passes through three checks:
- Authority: Is the agent’s role allowed to request a payout of this amount?
- Legitimacy: Does the proposed payout match the user’s message, or does the request appear contradictory or suspicious?
- Safety: Does the request pass the application’s transaction and activity limits?
Requests that fail a check are blocked. Eligible requests below $25 that pass all three checks are recorded as PAYMENT DONE in the local Mock Sandbox. This is a simulated result for the demo; no money is sent.
The dashboard includes an agent chat, a payout form, protected and naked demo modes, and a security log. The log records the decision and its reason so a user can see what happened.
How I built it
The user interface is built with React. It sends chat and payout requests to a FastAPI backend, which applies the policy checks and records transaction decisions in SQLite.
For the legitimacy check, the backend calls NVIDIA NIM with a prompt that asks the model to compare the user’s request with the proposed payout. The model’s response is one input to the decision; role limits and safety checks are applied by the backend.
The project also includes a PayPal Sandbox API integration. During development, the PayPal endpoint rejected payouts because of the sender account’s country eligibility. To keep the demo usable without pretending that a real provider accepted the transaction, I added a local Mock Sandbox path for eligible requests below $25. It produces a clear completion status and a reference ID without calling PayPal.
Challenges I ran into
One challenge was keeping the chat, backend, model, policy checks, and payment-provider integration connected and understandable. A failure in any one of those layers can look like a generic chat error unless the application preserves useful details.
Another challenge came from PayPal Sandbox eligibility. Passing AgentGuard’s checks does not guarantee that PayPal will accept a payout: the provider can reject it based on account eligibility or other restrictions. I had to separate “AgentGuard approved the request” from “PayPal accepted the payout” and provide a local simulation for the demo.
I also worked on making the dashboard readable over its animated background and ensuring that blocked or simulated outcomes are explained in plain language.
Accomplishments that I’m proud of
I’m proud that the project demonstrates a complete request flow: a user can describe a payout, the agent can interpret the request, the backend can check it, and the dashboard can display and log the outcome.
I’m also proud that the interface distinguishes a locally simulated payment from a provider-accepted payout. A “PAYMENT DONE” result in Mock Sandbox means the demo completed its simulation; it does not claim that real funds were transferred.
What I learned
I learned how to connect a React frontend to a FastAPI backend, structure API requests, call an AI model through NVIDIA NIM, and store decisions in SQLite. I also learned that an AI model should be one part of a decision process: application-level rules still need to enforce role limits and safety conditions.
The payment-provider issue reinforced an important lesson: a successful policy check and a successful payment are different outcomes. A payment system needs to report those statuses separately and clearly.
What’s next for AgentGuard
Next, I’d like to make the policies configurable, improve the transaction history and provider error display, and add more scenarios for testing how the agent handles conflicting or suspicious instructions.
I’d also like to make the boundary between mock transactions and provider transactions even clearer throughout the dashboard, so users can tell at a glance whether a result was simulated or accepted by a payment provider.