AWS Builder Center
The Model Is Not the Agent: Design Lessons from Building a Refund Agent with Strands and Bedrock

The Model Is Not the Agent: Design Lessons from Building a Refund Agent with Strands and Bedrock

What makes an AI agent reliable? Drawing on a refund agent presented at AWS Student Community Day IUC, this article explores how tool design, bounded loops, human approval, and observability shape agent behavior. Built around Strands and Amazon Bedrock, it argues that the most consequential engineering decisions lie in the harness: the tools, permissions, and controls surrounding the model.

Chief Operating Officer at Hinkaku | Student at IUSJC


The lesson that cost me $300

I had built an agent to search for opportunities matching my CV. The task seemed straightforward: search once a day, examine a limited set of opportunities, and send me the results.
Instead, it kept searching. It scanned the web minute after minute and continued returning results. The loop was badly conditioned and had no effective stopping condition. By the time budget alerts drew my attention to it, I had accumulated $300 in cloud spending.
I took the agent down to investigate. Then I added limits and stopping conditions so that a search would finish after examining a bounded set of opportunities.
That incident is the clearest reason I care about the harness around an agent. A useful task and a functioning model were not enough. I had failed to define when the work was done.

Why I taught this through a refund request

For my talk at AWS Student Community Day IUC on October 31, 2026, I used a different example: “Hello, I want a refund for order 4521.”
I chose it because a refund has a recognizable outcome and a consequential action. The system needs to identify the customer, retrieve the order, check the policy, and initiate the refund. A fluent answer does not prove that any of those things happened.
The presentation followed one request through the model, the tools, the loop, and the surrounding controls. Strands organized the agent loop, with Amazon Bedrock providing access to the model.
I wanted students to look beyond the chat interface. Once a system can call functions, the developer has to decide which actions are available, under what conditions, and with what evidence of success.

Four tools, four explicit responsibilities

The refund example used lookup_customer, retrieve_order, check_eligibility, and process_refund.
I separated these responsibilities to make the transition from reading information to taking action visible. Retrieving an order and refunding it involve different permissions and consequences. Keeping them separate also makes it easier to inspect where an execution went wrong.
In Strands, the Python @tool decorator uses docstrings and type hints to build the tool specification. That makes descriptions part of the interface the model uses to choose an action.
For this example, each tool needs a clear purpose and an explicit result. An eligibility response should state whether the order qualifies and why. A refund response should distinguish submission, pending approval, and failure.
The execution service must still enforce the relevant rules. Splitting functions improves clarity; it does not automatically enforce their order or make the final action safe.

A daily schedule does not bound a run

My opportunity-search incident exposed a distinction I had not enforced properly: how often a task starts and how long its execution continues.
I wanted a daily search. What I got was continuous scanning. Returning opportunities did not terminate the work, so the system kept doing something that looked useful while spending more money.
The correction was to bound the search and give it a finishing condition. Finding a limited set of opportunities and returning them needed to end that execution.
For future builds, I also want execution limits to be visible and testable: elapsed time, tool calls, and retries. Observability should show whether another turn advances the task or repeats it.
In the refund example, retries raise an additional requirement: idempotency. If a request is repeated after a timeout, the service must prevent a second refund for the same operation. Stopping and retrying both need deliberate design.

The model cannot approve its own authority

The refund policy in my presentation included a simple threshold: above 50,000 FCFA, a human must approve the refund.
That rule belongs in the prompt as guidance, but it also needs enforcement at the point of execution. The service should verify the amount and the approval associated with the transaction before releasing money.
Hooks are particularly useful here. Strands exposes lifecycle events that let developers inspect and influence execution around model and tool calls. A hook can check prerequisites or stop an attempted tool call. The underlying refund service should independently protect the transaction.
Steering, guardrails, and human approval have different roles. Redirecting the agent, filtering sensitive content, and authorizing a payment solve different problems. For this example, the crucial question is whether an unapproved refund can actually execute, regardless of what the model says.

What I want students to take into their first build

I opened the talk by asking what separates a chatbot from an agent. I ended by asking students to build for a local problem: parcel tracking, appointment booking, or student orientation.
My own experience adds a practical question to that challenge: when does the agent stop?
The $300 incident changed how I judge progress. An agent returning useful results can still be running incorrectly. I now need to examine the execution alongside the output: what it called, what it changed, and whether it finished within the intended boundaries.
That is the lesson connecting my opportunity-search agent to the refund example. Model choice matters, but the harness determines the conditions under which the system can keep working and take consequential actions.
I want to be able to explain those conditions before I leave another agent running.
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