Customize Shopify agents.md Without Breaking Agent Discovery

Shopify now lets themes replace the managed agent file. Here is the full operator path: decide whether to customize, interview the brand for ground truth, draft section by section, publish safely, and hand a clean brief to whoever edits the theme.

Before we start: what you are changing

A Shopify theme controls more than the pages a shopper sees. It can also render public machine-readable files. In this Guide, you are adding one theme template that publishes a plain-text briefing at yourdomain.com/agents.md.

Shoppers will not see a new page or menu item. AI tools and shopping agents can request the file directly. The change applies when the theme containing the template is the published theme. Saving it in an unpublished preview theme does not change the live store.

If you are not a developer. You can still own most of this work. Complete the brand interview, approve the facts, and use the developer handoff in Step 7. A theme developer or Shopify partner can publish and test the file.

Dark code editor showing a short agents.md file with Liquid braces and a lime cursor
One theme file. One public briefing. Keep Shopify's dynamic values alive.

Plain-English glossary

TermWhat it means hereWhy you need to know it
Published / live themeThe theme currently serving your storefrontOnly its agents.md.liquid controls the live public file
Theme templateA file Shopify renders when a specific storefront URL is requestedagents.md.liquid is the template you will add
LiquidShopify's template language. Double braces print live store values.It prevents domains, currency, and commerce endpoints from going stale
MarkdownPlain text using # headings, bullets, and linksThe rendered file is readable by people and machines without an HTML page
Primary domainThe main public store address, without /en, /fr, or another locale folderShopify serves agents.md only at that bare domain
CanonicalThe main version Shopify treats as authoritative/agents.md is canonical; the llms URLs mirror it by default
UCPUniversal Commerce Protocol: the store's machine-readable commerce discovery layerAgents use it to understand supported buying capabilities
MCPModel Context Protocol: an endpoint through which an agent can discover available toolsRemoving this endpoint can break useful agent interaction
agents objectShopify-provided Liquid values such as store URL, currency, sitemap, UCP, and MCPUse these values instead of typing configuration by hand
Ground truthApproved facts that match the live catalog, policies, and brandThe file should point agents at truth, not create a second version of it

What you need before you begin

NeedWhyIf you do not have it
Your primary domainYou need to inspect the three public filesAsk the store owner which domain customers use
The name of the published themeThe template must reach the live themeShopify Admin → Online Store → Themes; the published theme is labeled Current theme
Theme code access or a developer contactSomeone must create agents.md.liquidComplete the copy and use the Step 7 handoff
Live shipping, returns, warranty, and contact URLsAgents should receive current facts and canonical sourcesDo not publish until the policy owner confirms them
One brand approver and one policy approverVoice and hard facts need different ownersName them in the ticket before drafting
A safe rollbackA custom file replaces Shopify's managed defaultSave the baseline output and keep the change in version control

Choose your path. Operator path: Steps 1–4, then hand off Step 7. Developer path: complete all steps. Both paths finish with the live URL checks in Step 8.

Start with the part most guides skip: you may not need this

Shopify manages /agents.md for every store. Shopify's own recommendation is to keep that managed file unless you have advanced instructions it does not cover. I agree.

Customize it when the default cannot explain your real category, buyer fit, canonical resources, policy constraints, or what an agent must not invent. Do not customize it just to say you have one.

The replacement rule. Adding templates/agents.md.liquid replaces Shopify's managed document. It does not merge your copy into the default. If you drop the dynamic commerce fields, they are gone from the rendered file.

Keep Shopify's default when

  • The generated file is accurate and your store does not need special instructions.
  • You do not have an owner to review brand and policy facts when they change.
  • You only want to add generic copy such as “great products and service.”

Customize agents.md when

  • Your offer, buyer fit, restrictions, or canonical resources need explanation.
  • AI answers repeat outdated or invented brand facts you can correct at the source.
  • A named owner can keep public instructions aligned with policies and the catalog.

What these three URLs are actually for

Two conventions collide here. llms.txt started as a general “curated map for language models” idea. Shopify treats agents.md as the commerce-facing canonical document: how an agent discovers and does business with the store.

FileJobOperator implication
/agents.mdCanonical briefing for shopping agents: who you are + how to transactThis is the file I customize when brand instructions matter
/llms.txtCompatibility URL that mirrors agents.md by defaultUsually do not create a separate template
/llms-full.txtCompatibility URL that also mirrors agents.md by defaultOnly split when you have a documented advanced requirement

One good file usually covers all three. Add only agents.md.liquid and Shopify serves it at all three paths. Separate llms templates create three documents you now have to keep accurate.

