New orders and stock changes arrive as webhooks. Code adds the tags anyone would add. The agent reads customer notes and low-stock signals and decides what the team needs. A policy in code decides what runs on its own (tags, team alerts) and what waits for a person (holding an order, emailing a customer, reordering stock).
The real engine, policy checks and approval queue from the repo, running on the sample store in your browser. The model is replaced by keyword rules (demo mode), so you can see exactly what the policy lets through. Send events one by one, then approve or reject what lands in the queue.
| Tier | Actions | Why |
|---|---|---|
| Runs automatically | add_order_tags (allow-list of 11 tags, ≤ 4 per order), post_team_alert (≤ 20 per hour) | Reversible, internal |
| Needs a person | hold_fulfillment, draft_customer_email, draft_reorder | Delays a customer, talks to a customer, or spends money |
| Not a tool at all | refund, cancel, edit address, change price, create discount | The agent cannot even ask |
Every call also has to be about this event's order or variant: the agent handling order #1104 cannot tag, hold or email about any other order.
suspicious-note tag and an alert to #ops. Nothing in it is acted on — and refunds are not a tool anyway.| What | Result |
|---|---|
| Tests: dedupe, no AI call without a note, approvals queued, unknown tools / tags / other orders rejected, alert rate limit, injection note, approve-once, reorder only when selling, append-only audit, webhook HMAC, no PII from payloads | 11 / 11 pass |
| Server smoke test: signed webhook, duplicate delivery, bad signature (401), approve, approve again (409) | As expected |
| Same scenario with Claude making the decisions | Not run yet |
| Connected to a real store | Not yet (Admin mutations validated against 2026-10) |
Drafted the engine, drivers, SQLite store, server, simulator and tests; validated the Admin operations with the Shopify AI Toolkit.
Decided the three tiers, the tag allow-list, "rules first, AI only on notes", event scoping, dedupe on Event-Id and the reorder rule.