- A harness is everything around an AI model that lets it do a job safely: the numbers it reads, what it may touch, its limits, what starts it and who checks the result.
- Never hand an agent a ROAS target on its own: a campaign can beat the target and still lose money once product cost, shipping and fees come off.
- Write three guardrails before an agent acts: a profit floor per product or campaign, caps with a point where it must stop and ask, and a written definition of done.
- Start read-only, then let the agent propose changes, and only later let it apply small ones by itself, with a log and an undo for every change.
- The model is the part you can swap; the harness is where your costs, rules and decisions live, and it gets better each time you correct it.
An AI agent harness is the set of rules, limits, data and checks an agent works inside: which numbers it reads, what it may change, how far it may go, what starts it and who reviews the result. For an online store, the guardrails that matter most are a profit floor the agent may not go below, caps on how much it may change before it has to ask a person, and a written definition of what "done" means for each job.
Ad platforms and Shopify now let AI agents act, not only report. This guide explains what a harness is, why a ROAS rule is the wrong limit for an agent, the three guardrails to write first, how the same idea applies to stock, support and reporting, and a checklist for the first day.
What is a harness?
The word comes from software. When an AI agent writes code, engineers surround it with a test harness: a setup that runs the agent's work, checks it against written acceptance tests and shows what changed. Shopify's CEO, Tobi Lütke, was widely reported in October 2026 as describing his engineers as verification engineers for that reason: when an agent writes the code, the person's job becomes deciding what correct looks like and building the checks that prove it.
The same shift applies to running a store. When an agent can raise a budget, send a discount code or draft a purchase order, your job moves from doing those tasks to writing the rules the agent has to follow and checking that it followed them. The harness is those rules plus the data and the review steps around them.
Model versus harness
- Reads, reasons and writes
- Claude, ChatGPT, Gemini or a platform's own AI
- Gets replaced by a better one every few months
- Knows nothing about your costs unless you give them
- The numbers and facts the agent reads
- The tools it may use, read-only or with write access
- Limits, triggers and approval steps
- A log of what it did, and a way to undo it
AI agents in ecommerce can now act, not just report
Until recently most AI in ecommerce read data and summarised it. In 2026 the platforms opened write access to agents. Meta's ads MCP server lets an AI application connected to an ad account create and change campaigns, and in July 2026 Meta added ads MCP server rules, so the person with full control of a business portfolio can govern what agents may do in an ad account, from budget changes to catalog updates. Shopify's Campaign Autopilot runs marketing tactics within guardrails the merchant sets, such as a target return on ad spend, target regions and languages, and a separate permission decides whether it needs approval before it creates campaigns. Shopify's admin assistant, Sidekick, presents its changes for review before applying them.
All three put the same responsibility on the merchant: the agent enforces the limits it is given, on the numbers it can see. Nobody else writes those limits for your store.
Why a ROAS rule gets this wrong
ROAS is the number every ad platform reports, so it is the number most automated rules are written on. ROAS says nothing about what an order costs you to deliver. An agent told to scale anything above a ROAS target will scale campaigns that lose money, and it will do so consistently and quickly.
| Example store, one product | Per order |
|---|---|
| Selling price (without VAT) | $80 |
| Product cost | $28 |
| Shipping, fulfilment and payment fees | $20 |
| Gross profit before ad spend | $32 (40%) |
| Break-even ROAS | 1 ÷ 0.40 = 2.5 |
Now give an agent the rule "scale any campaign with a ROAS above 2.0". A campaign at a ROAS of 2.3 passes the rule.
- Revenue
- Ad spend × ROAS: $100 × 2.3 = $230
- Gross profit
- $230 × 40% = $92
$92 − $100 = −$8 for every $100 of ad spend, a POAS of 0.92. The rule says scale; the profit says cut or fix.
The error gets worse when the agent's costs are out of date. If a supplier raised prices last quarter and nobody updated product costs, the agent checks a margin that no longer exists. Refunds, discounts and carrier surcharges move the margin too. A rule written on profit, with costs that are current and dated, avoids both problems. See ROAS vs POAS and MER vs ROAS for the difference between the ratios.
AI agent guardrails: the three parts of a harness
1. A profit floor for every product and campaign
Give the agent a floor written in profit, not a ROAS target. Use one definition of margin everywhere, such as contribution margin, and let the agent derive the ROAS it needs from your real costs.
- Set the floor per product or campaign, not per account. A full-price best seller and a discounted bundle have different break-even points.
- Write the action next to the floor: "do not raise the budget of a campaign whose POAS over the last 7 days is below 1.0" and "propose a cut when it stays below 1.0 for 3 days".
- Keep the costs behind the floor current, and record when each one was last updated.
2. Caps, with a point where the agent stops and asks
Agents repeat actions well, which is a problem when the action is wrong. Limit what one run can do:
- The largest change to a budget or bid in one day, as a percentage.
- The largest total budget increase across the store in one day.
- Hard minimums and maximums for a daily budget, and a maximum bid.
- A waiting time before the same campaign may change again, so the platform's learning settles.
- Campaigns the agent must not touch, such as a launch or a Black Friday campaign you planned by hand.
- A threshold above which every change goes to a person first.
Pick numbers you could live with being wrong for one day. Loosen them after you have watched the agent for a few weeks.
3. A written definition of done for each job
This is the acceptance test. If you cannot say what finished looks like, neither you nor the agent can check it.
- Pausing a campaign: it is paused in the ad platform, the reason and the profit figures at that moment are logged, and someone reviews the result the next morning.
- Reordering stock: a draft purchase order exists and a person sends it. Keep payments and suppliers behind a human until the process has earned trust.
- A weekly report: order counts match your store, every product has a cost on file, and where one is missing the report says so instead of guessing.
Four AI problems that are really harness problems
Teams that have used AI for a year often see the same problems, and a better model fixes none of them:
- Everyone prompts differently. The useful instructions live in one person's chat history, so the rest of the team cannot reuse them.
- The same question gets three answers. Three people ask for last week's profit and get three numbers, because each AI saw different data and a different definition.
- Half-built automations. Someone wires up a workflow, it breaks when a field changes, and nobody else knows how it works.
- The wrong model for the job. The most expensive model tags support tickets because it was the default, while a smaller one would do.
Shared, written context fixes the first two. Triggers and checks that belong to the business rather than to one person fix the third. Choosing a model per task fixes the fourth.
The parts of an agent harness
| Part | What it holds in a store |
|---|---|
| Context | Products, margins per product with the date of each cost, policies, past decisions and the facts an agent may state |
| Tools and permissions | Which systems it can read and which it can change: store, ad accounts, email, help desk |
| Limits | Profit floors, caps, protected campaigns and the approval threshold |
| Triggers | What starts a job: a schedule, a new order, a metric crossing a line |
| Review and log | Who approves, a record of each change with the values before and after, and a way to undo it |
| Model choice | A small model for routine work, a stronger one for analysis and writing |
Shared context is the part that compounds
A chat window remembers one conversation. A harness keeps context for the whole business: how the store works, one definition of each metric, current costs, the reasons behind past decisions, the facts an agent may say about the brand and examples of the tone you write in. When a job finishes, what was learned is written back, and a person approves changes to anything important. That loop is why a harness improves with use, and it is the part a competitor cannot copy by buying the same model.
The same harness applies to every part of the brand
Ads show damage fastest, but the pattern holds anywhere an agent acts. Each tool reports the number that flatters it, and an agent given that number will chase it.
| Job | What starts it | The number to guard | Who checks |
|---|---|---|---|
| Ad budget changes | Each morning, after yesterday's data is in | POAS or profit after ads per campaign, not ROAS | A person, above the cap |
| Purchase order draft | Stock cover below a set number of days | Margin per product and supplier lead time | The buyer, who sends it |
| Refund and reply drafts | A new support ticket | The refund amount and the written returns policy | A person, above a set amount |
| Discount offers | A cart left, or a customer lapsing | Margin left after the discount, per order | A person approves the discount rules |
| Weekly numbers report | Monday morning | Profit after every cost, with missing costs flagged | The finance lead, before it is sent |
For which jobs to automate first, see ecommerce automation. For the busiest weeks of the year, write the floors and caps into your Black Friday profit plan before any agent touches a budget.
A day-one checklist
- Fill in costs
Product costs, shipping, payment fees and handling, each with a date. An agent cannot respect a profit floor it cannot calculate.
- Write one floor
One profit rule per campaign type, with the action next to it: propose a cut, or never raise.
- Set the caps
Largest change per day, largest total increase, budget limits, a waiting time between changes and the campaigns to leave alone.
- Start in propose mode
Let the agent suggest changes that a person approves. Allow it to apply changes alone only for rules you have watched for weeks.
- Check the log daily
Read what changed, why and with what result. Undo what went wrong and tighten the rule that allowed it.
How to start building one
You do not need to buy anything to begin. Pick one job the team does every week and work through it:
- Describe the job as you would to a new colleague, including what a finished version looks like.
- List what the agent needs to know and put it in one shared place.
- Connect tools one at a time and start with read-only access. Shopify and MCP explains how AI apps connect to store data.
- Write what it must never do and what it must ask about first.
- Use the smallest model that does the job well, and move up only when the results fall short.
- Have a person review the output until you would trust it without looking.
How ROASaurus puts a harness around ad changes
ROASaurus calculates profit per campaign after product cost, shipping, payment fees and ad spend, and its Actions section uses those numbers to change ads on ten platforms. Every proposed change goes through one approval inbox, whether it comes from a rule, from Autopilot, from Ask AI, from an AI app connected through the ROASaurus MCP server or from a team member.

| Guardrail | Where it lives in ROASaurus |
|---|---|
| Profit floor | Actions › Rules: "if POAS (or CAC, ROAS, CPA, spend) over N days is below or above a threshold, then pause or change the budget or bid" |
| Stop and ask | Each rule either proposes to the inbox or applies on its own; applying on its own is opt-in per rule. Autopilot only proposes. |
| Caps | Largest change per budget or bid per day (20% by default), largest total increase per day, budget and bid limits, a waiting time between changes and business hours |
| Permission | Owners and admins allow changes per ad account; a kill switch stops all changes |
| Log and undo | Actions › History: every change with its values before and after, and a rollback |
The MCP server is not read-only: it has read tools, an optional scope that lets a connected AI app propose changes to the inbox, and an optional scope that lets it apply them. Granting only the propose scope gives an outside agent the same stop-and-ask point as Autopilot.
Sources
- Meta for Business: Introducing Meta Ads AI Connectors
- Shopify Help Center: Setting up Autopilot
- Shopify Help Center: Sidekick