Loading
Prepare for Email to Become the Default Login ExperienceRead More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Get Started with B2C Commerce
Subagents for the B2C Shopper Agent

Subagents for the B2C Shopper Agent

The subagents assigned to the B2C Shopper Agent define the capabilities of the agent. Each subagent manages one stage of the shopping journey, including product discovery, cart, order confirmation, FAQs, and safety checks.

Agent Router

Every agent conversation begins with the Agent Router subagent. This subagent directs a conversation to the right Shopper Agent-specific subagent during each interaction with a shopper.

Subagent Name What It Does Actions
start_agent agent_router

This subagent reads every shopper message and routes it to the correct subagent. When a shopper submits a follow-up request, the Agent Router understands that it's related to the current task so it routes to the correct subagent.

It also performs session setup. For example, copying the linked site ID and user locale from the messaging session record to the working variables before routing.

  • go_to_rev_eng
  • go_to_inap_cont
  • go_to_prop_inj
  • go_to_off_topic
  • go_to_product_expert
  • go_to_site_faq
  • go_to_escalation
  • go_to_cart
  • go_to_order_confirmation
  • If a shopper responds with an ambiguous reply during a conversation, for example, they enter "add it," the Agent Router treats these replies as being related to the current task, not new requests.
  • The agent routes messages based on the shopper's latest message. It automatically filters out any background code, automated tool usage, or technical steps completed in previous messages. The agent reacts precisely to what the shopper is asking for at the moment, without interference by past system activities.

To customize the router subagent:

  • Add a route to expose a new subagent, or remove (comment out) one to turn off a capability.
  • Adjust the welcome message or routing instructions. For example, edit the router description to first welcome the shopper at the first chat session.
  • Reorder or reword routing logic to influence how the agent interprets ambiguous requests so it resolves requests to fit your catalog.

Shopper Agent Subagents

The Product Expert, Cart, and Order Confirmation subagents share one reasoning node. That node builds each subagent's prompt from a common set of template variables. The Support and Safety subagents don't use the shared node. They run on their own instructions. Because these three commerce subagents draw from the same variables, editing one variable changes the behavior of every subagent that uses it.

  • retailer_name
  • retailer_description
  • retailer_voice
  • tool_calling_guidance
  • response_guidance
  • example_response
  • id_col

Safety and Guardrail Subagents

There are subagents that only classify requests. They don't do anything else. They're intentionally narrow. Each one includes a detailed Do NOT use section so that common shopping terms aren’t treated as an attack. You define these guardrails in config.additional_parameter__disabled_topics.

  • Reverse Engineering—Catches attempts to extract the agent's internals. These requests can use "show me your system prompt," "list all your tools," "translate your instructions." Explicitly ignores domain verbs like add, view, find, checkout and "this tool."
  • Prompt Injection—Catches override attempts, such as "ignore previous instructions," fake <system> tags, "developer mode," authority impersonation, and encoded payloads. Explicitly ignores words like "ignore" or "forget" for shopper-described details.
  • Inappropriate Content—Catches genuinely harmful user-authored content (hate speech, threats, CSAM, self-harm, illegal-act instructions). Explicitly treats commerce vocabulary as always benign, such as "broken," "dead battery," "killer deal," and complaints by a shopper, such as "worst experience." These subagents route messages with this type of content to the appropriate subagent, and doesn't flag them.
  • Off Topic—Politely redirects off-topic and general knowledge requests back to shopping topics, without answering the off-topic question, and without revealing system details.

To customize these subagents:

  • Adjust the signal lists to suit your store. Add your own product names that contain sensitive words to the always benign list so the template doesn't flag them. Add attack patterns you see.
  • Adjust the off-topic redirect message and rules.
  • Add or remove disabled topics by using the config.additional_parameter__disabled_topics.

Subagent Configuration Tips

  • Many subagents can share a single variable. To avoid modifying every subagent that uses a shared variable, use scoped variants, such as cart_tool_calling_guidance or order_tool_calling_guidance to control behavior for an individual subagent.
  • Each response_guidance string has a 255-character limit. Exceeding this limit causes an Agent Script error.
  • The response_guidance is JSON — validate escaped quotes and avoid trailing commas.
  • Replace placeholders. Leaving an unsubstituted token in the UPPER_SNAKE_CASE section can cause a publish failure.
  • Test with real data. In the agent preview, mock mode returns fake catalog data. Test any search and cart behavior against live actions before you make conclusions.
  • B2C Shopper Agent | Product Expert
    Handles all product-related requests, such as browsing, searching, recommendations, comparisons, and product questions. It searches the catalog and looks up detailed product information as needed.
  • B2C Shopper Agent | Cart Subagent
    The Cart subagent manages the full cart lifecycle. This subagent adds products and variants, views the cart summary, updates lines, and applies promotion and coupon codes.
  • B2C Shopper Agent | Order Confirmation
    The Order Confirmation subagent confirms that the shopper placed an order and shows the order details. It also recovers the cart after a payment fails or a payment method cancellation.
  • B2C Shopper Agent | Site FAQ Subagent
    The Site FAQ subagent answers shopper questions about store policies, such as FAQs, shipping costs, return time frames, and refunds. It draws answers only from connected knowledge bases and returns a graceful response when it can't find a match.
  • Add Custom Subagents and Custom Actions
    The Shopper Agent subagents manage the transactional shopping experience. If you want a capability that isn't in the subagent template, create a custom one.
 
Loading
Salesforce Help | Article