---
title: How FactualMinds Builds Production AI Agents for eCommerce on AWS (2026)
description: For the person who will build your first store agent on AWS, which is not a Shopify plug-in. One lookup workflow this week; refunds wait for a person. Planning silhouette ~$791/mo at 50K sessions.
url: https://www.daventa.co/blog/aws-ai-agents-for-ecommerce-factualminds-2026/
datePublished: 2026-08-09T18:09:00.000Z
dateModified: 2026-11-28T00:00:00.000Z
author: palaniappan-p
category: AI Agents
tags: ai-agents, ecommerce, bedrock-agentcore, agentcore-harness, strands, amazon-bedrock
---

# How FactualMinds Builds Production AI Agents for eCommerce on AWS (2026)

> For the person who will build your first store agent on AWS, which is not a Shopify plug-in. One lookup workflow this week; refunds wait for a person. Planning silhouette ~$791/mo at 50K sessions.

This note is for the person who will build your first production store agent on AWS, and for the store owner who must decide what that person is allowed to ship. The store decision is simple: pick **one** lookup workflow this week (usually where-is-my-order or support reads), keep refunds and cancels behind a person who still signs the money, and **skip** the agent when a Shopify Flow or order-system rule already closes the case. There is no native Shopify connector; your order, inventory, and helpdesk systems sit behind APIs you own. Planning cost for a support-shaped platform silhouette is about **~$791/mo** at 50K sessions, a floor for modeling and not a client invoice. The rest of this post is the architecture brief: Harness vs Runtime, tool gates, and why Next.js is the ops dashboard and not the runtime.