Storefront URLShopify checks in this order
/agents.mdagents.md.liquid → managed default
/llms.txtllms.txt.liquid → agents.md.liquid → managed default
/llms-full.txtllms-full.txt.liquid → agents.md.liquid → managed default

Who does what

Most failures happen when marketing waits for engineering to invent the brand voice, or engineering publishes without policy owners. Split the work.

RoleOwnsHands off when
Marketing / brand / opsInterview answers, hard facts, “must not invent,” canonical links, final read-aloudCopy is approved and ready to paste into the template
Theme developer / partnerCreate agents.md.liquid, keep agents object fields, publish to live theme, verify URLsRendered file matches approved copy and dynamic fields survive
Manager / decision ownerConfirms the company wants brand-specific AI instructions and who maintains themOwner + review cadence are named

Step 1 · Capture the baseline before you edit

Do this before anyone opens Theme Code Editor.

ActionWhat to write down
Open /agents.md on the primary domainPaste the full current output into your ticket
Open /llms.txt and /llms-full.txtNote whether all three match today
Highlight machine fieldsUCP discovery URL, MCP endpoint, UCP versions, sitemap, store URL, currency
Check for an old overrideApp proxy, redirect, or hosted file that used to fake llms.txt. Shopify owns these routes now.
Confirm the live themeWhich theme is published, and whether it is GitHub-synced or edited only in Admin

Primary domain only. Shopify serves the file at the bare primary domain. There is no localized Markets or locale-folder version.

Step 2 · Run the ground-truth interview

Draft in a shared doc first. The theme file publishes approved truth. It should not be the place where the team invents claims under deadline pressure.

AskGood enough answer looks likeReject if
What do we sell, in one sentence a stranger would understand?Category + concrete product types + primary use caseIt could fit any DTC brand
Who is this for, and who is it not for?Buyer role, environment, skill level, or constraintEveryone / anyone who loves quality
What do AI tools currently get wrong about us?Specific invented facts, wrong competitors, outdated policiesVague “they don't get our vibe”
What must never be promised?Shipping, returns, warranty, compatibility, certifications, lead timesNothing listed
Which 4–8 pages should an agent trust first?Best collection, policies, contact, one real FAQ/guideA dump of the whole sitemap
What exact policy numbers are live today?Copied from the policy page, not remembered from last year“About free shipping over a few hundred”

Sync to the truth sheet. If you already built a truth sheet in Prepare Your Shopify Store for AI Shopping Agents, reuse those hard facts here. Do not invent a second set of numbers for the agent file.

Step 3 · Use this section order

You can rename headings. Keep the jobs. Agents need identity, constraints, trusted links, then machine discovery.

SectionPurposeFill with
Title + one-linerName the store and what it isSpecific category + buyer, not a slogan
AboutDefine the brand in operator languageWhat we sell / who we serve / what we are not
Must not inventStop hallucination at the sourceExact forbidden claims and “say you don't know” rules
Canonical pagesPoint to trusted human-readable sources4–8 links that actually resolve
Hard factsPolicy thresholds agents repeatNumbers that match live policy pages
Commerce protocolPreserve Shopify transaction discoveryDynamic agents object fields only
Read-only browsingCatalog access pathsSitemap, collections, product JSON, search
PoliciesLegal/policy entry pointsPrivacy, terms, refund, shipping URLs

Keep price, availability, and volatile SKU facts in Shopify product data. Do not hand-maintain a second catalog inside agents.md.

Step 4 · Write it so it cannot belong to another brand

Read every sentence out loud. If a competitor could paste it unchanged, rewrite it.

WeakStronger
We sell high-quality products with excellent service.We sell low-voltage LED tape and fixtures for wet-location installs.
Free shipping on qualifying orders.Free shipping at $350+ before tax on contiguous US orders.
Easy returns.Returns within 30 days on unopened goods. Opened custom cuts are final sale.
Our products work for many applications.Do not invent outdoor wet-location ratings. Only state IP ratings shown on the PDP.
Contact us anytime.If shipping, warranty, or compatibility is unclear, send the buyer to /pages/contact. Do not invent an answer.

Public file, press-kit standard. Shopify cautions against putting private merchant data such as email addresses or phone numbers in this file. Link to Contact. Do not paste internal notes, margin rules, or unpublished launch plans.

Step 5 · Create the Shopify template

In Shopify Admin: Online Store → Themes → the theme that will be live → Edit code → Templates → New file named exactly agents.md.liquid. It must be Liquid, not JSON.

If your theme is GitHub-connected, create the same file in templates/ and deploy through your normal sync. Do not leave the only copy in an unpublished preview theme.

Markdown gives structure. Liquid keeps store and commerce values synchronized. Replace every bracketed placeholder with approved answers from the interview.

