• Inspiration

Most people now have an AI assistant they trust, such as ChatGPT, Claude, Gemini or Copilot. Websites still treat those assistants as outsiders. Either the site has its own chatbot that asks you to sign up or paste an API key, or your agent scrapes pages and acts without asking. We wanted to try the opposite with something everyone does: shopping for a recipe. The site publishes what agents need, your own agent does the thinking, and you keep the final say.

The Open Agentic Web MVP specification gave us the frame. Sites publish portable agent networks and tools, visitors' browsers run them, and the user approves anything that crosses a boundary.

What it does

Bring Your Own Agent (BYOA) is a demo supermarket, Greenleaf Market, at https://greenleaf-market.vercel.app.

  1. You click Copy the prompt and paste it into the AI you already use. The prompt carries the store's full product list: 164 products, each with how it's sold (each or pack), pack contents, price, unit price and stock.
  2. You give your AI a recipe or a dish name. It matches every ingredient to a product and shows a table with price each, packs, line total and stock. It also gives the estimated total, suggests substitutes (fresh basil is out of stock, so it offers dried), and says what the store doesn't sell, such as wine.
  3. Your AI hands you one cart link. Opening it adds nothing. The store re-checks every item against real ids, stock and current prices, and lets you untick items or change quantities.
  4. Items reach your cart only when you click Add to cart. Opening the same link twice doesn't add the items twice. The agent can't add items, order or pay.

It works however capable your AI is:

  • an AI with no web access uses the data attached to the prompt;
  • one that can browse opens the store lookup at fixed URLs;
  • MCP clients connect to the store's public read-only MCP server.

The store also publishes a spec-style agent network, with a front agent and an ingredient-finder agent that uses the MCP tools. Other agentic websites can load it, and it runs in their visitors' browsers with their own model.

How we built it

  • Hosting: static pages and Vercel Functions, using the Web Request → Response signature.
  • Agent network: written in HOCON, then resolved into public JSON with an agent-manifest.json and links.json. The build uses nsDeploy, the spec's reference runtime, pinned as a submodule and vendored with small patches that we documented.
  • Grounded capability: a stateless MCP server built on the official SDK, with tools match_ingredients, lookup_products, search_products and create_cart_link. The same data is available over plain HTTP and as no-JavaScript pages: /store-lookup, /catalog.txt and /catalog.json.
  • Ingredient matching:

    • a parser for recipe lines that handles fractions, g/kg/oz/lb, ml/L, cups, tbsp, tsp and garlic cloves;
    • ranking that gives more weight to rare words;
    • pack counts worked out from unit conversion and capped at the stock on hand.
  • Cart: a local add_to_cart site action that the runtime asks you to confirm, and cart-link review pages that re-price everything on the server before anything is stored.

  • Security:

    • CORS is open only for public, read-only resources, and never with credentials;
    • the cart and model endpoints accept requests only from the store's own pages;
    • a strict Content Security Policy blocks inline scripts;
    • the model key stays on the server;
    • cart links carry only product ids and pack counts, in the URL fragment.
  • Testing:

    • 41 automated tests, including the real browser runtime run headless against the site;
    • smoke checks run against production from a separate origin;
    • CI on GitHub Actions;
    • real-browser checks in Microsoft Edge.

Challenges we ran into

  • AI chats that can't see websites. Our first prompt asked agents to build lookup URLs. Many AI browsers refuse to open URLs they construct themselves, and many don't run JavaScript, so the store looked empty to them. We moved the lookup to fixed, server-rendered URLs. Then we attached the whole store lookup to the prompt, so even an AI with no web access has units, prices and stock.
  • Ingredient matching is harder than it looks. Early versions matched "fresh basil leaves" to cilantro (the shared word "leaves"), "water" to tuna in water, and "whole chicken" to chicken breast. Weighting rare words, matching the full phrase, and keeping stop words out of product names fixed these cases. Tests now cover each one.
  • A runtime that expects a visitor key. The reference runtime only runs without a visitor key when it uses its mock model. We patched it so a site can fund its own model on its own origin. Peers can't take advantage of the patch, because a loaded network always uses the caller's model.
  • Upstream and platform quirks. The pinned nsDeploy resolver crashed on the object form of an MCP reference, so we use the URL form. CI failed because Python writes Windows line endings, which made one generated file differ between Windows and Linux. We fixed the build, and CI now reports exactly which files differ.
  • Keeping the agent out of the write path. We wanted outside agents to be useful without holding any power over the cart. The answer was cart links that only propose items, plus a review page where the shopper confirms.

Accomplishments that we're proud of

  • It works with any AI assistant, including ones with no browsing or tools, and needs no account, key or setup.
  • The user stays in control in a way you can check: agents only propose, the store re-validates, and nothing is added without a click.
  • Every product shows its sale unit, pack contents, price, unit price and stock. Pack suggestions never exceed what's in stock.
  • The site is live, with published spec artifacts, a public MCP server, passing CI and production smoke checks.
  • The repo is open source under Apache-2.0, and the README explains each step with screenshots.

What we learned

  • Agents vary widely. Some have MCP, some can browse, and many have neither. Plain text at a stable URL, or data attached to the prompt, reaches the most agents.
  • The spec makes a useful distinction between loading another site's agents into your browser and acting on another site. Loading is public and portable. Acting needs the owning site's authentication, authorization and the user's confirmation.
  • Prompts are interfaces. Precise column definitions ("price each", "line total") and rules ("never guess a price") changed what agents showed users more than any other tweak.
  • Good fail-closed behaviour comes from small details: rejecting product ids a model invented, treating timeouts as unknown outcomes, and never retrying a write automatically.

What's next for Bring Your Own Agent (BYOA)

  • Full spec interoperability demo. We'd build a recipe website on a second domain that loads the store's agents after the user approves contacting the store, and runs them with its own model. It would show private data staying behind unless a field is allowed, and visible errors for a cycle, an over-budget request and a denied origin. With a model key for the store's built-in assistant, all seven of the spec's MVP checks could be demonstrated live; today four aren't.
  • Scoped access for your own agent. We'd add a sign-in flow, using OAuth and an authenticated MCP endpoint, where you grant your agent limited, expiring, revocable access to one shopping task. The agent could then see the result and propose a cart, which you still confirm on the store's site, with an audit trail.
  • A server-side cart and a real checkout step, with the same confirm-first design and no payment details in agent chats.
  • Real catalogs. We'd connect real store inventories, so the same prompt and tools work for any grocer that publishes them.

Built With

Share this project:

Updates

Submission history