commerce-trust-safety
Skill3.2k starsChanged 3 months agoApache-2.0View on GitHub
The rules the reference agents enforce in code for third-party content, writes, grounding, identity, and memory, each with its module, plus two adversarial-eval rules. Load when handling untrusted tool results, guarding a write tool, or scoping what an agent remembers.
Trending
Quiet since September.about the whole repository
Who's talking about anthropics/commerce-agents
- A Hacker News story“Anthropic commerce agent: open-source blueprint for shopping and merchant agents”Hacker News · Sep 10, 2026 · 3 points
- A Hacker News story“Commerce Agents: Reference blueprint for building shopping and merchant agents”Hacker News · Sep 2, 2026 · 3 points
- @anthropicai.xmirror.bot“Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical …”Bluesky · Sep 2, 2026 · 3 likes
- @greg-harvey.tooting.ch.ap.brid.gy“Anthropic: "Hey, we do open source stuff too!" https://github.com/anthropics/commerce-agents Me: "Folks, …”Bluesky · Sep 16, 2026 · 2 likes
- ProSkillsMD/proskills“[Candidate] anthropics/commerce-agents/shopping-agent/skills/search-discovery - search-discovery”GitHub · Sep 28, 2026
The biggest 5 of 29 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 29
Talked about on GitHub, Bluesky and Hacker News (29 times).
On GitHub · 23
- Sep 28, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/search-discovery - search-discovery — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/purchase-research - purchase-research — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/planning-goals - planning-goals — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/memory-personalization - memory-personalization — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/shopping-agent/skills/customer-care - customer-care — ProSkillsMD/proskills0 reactions · 2 comments
18 more on GitHub
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/pricing-promotions - pricing-promotions — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/performance-insights - performance-insights — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/marketing-campaigns - marketing-campaigns — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/inventory-operations - inventory-operations — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] anthropics/commerce-agents/merchant-agent/skills/catalog-listings - catalog-listings — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 13, 2026fix(81rv10): ground demo in commerce-agents import — huijoohwee/agentic-graph0 reactions · 1 comment
- Sep 12, 2026[新規記事候補] Claude Commerce Agents Blueprint — quintessence-lab/mdTechKnowledge0 reactions · 1 comment
- Sep 10, 2026[mdKnowledge更新候補] 2026-09-11 — quintessence-lab/mdTechKnowledge0 reactions · 2 comments
- Sep 3, 2026📰 Hacker News AI 社区动态日报 2026-09-03 — 96loveslife/big_model_radar0 reactions
- Sep 2, 2026APRV-241: commerce agents blueprint declined in the integrations register — approval-md/approval.md0 reactions
- Sep 2, 2026Add a generic application and workspace-agent builder — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Define a provider-neutral memory policy and reference runtime — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add cross-surface semantic parity contracts for workspace agent packages — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add a provenance-gated staged-action reference agent — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Add an optional trust and sanitization boundary for tool results — tyxter-dev/blackbox0 reactions
- Sep 2, 2026Enforce WorkspaceAgentSpec tool permissions at runtime — tyxter-dev/blackbox0 reactions · 1 comment
- Sep 2, 2026Commerce agents: wire the blueprint evals into ork:testing-llm — yonatangross/orchestkitsays it tested it0 reactions
- Sep 2, 2026Commerce agents: skill wrapping the blueprint's shopping and merchant harness for client sites — yonatangross/orchestkit0 reactions
On Bluesky · 4
- Sep 2, 2026Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical demos, and a Claude Code plugin… — @anthropicai.xmirror.bot3 likes and reposts · 1 reply
- Sep 16, 2026Anthropic: "Hey, we do open source stuff too!" https://github.com/anthropics/commerce-agents Me: "Folks, open sourcing your agents is like… — @greg-harvey.tooting.ch.ap.brid.gy2 likes and reposts
- Sep 6, 2026anthropics/commerce-agents Anthropic published a reference implementation for Claude-powered commerce agents. Shopping flows, merchant… — @githubprojects.bsky.social0 likes and reposts · 1 reply
- Sep 2, 2026Also, see our open-source reference implementation. This includes shopping & merchant agents, four vertical demos, and a Claude Code plugin… — @claudedevs-mirr.selfhosted.social0 likes and reposts · 1 reply
On Hacker News · 2
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- catalog-listingsSkill
- inventory-operationsSkill
- marketing-campaignsSkill
- performance-insightsSkill
- pricing-promotionsSkill
- commerce-architectureSkill
- commerce-evalsSkill
- commerce-merchant-operationsSkill
- commerce-prompt-cachingSkill
- commerce-ui-toolsSkill
- customer-careSkill
- memory-personalizationSkill
- planning-goalsSkill
- purchase-researchSkill
- search-discoverySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Every tool result from catalog, review, policy, order, metric, message, or web content goes through Fence.fence_payload …
- Very specific: line 65
Every fact on both write paths (save_memory and post-turn extraction) passes validate_fact in commerce_common/memory.py: key of at most 64 …
- Distinctive: line 89
Every refusal case has a should-serve counterpart in the same niche, so a suite catches over-refusal too (commerce-evals).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Trust and safety rules
commerce_common/ is commerce-common/commerce_common/, shopping_agent/ is shopping-agent/core/shopping_agent/, and
merchant_agent/ is merchant-agent/core/merchant_agent/; docs/safety.md lists the same rules. A rule inside a tool
call holds on all three paths, which share one executor (commerce-architecture); rules 10 and 15 name the paths they run
on. Merchant staging, guardrails, approval, and marketplace posture are in commerce-merchant-operations.
Fence third-party content
- Every tool result from catalog, review, policy, order, metric, message, or web content goes through
Fence.fence_payload(commerce_common/fencing.py): NFKC-normalized, invisible and control characters removed, fence markers, forged turn markers, and special tokens replaced, wrapped in the role's label, and cut atmax_fenced_chars. The executor's_fencedapplies it to every handler. - The label and the notice are per-role constants (
STOREFRONT_FENCEinshopping_agent/fencing.py,MERCHANT_FENCEinmerchant_agent/fencing.py); the notice appears once, in the static prompt, with nothing untrusted in it. - The per-request block (profile, cart, memory facts, page, store context) sits inside the same fence after the cache
breakpoint (
build_dynamic_contextin each role'sprompt.py); backend context blocks have their own cap. - A model-supplied result count is clamped to
max_search_results(clamp_limitincommerce_common/execution.py).
Gate writes on provenance and caps
- A cart write accepts only ids in
ShoppingSessionState.seen_products, filled by the session's catalog and order reads (check_provenanceandremember_order_itemsinshopping_agent/gates.py); update and remove also accept a line already in the cart. Merchant staging accepts only ids inseen_listingsandread_listings, apply and discard only ids inseen_changes(merchant_agent/gates.py; commerce-merchant-operations). max_quantity_per_itemcaps the line after the write andmax_cart_linesthe cart, under a session lock (gated_add_to_cartinshopping_agent/gates.py; caps inshopping_agent/config.py). The lock is per process, soStorefrontBackendcart methods enforce them too; eligibility, pricing, and inventory are the backend's in both roles.- Nothing in either interface charges or places an order:
checkoutrenders the cart (enrich_checkoutinshopping_agent/enrichment.py) and the host completes it; post-purchase care is reads, with no cancel or refund tool. - Provenance lives on the session state (
ShoppingSessionState,MerchantSessionState), saved with the session when the request or turn ends (SessionStoreinexamples/demo_common/sessions.py, a versioned state document beside the transcript), so a request on another process loads it. Each map keeps its newestPROVENANCE_CAPrecords (rememberincommerce_common/types.py); a dropped id needs a fresh read. - A component is validated, its products, orders, metrics, or changes are joined from those records, and ids without
provenance are dropped and reported (
run_presentationincommerce_common/presentation.py; each role'senrichment.py; commerce-ui-tools).
Ground the answers that are figures or terms
- A terms question, an order question, or an unseen product id (
GROUNDING_RULESinshopping_agent/grounding.py), or a performance question or an apply request with nothing staged (merchant_agent/grounding.py), starts from the matching read:first_forced_toolincommerce_common/grounding.pypicks it, the Messages API runtimes force it withtool_choice, and the SDK runtimes prefetch it when the rule has a prefetch form (groundincommerce_common/agent_sdk.py; the terms rule has none); the hosted path has the prompt only. - The lexicons are config tuples (
policy_intent_terms,order_intent_terms,product_id_patterns,metrics_intent_terms, and their cues); a deployment appends its own words, a gate flag turns a rule off, and neither changes prompt bytes.
Hold identity on the server
- Session start binds the authenticated principal to an unguessable session id; later requests carry only that id, and
routes read the principal from the record (
SessionStore.startandsession_dependencyinexamples/demo_common/sessions.py). No request field or tool argument names a user, merchant, or operator; the MCP servers take the principal from their environment, a production server from its request. - Whether the principal owns a record (order, ticket, listing), and whether the step a call depends on has happened, is the backend's check against its store; an id having provenance does not make it theirs or ready.
Bound what is remembered
- Every fact on both write paths (
save_memoryand post-turn extraction) passesvalidate_factincommerce_common/memory.py: key of at most 64 characters, value of at most 200, one of the threeMemoryCategoryvalues, and theMemoryWriteFilter, which refuses identifier-shaped values by default;memory_blocked_patternsadds patterns, and a filter withchecksreplaces it (MemoryRuntime.build). - Extraction reads the last exchange's user and assistant text (
transcript_textincommerce_common/turn.py), andextract_and_storedrops its batch when the subject was purged meanwhile; the Messages API runtimes run it (update_memory), the SDK host calls the runtime, and the hosted path writes throughsave_memoryonly. memory_retention_days(with_retention),MemoryStore.delete_fact,MemoryStore.clear, andenable_memoryhold on every path without changing prompt or tool bytes; the examples expose read and delete routes (install_memory_routesinexamples/demo_common/memory.py), andclearbelongs in account deletion.- The subject is the shopper's
user_idor the operation'smerchant_id(memory_subjectin each role'sexecutor.py).
Refuse in the result, and keep the surface fixed
- A held call returns a normal result naming its gate (
ToolOutcome.heldincommerce_common/streaming.py; the host'stool_resultevent carriesstatus: blocked), a failure returns an error result, andexecutenever raises. - The tool list is a function of the config:
enable_web_search(default off) adds the tool, the SDK runtimes allow-list the registered names, and the manifests enable tools one by one. - The reference MCP servers bind to loopback unless an environment variable states that an authenticating gateway is in
front (
enforce_local_only_bindincommerce_common/mcp_server.py).
Two rules for adversarial evals
- Poisoned listings, reviews, and messages live in eval fixtures merged in for a run, outside demo and catalog data.
- Every refusal case has a should-serve counterpart in the same niche, so a suite catches over-refusal too (commerce-evals).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