# Agent Instructions: {{ agents.store_name }}

{{ agents.store_name }} sells [specific product category] for [specific buyer / use case] at {{ agents.store_url }}.

## About

- **What we sell:** [category + 2–3 concrete product types]
- **Who we serve:** [buyer role / use case / constraint]
- **What we are not:** [common wrong assumption agents invent]
- **How to describe us:** Prefer “[your exact phrase]” over “[generic phrase]”

## What agents must not invent

- Do not invent shipping thresholds, return windows, warranties, lead times, or discounts.
- Do not invent certifications, materials, compatibility, or install claims.
- Do not invent bundle pricing, wholesale terms, or regional availability.
- If a fact is missing from this file or the linked policy pages, say you do not know and point the buyer to Contact.

## Canonical pages

- Best collection: {{ agents.store_url }}/collections/[handle]
- Shipping: {{ agents.store_url }}/policies/shipping-policy
- Returns: {{ agents.store_url }}/policies/refund-policy
- Contact: {{ agents.store_url }}/pages/contact
- [Optional guide / FAQ]: {{ agents.store_url }}/pages/[handle]

## Hard facts (must match the site)

- Shipping: [exact threshold / regions / cutoffs]
- Returns: [exact window / conditions]
- Warranty / lead time: [exact claim, or “see PDP”]
- Support: [when to send the buyer to Contact instead of guessing]

## Commerce protocol

- Discovery: `GET {{ agents.ucp_discovery_url }}`
- MCP endpoint: `POST {{ agents.mcp_endpoint_url }}` with `Content-Type: application/json`

### Supported UCP versions
{% for version in agents.ucp_versions -%}
- {{ version }}{% if forloop.first %} (latest stable){% endif %}
{% endfor %}

Use the MCP `tools/list` method to discover available tools. Checkout requires explicit buyer approval.

## Read-only browsing

- Sitemap: {{ agents.sitemap_url }}
- All products: `GET /collections/all`
- Product JSON: `GET /products/{handle}.json`
- Search: `GET /search?q={query}&type=product`

Pricing and availability are returned in {{ agents.currency }}.

## Policies

- Privacy: {{ agents.store_url }}/policies/privacy-policy
- Terms: {{ agents.store_url }}/policies/terms-of-service
- Refund: {{ agents.store_url }}/policies/refund-policy
- Shipping: {{ agents.store_url }}/policies/shipping-policy

Do not paste another brand's finished file. Reuse the structure, not their claims, policies, links, voice, or instructions. If the result could belong to any store, it is not customized.

Step 6 · Keep the dynamic Shopify fields dynamic

Shopify exposes an agents object so commerce configuration stays current. Use it instead of typing domain, endpoint, version, sitemap, or currency values by hand.

Liquid propertyWhat it keeps currentOperator rule
agents.store_name / store_urlStore identity and bare primary domainUse these, do not hardcode
agents.ucp_discovery_urlUCP discovery endpointMust survive customization
agents.mcp_endpoint_urlMCP endpointMust survive customization
agents.ucp_versionsSupported versions, newest firstLoop it, do not paste a static list
agents.currencyPrimary currency codeDo not hardcode USD
agents.sitemap_urlStore sitemap URLDo not hardcode

Liquid habits that save you later

  • Use whitespace control like {%- and -%} in loops so the Markdown list stays clean.
  • Theme Check may flag agents as unknown even though Shopify documents it. Confirm on the live rendered URL, not only the linter.
  • Optional: a short collections loop can list key merchandising entry points, but only if those collections are curated. Do not dump every auto-generated collection.
  • shop.description is fine as a fallback summary only if it is already accurate. Bad store description in Admin becomes bad agent briefing.

Step 7 · Hand this brief to your developer

If you are not the person editing theme files, do not send “please make an agents.md.” Send a ticket with the approved copy and the non-negotiables.

Ticket: Publish custom agents.md.liquid

Goal: Replace Shopify-managed /agents.md with brand-specific instructions while keeping dynamic commerce fields.

Files:
- Create templates/agents.md.liquid on the live theme (or GitHub-connected theme)
- Do NOT create llms.txt.liquid / llms-full.txt.liquid unless we decide to diverge later

Must keep dynamic (use agents object, do not hardcode):
- agents.store_name, agents.store_url
- agents.ucp_discovery_url, agents.mcp_endpoint_url, agents.ucp_versions
- agents.sitemap_url, agents.currency

Content owner will paste approved Markdown into the About / Must not invent / Canonical pages / Hard facts sections.