This is the technical-authority post in the [eCommerce AI Agents](https://www.daventa.co/blog/ai-agents-for-ecommerce-15-automations-2026/) series. Audience: CTOs, technical founders, engineering leaders, enterprise architects. It explains how FactualMinds recommends **composing** production agents on AWS. It is **not** an anonymized client engagement, and it does **not** duplicate the supervisor-plus-four-specialists sample. That architecture, Cedar, and stubs already live here:

**On June 17, 2026**, AgentCore **Harness** reached general availability: create an agent with configuration, invoke it with a streaming API, and stop hand-rolling session stores for the default path ([What's New](https://aws.amazon.com/about-aws/whats-new/2026/06/amazon-bedrock-agentcore-harness-generally-available/), [Harness get started](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/harness-get-started.html)). For CTOs evaluating AWS AI agents for eCommerce, that date removes the "wait for a managed loop" excuse. Even so, not every store needs Harness **and** a custom Runtime graph **and** a Next.js console on day one.

> **AWS lifecycle notice (June 30, 2026):** Amazon Bedrock Agents Classic is in maintenance for new customers after **July 30, 2026**. Net-new agent builds should use [Bedrock AgentCore](https://www.daventa.co/blog/amazon-bedrock-agentcore-production/). Full matrix: [lifecycle roundup](https://www.daventa.co/blog/aws-service-lifecycle-updates-june-2026/).

- [Build eCommerce store AI agents on AgentCore](https://www.daventa.co/blog/ecommerce-ai-agents-amazon-bedrock-agentcore-2026/)
- Clone [`examples/architecture-blog-2026/ecommerce-agentcore-store-agents/`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-agentcore-store-agents/README.md)

> **First-party signals we reuse (not eCommerce outcomes):** Gateway server-side tools cut median tool round-trip **~180 ms → ~95 ms** on a **B2B CRM assistant** (12 tools, ~8k turns/day): [Gateway post](https://www.daventa.co/blog/amazon-bedrock-agentcore-gateway-server-side-tool-execution-2026/). Platform TCO silhouette: support-style AgentCore at **50K sessions/mo ~$791/mo** platform + model ([decision guide](https://www.daventa.co/blog/aws-bedrock-agentcore-vs-amazon-q-enterprise-decision-guide-2026/)). Model your mix on the [AgentCore pricing calculator](https://www.daventa.co/tools/amazon-bedrock-agentcore-pricing-calculator/).

> **Reproduce this:** read [`architecture-cto-brief.md`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/architecture-cto-brief.md) and paste [`monday-checklist.md`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/monday-checklist.md) into the RFC. Open the draw.io: [`architecture.drawio`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/architecture.drawio). Folder: [`examples/architecture-blog-2026/ecommerce-ai-agents-series/`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/README.md).

**Opinionated take:** treat Harness as the paved road for the first production commerce agent. Treat Runtime plus [Strands 1.0 multi-agent primitives](https://strandsagents.com/docs/user-guide/concepts/multi-agent/multi-agent-patterns/index.md) as the paved road once topology, hop caps, or A2A show up. Treat Next.js as an optional HITL/admin surface. Trade-off: you give up a single-repo "full stack agent" story; you keep AWS isolation, Policy, and Memory where they belong.

FactualMinds is an AWS Select Tier Services Partner. We help eCommerce businesses design agents that connect storefronts, business data, and back-office operations, with human approval on writes.

## Reference architecture (typical; not every box is mandatory)

```mermaid
flowchart TD
  store[Storefront]
  events[Events and APIs]
  app[Agent application]
  harness[AgentCore Harness]
  strands[Strands on Runtime]
  bedrock[Amazon Bedrock]
  tools[Approved tools via Gateway]
  orders[Orders]
  crm[CRM]
  erp[ERP]
  inv[Inventory]
  wms[WMS]
  analytics[Analytics]
  store --> events
  events --> app
  app --> harness
  harness -->|export when topology appears| strands
  harness --> bedrock
  strands --> bedrock
  harness --> tools
  strands --> tools
  tools --> orders
  tools --> crm
  tools --> erp
  tools --> inv
  tools --> wms
  tools --> analytics
```

The same picture as a diagram file you can drop into Confluence: [architecture.drawio](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/architecture.drawio).

| Layer                      | Role                                       | You own                                                                 | AWS owns                                                       |
| -------------------------- | ------------------------------------------ | ----------------------------------------------------------------------- | -------------------------------------------------------------- |
| **Storefront / OMS / PIM** | System of record                           | Shopify, custom, ERP, WMS connectors                                    | Nothing AgentCore-specific                                     |
| **Events / APIs**          | Triggers and contracts                     | Webhooks, EventBridge, your OpenAPI                                     | Optional EventBridge bus                                       |
| **Agent application**      | Session UX, HITL queue, evals, cost alarms | Often Next.js + TypeScript + Tailwind (**not required**)                | —                                                              |
| **AgentCore Harness**      | Config-driven managed loop **on** Runtime  | Model, instructions, tools, memory config                               | Orchestration loop, streaming, default Memory, export scaffold |
| **Runtime + Strands**      | Custom loop when config is not enough      | Container/CodeZip, hop caps, Agents-as-Tools / Graph / Swarm / Workflow | MicroVM isolation, session lifecycle                           |
| **Amazon Bedrock**         | Models + Guardrails                        | Prompt/tool schemas you pass to Converse                                | Model hosting, Guardrails enforcement                          |
| **Gateway + Policy**       | Tool choke point                           | OpenAPI/MCP/Lambda targets, Cedar                                       | Invocation path, Policy evaluation                             |
| **Identity**               | Shopper vs associate                       | JWT claims, IdP                                                         | Brokering into Gateway                                         |

There is **no native Shopify AgentCore connector**. Shopify (or Magento, BigCommerce, custom) sits behind **your** APIs. Gateway does not speak Admin GraphQL by magic.

**Not every customer needs Harness and Runtime as two products they operate.** Harness already runs on Runtime. You operate **Harness** until you export. After `agentcore export harness`, you operate **Runtime** with generated Strands-based Python (or you host that code elsewhere). Do not staff two control planes for a four-tool WISMO bot.

## Agent application architecture

The agent **application** is everything that is not the model loop:

- Inbound channel (storefront chat, helpdesk, Slack, associate console)
- AuthN/Z before AgentCore Identity (shopper JWT vs associate JWT)
- Idempotency keys for writes the workflow will execute
- Human-in-the-loop queue
- Golden eval suite and A/B split (AgentCore A/B can target versions even off Runtime)
- Cost and DENY dashboards

FactualMinds recommends building that surface in **Next.js + TypeScript + Tailwind** because ops teams need session replay, approval buttons, and alarms in a browser. That stack is **typical**, not contractual. A helpdesk-native HITL queue is valid. A terminal is not a strategy.

The application **invokes** `InvokeHarness` (or `InvokeAgentRuntime`) with a `runtimeSessionId` (≥33 characters on the Harness data plane). It does not embed the tool sandbox in a Next.js server action.

The hybrid control flow, where the workflow owns money movement, is argued in [AI agent vs workflow automation](https://www.daventa.co/blog/ai-agent-vs-workflow-automation-ecommerce-2026/).

## Tool-based data access

Agents must not get a SQL user on the replica. They get **tools**:

- Reads: `getOrder`, `getShipment`, `searchProducts`, `getInventory`, analytics RPCs with row caps
- Writes: `cancelOrder`, `createReturn`, `updateInventory`. Default deny, Cedar, HITL above caps

Attach OpenAPI or MCP to **AgentCore Gateway**. When the catalog of tools grows past ~10, use Gateway semantic search so the model sees a shortlist, the same failure mode as the [Gateway server-side tools post](https://www.daventa.co/blog/amazon-bedrock-agentcore-gateway-server-side-tool-execution-2026/). The CRM canary (~180 ms → ~95 ms median tool RTT) is why we prefer server-side Gateway execution; your OMS still dominates wall clock.

**Memory** (Harness default, also available on Runtime) is a session and long-term **shopper/associate notebook**, not the product catalog. **Knowledge Bases** (Managed KB GA June 17, 2026, or classic Bedrock KBs) hold size charts and return policy PDFs. Do not dump the catalog into Memory.

AWS Context was still **Coming soon** as of the August 2026 ship map. Do not block an RFC on it; see the [Harness + Strands post](https://www.daventa.co/blog/production-ai-agents-aws-agentcore-harness-strands-2026/).

## Orchestration: Harness first, Strands when topology appears

Two control-plane calls cover the standard path. Context: Python 3.12+, `boto3` ≥ 1.38.0, IAM execution role, [supported region](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-regions.html). Sketch only: pin the model your account allows; this is not a proprietary deploy script.

```python
# Sketch — CreateHarness / InvokeHarness (see AWS Harness get-started docs)
import boto3
import uuid

control = boto3.client("bedrock-agentcore-control", region_name="us-west-2")
created = control.create_harness(
    harnessName="commerce-wismo",
    executionRoleArn="arn:aws:iam::123456789012:role/HarnessExecutionRole",
)
# Poll get_harness until READY, then:
client = boto3.client("bedrock-agentcore", region_name="us-west-2")
response = client.invoke_harness(
    harnessArn=created["arn"],
    runtimeSessionId=str(uuid.uuid4()),
    messages=[{"role": "user", "content": [{"text": "Where is order ORD-1001?"}]}],
)
```

CLI equivalent (Node 20+, `@aws/agentcore`): `agentcore create`, `agentcore deploy`, `agentcore invoke`. When configuration cannot express hop caps or specialist routing, export:

```bash
# Context: @aws/agentcore CLI; Strands is the supported export target as of August 2026
agentcore export harness
```

[Strands 1.0](https://strandsagents.com/docs/user-guide/concepts/multi-agent/multi-agent-patterns/index.md) primitives we will actually name in code review:

| Primitive           | Shape                                   | Use in commerce               | When NOT to                        |
| ------------------- | --------------------------------------- | ----------------------------- | ---------------------------------- |
| **Agents-as-Tools** | Orchestrator calls specialists as tools | Hierarchical supervisor       | Fixed audit step order             |
| **Graph**           | DAG via `GraphBuilder`                  | Compliance / review pipelines | Open-ended shopper chat            |
| **Swarm**           | Peer handoffs + shared memory           | Exploration only, hard caps   | Ungated writes; unbounded handoffs |
| **Workflow**        | Code-defined sequential/parallel tasks  | Validation chains             | Free-form routing                  |

Prefer Agents-as-Tools for sales / orders / support / inventory **when** those prompts and IAM diverge. Prefer a single Harness when they do not. The longer sample (hop cap 2, eight tools, Cedar on three writes) is the [store-agents post](https://www.daventa.co/blog/ecommerce-ai-agents-amazon-bedrock-agentcore-2026/), not a second copy here.

Context: `strands-agents` ≥ 1.x. Sketch of Agents-as-Tools; replace with Gateway-backed specialists in production.

```python
# Sketch — not the four-specialist production stubs
from strands import Agent

wismo = Agent(system_prompt="Answer only from getOrder/getShipment tool results.")
orchestrator = Agent(
    system_prompt="Route tracking questions to wismo. Do not call cancel tools.",
    tools=[wismo.as_tool(name="wismo", description="Order and shipment status.")],
)
```

## Security boundaries

1. **Identity JWT:** `role=shopper` vs `role=associate` (and `admin`) into Gateway Policy. Shopper tokens must DENY `updateInventory` even if a specialist is invoked by mistake.
2. **Cedar on Gateway writes:** cancel window, refund cap, inventory role. Run **`LOG_ONLY`**, then **`ENFORCE`**. Prompt text is not a control.
3. **Guardrails on Bedrock:** complementary; they do not replace Cedar for tool authorization.
4. **No payment capture in agent tools:** keep PCI scope in the existing checkout.
5. **Browser / Code Interpreter default off:** enable per intent. Support-bot pilots with Browser left hot tracked roughly **3×** Runtime-shaped spend ([ship map](https://www.daventa.co/blog/production-ai-agents-aws-agentcore-harness-strands-2026/)).

Context: Cedar sketch aligned to the public sample policy; entity shapes must match your Gateway schema. Full file: [`refund-and-cancel.cedar`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-agentcore-store-agents/policy/refund-and-cancel.cedar).

```cedar
// Sketch — auto-refund ceiling (demo). Not a customer policy.
permit (
  principal,
  action == Action::"createReturn",
  resource
)
when {
  principal has role &&
  ["shopper", "associate", "admin"].contains(principal.role) &&
  resource has refundUsd &&
  resource.refundUsd <= 75
};
```

## Human approval

HITL is a **queue**, not a system prompt that says "be careful." Day 4 of [`monday-checklist.md`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/monday-checklist.md): session id + tool trace on every escalation; associate-only writes proven DENY for shopper tokens.

The Next.js dashboard, when there is one, is the approval UX: replay, Cedar decision, "approve cancel" that calls the **workflow**, not a second unconstrained model turn.

## Observability and scaling

Harness and Runtime emit OpenTelemetry-compatible spans into CloudWatch. Track:

- Tool mix (alarm if Browser fires on status-only intents)
- Policy ALLOW vs DENY (`aws.agentcore.policy.authorization_decision`)
- Escalation rate
- Session active seconds (this is the Runtime bill driver)

Pair traces with [AgentCore Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations.html) before you scale chat volume, and confirm regional availability.

Scaling comes from **session isolation**, not a bigger ECS task for the model loop. Gateway and OMS rate limits will bite before Firecracker does. Budget from the [AgentCore pricing calculator](https://www.daventa.co/tools/amazon-bedrock-agentcore-pricing-calculator/) using **your** average active seconds, not the **~$791/mo @ 50K** silhouette as a quote.

Production deployment: IAM execution role for the harness, Identity configured, Gateway targets in private APIs, Policy attached, Observability on, eval suite in CI. Classic `InvokeAgent` action groups are a migration inventory, not a greenfield path.

## Platform specifics: Shopify, Adobe Commerce, BigCommerce

As of 25 September 2026 none of the three has a native AgentCore connector. Each is an API you wrap in named tools behind Gateway. The common rule: read scopes first, fixed operations instead of a passthrough client, webhooks as refresh signals, and no write credential in week one.

| | Shopify | Adobe Commerce (Magento) | BigCommerce |
| --- | --- | --- | --- |
| API to pin | GraphQL Admin API (REST Admin only for older apps) | REST `/rest/{store_code}/V1/` | REST Management API, `https://api.bigcommerce.com/stores/{store_hash}/...` |
| Agent credential | App token in `X-Shopify-Access-Token`, scopes granted by the merchant | Integration: OAuth 1.0a consumer key/secret plus access token/secret; ticked resources are the boundary | API account token in `X-Auth-Token`; scopes ticked at creation |
| Wrong credential | Staff password or a custom app with every scope | Admin token (username and password, 4-hour default lifetime, two-factor) | Reusing a theme or script account that already has modify scopes |
| Webhook gotcha | Topic needs its matching scope; destinations include HTTPS, Pub/Sub, EventBridge; verify the HMAC | PaaS: module config with your auth headers. SaaS: Admin or REST, not every method. Log `x-adobe-commerce-request-id` | `POST /stores/{store_hash}/v3/hooks`, one hook per call, destination on port 443 returning 200 |

### Shopify

- Start from read scopes for orders and fulfillment, products and variants, and inventory levels. Do not add `write_orders`, refund, or price-list writes for a later phase. Protected customer fields (email, address, phone) are a product decision; key the lookup on an order id the shopper already has.
- Expose `getOrder`, `getFulfillment`, and `getVariantAvailability` (with `asOf`) as fixed queries. Do not pass model-written GraphQL through.
- Storefront API is the buyer-facing surface. An associate order lookup needs Admin reads, so keep two credentials and two tool sets and deny the Admin client when the caller is the shopper.
- On HTTP 429, honor `Retry-After` in the adapter and tell the model the shop is busy; do not loop.
- `audit_events/admin_api_activity` is a Plus-oriented topic (Pub/Sub or EventBridge destination) for what the app called. It does not replace your own trace of what the model asked.
- OpenAI says Shopify Catalog already supplies product data to ChatGPT, so merchants do not build a second feed for that path. Checkout inside ChatGPT is a separate approved-partner program.

### Adobe Commerce (Magento)

- Per Adobe's token authentication guide, an integration yields OAuth 1.0a credentials and is the server-to-server option. Admin tokens default to 4 hours and admin accounts need a two-factor provider. Customer tokens default to 1 hour and are for shoppers. Leave bearer-token-as-OAuth off.
- On Adobe Commerce as a Cloud Service, the integration starter kit uses OAuth server-to-server credentials from the Developer Console. JWT service-account auth was deprecated, so do not start a new JWT integration.
- PaaS base URL is `https://{host}/rest/`. SaaS uses the Commerce API host Adobe gives that environment. Pin it; a tool that guesses `/rest/V1` on SaaS will 404.
- Named reads only: order by increment id, shipments, stock via the inventory API you enabled (MSI is not the qty column on every install), typed product attributes. Omit credit memo, invoice capture, and `POST /V1/orders/{id}/cancel` from the OpenAPI file the agent sees, and give the integration only the resources you listed.
- Pass the store code on every call; two store views can carry two prices. Return the inventory field name rather than subtracting reservations in the prompt, and say what shipped on a partial shipment.
- Storefront GraphQL is for the shopper UI; back-office reads belong on REST with an integration.

### BigCommerce

- Create a dedicated API account for the agent and tick read scopes only, using the scope names in the current API accounts guide. Webhooks, metafields, and scripts are visible only to the account that created them, so revoking that account removes them. Keep webhook creation in deploy, not in a model tool.
- The B2B API is a different host (`https://api-b2b.bigcommerce.com`) plus an `X-Store-Hash` header. Do not point storefront tools at it.
- Webhook destinations must be HTTPS on port 443 and return 200; custom ports are unsupported, so a listener on 8443 never fires. Verify the header or secret you configured, and key the handler on the event id because deliveries repeat.
- Tools: `getOrder` (fixed fields), `getShipment`, and `getVariantInventory` with a timestamp. Do not expose `createRefund` or `createHook`. Delete any path passthrough under `/v3/`.

> **Failure pattern to test for (BigCommerce):** a tool builder that passes through any path the model supplies lets a test prompt reach a refund route an older scope set still allows. **Detection:** the trace shows a path the allow-list does not name. **Fix:** delete path passthrough, rotate the token, reissue read-only. **Lesson:** expose named operations, not a general HTTP client.

> **Failure pattern to test for (Adobe Commerce):** an adapter that uses an admin token "temporarily" and stores it in agent memory, so the next turn need not re-authenticate, leaves a bearer token that a second agent in the same account can read. **Detection:** search memory traces for bearer tokens. **Fix:** delete the record, rotate the admin user, switch to an integration. **Lesson:** tokens are not facts about the shopper; keep them in a secret the model cannot retrieve.

Use the Admin API where one exists instead of a browser tool that scrapes the admin.

## What broke

> **What broke:** architecture review where the RFC listed "Harness + Runtime + Strands + Next.js" as a single required stack for a four-tool WISMO lookup. Harness would have covered the loop; four specialists and an unstaffed dashboard added hop latency and an empty HITL queue. **Detection:** unused export stubs and zero approvals in the first canary week. **Fix:** Harness for the first production agent if config is enough; export to Strands when hop caps appear; Next.js only when humans need a queue. **Lesson:** not every customer needs Harness and Runtime as two operated products, and Next.js is not the AWS runtime.

The dual-write cancel-on-delivered failure remains the commerce write-path counter-case, documented on the [sample](https://www.daventa.co/blog/ecommerce-ai-agents-amazon-bedrock-agentcore-2026/) and not repeated here as a fake KPI.

## What to do this week

1. Paste [`monday-checklist.md`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/monday-checklist.md) into the RFC. Ship **one** workflow, not five agents.
2. Confirm Agents Classic is **not** the net-new path (maintenance for new customers after July 30, 2026).
3. Choose Harness if ≤5 tools, one team, no hop caps; otherwise Runtime + Strands.
4. Draft **read** OpenAPI only; Gateway Policy `LOG_ONLY`; Browser off.
5. Write 10 golden tasks + 3 must-escalate cases. Alarm on DENY spikes and unexpected tool mix.
6. Prove shopper JWT cannot write inventory. Flip Cedar to **ENFORCE** only after the canary.
7. Open [`architecture-cto-brief.md`](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/architecture-cto-brief.md) with the [draw.io](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-ai-agents-series/architecture.drawio) in the same PR.
8. If you need the supervisor topology, clone [store-agents](https://www.daventa.co/examples/architecture-blog-2026/ecommerce-agentcore-store-agents/README.md) instead of re-authoring it.
9. Model cost, then [book an architecture review](https://www.daventa.co/contact-us/) or start from [Amazon Bedrock services](https://www.daventa.co/services/aws-bedrock/).

## Operating contract

This is the reference contract for a FactualMinds store agent. It is not a deployment this repository runs. The [Agentic AI Lens](https://docs.aws.amazon.com/wellarchitected/latest/agentic-ai-lens/design-principles.html) (published June 10, 2026) asks for bounded agents, traceable actions, and autonomy matched to the consequence. The clauses below are ours. They are not a copy of that lens, and they are not Strands' wording.

**Before action.** Understand the task, inspect the state this task already has, name the tools that are allowed, judge the risk, and check the scope. Prefer a tool result over a guess.

**During action.** Use only authorized tools. Keep the task boundary. Reject a tool input that does not match the schema. A failure is a result, not a silent retry. Stay inside the turn, token, tool-call, and time limits. Leave a trace.

**Before an irreversible action.** Name the impact, confirm the caller is allowed, require a person when the policy says so, and check the account, region, and tenant. The model deciding the action is safe does not count as authorization.

**Before completion.** Check the result against the acceptance rule. Say so when the work is partial. Attach the evidence.

The default lifecycle is explore, act, confirm, verify. Explore gathers the order, the policy, and the dependencies. Act is limited to reversible reads and drafts. Confirm pauses before a refund, a cancel, a price change, or a purchase order. Verify is a separate check: the step that drafted the answer does not grade it.

Four stores stay separate:

| Store | Holds | Does not hold |
| --- | --- | --- |
| Task state | Steps, tool results, approvals, and spend for this task | The next unrelated conversation |
| Session | Enough to resume this task: status, completed steps, pending steps, failures | A durable fact about the shopper |
| Long-term memory | A fact worth keeping after this task, after a write check | Raw tool output or ticket text |
| Context window | The minimum the model needs for this call | The full history by default |

Stable instructions (the contract, tool schemas, and policy) can sit in a prefix the provider caches, when that provider's current docs say caching works. The task, the tool results, and the changing state stay dynamic. Do not assume a provider caches the prefix.

Stop reasons the caller can branch on: `completed`, `budget_exceeded`, `timed_out`, `cancelled`, `guardrail_blocked`, `approval_required`, `tool_failure`, `verification_failed`, `partial_completion`. "The agent failed" is not a reason.

Skills load when the task needs them. A returns-policy skill or a merchandising skill is instructions, constraints, and a workflow. It does not belong in the base prompt next to every other skill, and it does not grant a tool.

Hook points on a loop you operate sit before and after the model call and the tool call. [Securing store agents](https://www.daventa.co/blog/secure-ai-agents-ecommerce-store-2026/) names the decisions those checks return. [Harness and Strands](https://www.daventa.co/blog/production-ai-agents-aws-agentcore-harness-strands-2026/) names the loop events in the current Strands docs. The sample `harness.py` runs the checks locally. It does not register Strands hook classes, and it does not call AWS.

## Controls around the model

AgentCore Harness, Strands, and Gateway are primitives. The application still owns the loop below. No limit here is a universal number. Tune them to the workflow and the blast radius.

1. **Task intake.** Name the task, its type, complexity, risk, the tools it may use, the result you expect, the data sensitivity, the environment, the budget, the time box, and whether a person must approve.
2. **Context.** Give the model the minimum trusted context for this decision. More history is not automatically better context.
3. **State, session, memory, context.** Task state is this job. A session resumes that job. Memory is a fact worth keeping after it. Context is what this model call needs. The transcript is none of those four. See [what to remember](https://www.daventa.co/blog/ai-agent-memory-ecommerce-2026/).
4. **Tools.** The chain is agent, router, permission, policy, budget, tool, then a check of the result. Classify each tool as read, write, execute, external, sensitive, or irreversible.
5. **Permissions.** The model is not the security boundary. A sentence in the prompt is not an allow. Identity and policy sit between the agent and the store. See [securing store agents](https://www.daventa.co/blog/secure-ai-agents-ecommerce-store-2026/).
6. **Guardrails.** Cover behavior, data, tools, operations (steps, retries, tokens, cost), and environment (account, region, tenant, production versus staging).
7. **Model routing.** Classification and formatting can use a smaller model. Planning and a high-risk review use a stronger one. The harness chooses. Do not hard-code one model for every step.
8. **Planning.** Complex work is task, then plan, then a check of the plan, then execution. A plan does not grant new authority.
9. **Verification.** The step that generates and the step that checks are different. Schema, policy, and a golden task beat a model grading its own answer. See [evaluation](https://www.daventa.co/blog/ai-agent-evaluation-regression-testing-ecommerce-2026/).
10. **Recovery.** Bound the retries. Back off on rate limits. Escalate when verification keeps failing. Stop on budget or a denied permission. No infinite loop.
11. **Observability.** Record the task, model version, context version, tool calls, policy decisions, verification, approvals, errors, latency, and cost. No raw secrets or card data in the log.
12. **Cost.** The harness enforces the budget. The model must not be trusted to stop itself.
13. **Evaluation and drift.** Keep golden tasks, must-escalate cases, and a regression run when the model, prompt, tool, or retrieval changes.
14. **Feedback.** Classify the failure before you add a rule. Improve the policy, the context, the route, or the tool. Then re-evaluate. Do not freeze every rejection into a permanent constraint.

Reload durable constraints before a sensitive action. A summary of the chat is not a permission check. Tickets, email, catalog copy, and retrieved pages are untrusted data: they do not get to call tools, change policy, or read secrets. Tenant A context never becomes tenant B tools.

Human approval scales with the action. Lookups can run. Purchase orders, refunds, price overrides, deploys, and deletes wait. The bound should match the risk.

## What this post doesn't cover

- Duplicating the supervisor + four specialists implementation, which is [already published](https://www.daventa.co/blog/ecommerce-ai-agents-amazon-bedrock-agentcore-2026/)
- A native Shopify AgentCore connector; you own middleware
- Proprietary FactualMinds deploy pipelines, CDK modules, or customer IAM layouts
- AWS Context APIs, which are not GA as of the August 2026 ship map
- HIPAA/PCI control mapping (Gateway Policy is not a BAA)
- Measured eCommerce conversion or deflection KPIs from named clients; we are not inventing them
- Region-by-region SKU matrices; verify [AgentCore regions](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-regions.html)

## FAQ

### When should a CTO NOT require both Harness and Runtime?

Most first production agents need one host story. Harness is a config-driven managed loop that already runs on Runtime. Start on Harness if configuration covers model, instructions, tools, and Memory. Export to Strands on Runtime when you need hop caps, Agents-as-Tools, Graph, Swarm, or Workflow. Buying both as a checkbox adds ops without adding a control plane.

### What could go wrong if Next.js is treated as the AWS agent runtime?

You inherit Node process isolation instead of AgentCore microVM sessions, you lose managed Memory/Gateway/Identity defaults, and you will be tempted to call Bedrock Converse with ad-hoc tools from a server action. Next.js plus TypeScript plus Tailwind is the ops dashboard stack FactualMinds recommends for HITL, traces, and cost alarms. It is an application layer. It is not required for every customer.

### When should you NOT start from the supervisor plus four specialists sample?

Skip that topology when you have five or fewer tools, one team, and a single conversation shape (WISMO only, or catalog Q and A only). A single Harness with Gateway reads is cheaper to operate. Multi-agent pays off when sales, orders, support, and inventory prompts and IAM diverge. Link the sample; do not copy it into every RFC.

### What could go wrong if Cedar stays off on refund and inventory writes?

The model can call cancelOrder, createReturn, or updateInventory with shopper tokens or on delivered orders. Prompt text is not an authorization boundary. Put Cedar on Gateway, run LOG_ONLY, then ENFORCE. Identity JWT claims (shopper vs associate) must flow into Policy even if specialists share an entrypoint.

### Is Amazon Bedrock the agent host?

No. Bedrock provides foundation models (Converse) and Guardrails. AgentCore Harness or Runtime hosts the loop. Strands (or another framework) is application code on Runtime after export. Collapsing those names in a board deck is how teams buy Classic Agents again.

### Should net-new eCommerce agents still use Bedrock Agents Classic?

No. Agents Classic is in maintenance for new customers after July 30, 2026. Net-new builds should use AgentCore Harness or Runtime plus Gateway. Existing Classic deployments keep running; inventory tools and sessions before cutover.

### What could go wrong if the agent sends arbitrary GraphQL to Shopify?

The model will eventually ask for a mutation that the token allows. Expose getOrder and getProduct as tools with fixed queries. Do not pass a GraphQL string through from the model.

### Is the Shopify Storefront API enough for a support agent?

No. Storefront API is the buyer-facing surface. Order lookup for a signed-in associate needs Admin API reads. Do not give the shopper-facing agent the associate token.

### When should you NOT give an agent an Adobe Commerce admin token?

When the token is minted from a username and password. Adobe documents admin tokens as bearer credentials that default to a 4-hour lifetime, and admin accounts need their own two-factor flow. Use an integration with a short resource list instead.

### What could go wrong if a BigCommerce webhook URL is not on port 443?

BigCommerce rejects it. The create-webhook reference says the destination must be HTTPS on port 443 and return 200, and custom ports are not supported. A listener on 8443 never fires and the agent keeps reading stale orders.

### What could go wrong if BigCommerce B2B and the storefront share one token?

The B2B API uses a different host (api-b2b.bigcommerce.com) and an X-Store-Hash header. Pointing a storefront token at that host, or using a B2B token for catalog writes, fails or hits the wrong account. Split the credentials and the tool sets.

---

Need a Harness-versus-Runtime RFC and Gateway Policy on refunds without a native Shopify connector myth? [Contact FactualMinds](https://www.daventa.co/contact-us/) or see [Amazon Bedrock](https://www.daventa.co/services/aws-bedrock/).

## How the AWS store-agent architecture stays bounded

Place a store agent on AgentCore with Gateway, policy, and a human on writes.

- **Maturity:** Reference design
- **Risk if it goes wrong:** high
- **Oversight:** a person approves before it acts
- **Starts when:** An architecture review for the first store agent.
- **Tools:** A write goes through a router, a permission check, a policy check, and a budget check. The model does not commit it. An approval token lives in tool context, not in the user message.
- **Stops for a person:** Refunds, cancels, and inventory writes wait for policy, and for a person when the action is hard to undo.
- **Checked by:** Golden tasks include must-escalate cases. A shopper token cannot call an associate write.
- **Untrusted data:** Shopper messages and tool payloads that try to widen their own scope.
- **If it fails:** If the AWS store-agent architecture stops, name the reason: completed, budget_exceeded, timed_out, cancelled, guardrail_blocked, approval_required, tool_failure, verification_failed, or partial_completion. Retry a timeout at most twice. Back off on rate limits. After repeated verification failure, escalate. Stop when the budget is exhausted or a permission is denied. No unbounded loop. Refunds, cancels, and inventory writes wait for policy, and for a person when the action is hard to undo.
- **Lifecycle:** Explore, then act, then confirm, then verify. Explore gathers the context for the AWS store-agent architecture. Act stays reversible. Confirm stops before an irreversible step. Verify is a separate check of the outcome.

Reference architecture, not a published production deployment. The shared contract is the [AWS store-agent architecture](https://www.daventa.co/blog/aws-ai-agents-for-ecommerce-factualminds-2026/#operating-contract).

## FAQ

### When should a CTO NOT require both Harness and Runtime?
Most first production agents need one host story. Harness is a config-driven managed loop that already runs on Runtime. Start on Harness if configuration covers model, instructions, tools, and Memory. Export to Strands on Runtime when you need hop caps, Agents-as-Tools, Graph, Swarm, or Workflow. Buying both as a checkbox adds ops without adding a control plane.

### What could go wrong if Next.js is treated as the AWS agent runtime?
You inherit Node process isolation instead of AgentCore microVM sessions, you lose managed Memory/Gateway/Identity defaults, and you will be tempted to call Bedrock Converse with ad-hoc tools from a server action. Next.js plus TypeScript plus Tailwind is the ops dashboard stack FactualMinds recommends for HITL, traces, and cost alarms. It is an application layer. It is not required for every customer.

### When should you NOT start from the supervisor plus four specialists sample?
Skip that topology when you have five or fewer tools, one team, and a single conversation shape (WISMO only, or catalog Q and A only). A single Harness with Gateway reads is cheaper to operate. Multi-agent pays off when sales, orders, support, and inventory prompts and IAM diverge. Link the sample; do not copy it into every RFC.

### What could go wrong if Cedar stays off on refund and inventory writes?
The model can call cancelOrder, createReturn, or updateInventory with shopper tokens or on delivered orders. Prompt text is not an authorization boundary. Put Cedar on Gateway, run LOG_ONLY, then ENFORCE. Identity JWT claims (shopper vs associate) must flow into Policy even if specialists share an entrypoint.

### Is Amazon Bedrock the agent host?
No. Bedrock provides foundation models (Converse) and Guardrails. AgentCore Harness or Runtime hosts the loop. Strands (or another framework) is application code on Runtime after export. Collapsing those names in a board deck is how teams buy Classic Agents again.

### Should net-new eCommerce agents still use Bedrock Agents Classic?
No. Agents Classic is in maintenance for new customers after July 30, 2026. Net-new builds should use AgentCore Harness or Runtime plus Gateway. Existing Classic deployments keep running; inventory tools and sessions before cutover.

### What could go wrong if the agent sends arbitrary GraphQL to Shopify?
The model will eventually ask for a mutation that the token allows. Expose getOrder and getProduct as tools with fixed queries. Do not pass a GraphQL string through from the model.

### Is the Shopify Storefront API enough for a support agent?
No. Storefront API is the buyer-facing surface. Order lookup for a signed-in associate needs Admin API reads. Do not give the shopper-facing agent the associate token.

### When should you NOT give an agent an Adobe Commerce admin token?
When the token is minted from a username and password. Adobe documents admin tokens as bearer credentials that default to a 4-hour lifetime, and admin accounts need their own two-factor flow. Use an integration with a short resource list instead.

### What could go wrong if a BigCommerce webhook URL is not on port 443?
BigCommerce rejects it. The create-webhook reference says the destination must be HTTPS on port 443 and return 200, and custom ports are not supported. A listener on 8443 never fires and the agent keeps reading stale orders.

### What could go wrong if BigCommerce B2B and the storefront share one token?
The B2B API uses a different host (api-b2b.bigcommerce.com) and an X-Store-Hash header. Pointing a storefront token at that host, or using a B2B token for catalog writes, fails or hits the wrong account. Split the credentials and the tool sets.

---

*Source: https://www.daventa.co/blog/aws-ai-agents-for-ecommerce-factualminds-2026/*