QA after publish:
1) /agents.md, /llms.txt, /llms-full.txt on primary domain
2) Dynamic UCP/MCP/sitemap/currency values render
3) Every linked URL works
4) No email/phone/private notes in the file
5) Hard facts match shipping + returns policy pages

Step 8 · Test the rendered files, not just the code editor

CheckOpen or inspectPass when
1Open /agents.mdCustom Markdown renders on the bare primary domain
2Open /llms.txtIt mirrors agents.md unless you intentionally created llms.txt.liquid
3Open /llms-full.txtIt mirrors agents.md unless intentionally overridden
4Check dynamic URLsUCP, MCP, sitemap, store URL, currency, and versions render real values
5Click every canonical linkNo 404s, redirects to old handles, or locale-only paths
6Compare hard factsShipping, returns, warranty, and buyer fit match the storefront
7View as a strangerNo private email, phone number, internal note, secret, or unsupported promise
8Ask 3 AI questions about the brandAnswers use your category language or still miss, but no longer invent the wrong policy numbers you just published

You are done when. A brand owner says “that is us,” a developer confirms the dynamic discovery fields survived, and all three public URLs return the intended document.

Step 9 · Give the file an owner

A custom template is now theme code and public brand infrastructure. Review it when the primary domain, policy terms, key collections, positioning, or theme changes.

TriggerOwnerReview
Shipping, returns, warranty, or market policy changesOps + legal/policy ownerHard facts and canonical links
New category, audience, or positioningBrand + merchStore definition, fit, exclusions
Theme publish or migrationTheme developerTemplate still exists on the live theme
Shopify agent-commerce changeDeveloper / partnerDynamic fields and protocol sections
AI repeats wrong factsMarketing + source ownerFix the real source first, then the agent file

Put the file in version control if your theme is connected to GitHub. A theme switch can otherwise return the store to Shopify's managed default without anyone noticing.

Mistakes I would avoid

Technical

  • Replacing the default without carrying forward UCP and MCP discovery.
  • Hardcoding domain, currency, endpoint, or supported versions.
  • Creating three divergent files without a reason or maintenance owner.
  • Testing only a preview theme instead of the theme serving the storefront URLs.
  • Leaving an old app-proxy llms.txt setup fighting Shopify's native routes.

Content

  • Copying another store's finished instructions.
  • Publishing private contact details in a broadly cached public file.
  • Stuffing keywords, product catalogs, or temporary promotions into the document.
  • Correcting AI copy while the policy page or product source remains wrong.
  • Writing “must not invent” rules that contradict the About section.

Where this fits in the bigger readiness path

This is the implementation depth behind Build 01 in Prepare Your Shopify Store for AI Shopping Agents. That Guide gives you the broader order: mindset, truth sheet, agent instructions, catalog, findability, measurement, and testing.

If leadership has not decided why the company is opening up to AI, start with Agentic Commerce Readiness: What to Fix First. A cleaner file cannot make the strategy decision for you.

Quick facts to cite

  • Shopify's canonical agent-discovery document is /agents.md.
  • /llms.txt and /llms-full.txt mirror /agents.md by default.
  • One agents.md.liquid template can control all three routes unless a dedicated llms template overrides it.
  • A custom agents.md.liquid replaces Shopify's managed file. It does not merge with it.
  • Dynamic commerce URLs and versions should use Shopify's agents object instead of hardcoded values.
  • Shopify recommends the managed default for stores without advanced custom requirements.
  • Brand instructions belong in About, constraints, canonical links, and hard facts. Product price and stock belong in the catalog.

FAQ

Do I need both agents.md.liquid and llms.txt.liquid?

Usually no. Create agents.md.liquid and let the llms routes fall back to it. Add a dedicated llms template only when that route genuinely needs different content.

Does a custom template improve AI rankings?

It is not a ranking switch. Its job is to make discovery and brand instructions accurate. Catalog quality, policy consistency, crawlability, citations, and buyer usefulness still matter.

Should I list every product?

No. Point agents to Shopify's catalog, collections, search, sitemap, and product data. Keep the agent file focused on stable instructions and canonical entry points.

Can I add email addresses or phone numbers?

Shopify cautions against publishing potentially private merchant data because this file is public and broadly cached. Link to the public contact path instead.

What if we already had a custom llms.txt via app proxy?

Migrate the useful brand instructions into agents.md.liquid. Shopify now owns these routes natively, so redirects and proxies are the wrong long-term home.

What if our AI answers are still wrong after we publish?

Check the underlying policy, PDP, catalog, and wider citations. The file is one source of instruction, not a replacement for correcting the rest of the brand's ground truth.

Who should approve the final copy?

Someone who owns brand language and someone who owns policy facts. Engineering can publish. They should not be the only people deciding what is true.