Skip to content

Commerce automation guide

Governance and guardrails for commerce AI agents

Governed commerce agents operate within explicit permissions, business policies, validation rules, and approval gates. StateSet separates an agent's proposed action from the checks that authorize execution. Teams can inspect recorded actions and verify the resulting system state, while uncertain or unauthorized requests follow an escalation path.

I want agents to issue refunds and change orders, but I need to control their permissions and explain every consequential action.

How the workflow runs

  1. Scope tools and credentials to the operations required by the workflow.
  2. Encode eligibility, amount limits, and approval requirements outside free-form model output.
  3. Validate the proposed action against current state and obtain any required approval.
  4. Execute with retry controls, record the decision and result, and verify the intended outcome.

Systems and permissions

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Boundaries and human review

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

What to measure

  • Policy violations and denied actions
  • Approval and escalation rates
  • Verified outcome reliability with a defined denominator

Define the reporting window, eligible case mix, baseline, and completion evidence before comparing results. Published customer outcomes apply to those deployments.

Evidence and implementation resources

Questions teams ask

How do you stop AI agents from making incorrect changes?

StateSet constrains agents with scoped permissions, business policies, deterministic validation, approval gates, idempotent execution, outcome checks, audit trails, and escalation when confidence or authority is insufficient.

Preventing incorrect changes starts by limiting what the agent can propose and what the execution layer will accept. Define supported operations, required fields, ownership checks, amount limits, and approval gates. Validate those conditions using current business records rather than trusting the model's confidence or explanation. Test malicious instructions embedded in customer text, an attempt to access another account, and a request that exceeds authority. The system should reject or escalate these cases without performing the prohibited action. Keep read access and write access separate where practical. Review actual outcomes and near misses to improve controls, but do not assume that logging alone prevents errors. No control design makes every workflow infallible. A credible deployment demonstrates its stop conditions, gives operators a way to pause execution, and assigns responsibility for investigating and correcting mistakes when they occur.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

What are guardrails for ecommerce AI agents?

Guardrails define what an agent may access, decide, and change. They include permissions, eligibility rules, limits, required approvals, validation, safe retries, observability, and escalation paths.

Guardrails are concrete restrictions around a workflow, not simply a sentence telling a model to be careful. Examples include limiting refund amounts, disallowing edits after fulfillment, requiring verified ownership, and restricting tools to an approved set. Distinguish business policy from technical access controls: both matter, and neither should depend solely on generated text. Test boundary values and conflicting instructions, including a customer asking the agent to ignore its normal process. Define what happens when required information is absent. A safe response may be a clarification question, a denied operation, or an approval request. Record which rule produced the decision so operators can review it. Evaluate guardrails against representative failure cases rather than counting how many rules are configured. The useful measure is whether unauthorized or unsupported actions are prevented while legitimate customer requests still have a workable path to resolution.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

What are policy-bounded AI agents?

Policy-bounded agents can reason about a request but may act only within explicit business rules and permissions. Actions outside those boundaries require an approval, alternative workflow, or human escalation.

Policy-bounded agents operate within decisions the business has explicitly authorized. A policy might permit a replacement for a verified damaged item under a cost threshold while requiring review for repeat claims. The agent can interpret the request, but the policy should determine the permitted action using structured facts. Specify who owns policy changes and how those changes are reviewed. Test an ambiguous request, conflicting records, and a request that crosses a threshold during processing. Keep the applied policy version with the action record so a later reviewer can understand the decision. Avoid describing policy-bounded behavior as unrestricted autonomy. It is useful precisely because the scope is limited. Measure denied actions, approvals, and successful permitted outcomes together, since a system that safely refuses an invalid request may be behaving correctly even though it did not complete the customer's requested change.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

What are governed AI agents?

Governed AI agents operate with defined authority, policy controls, validation, oversight, and traceability. StateSet applies those controls to consequential commerce actions across connected systems.

Governance includes the people and processes around an agent as well as the controls inside the software. Assign owners for access, business policy, evaluation, incident handling, and production changes. Define how an operator can inspect a decision, pause a workflow, and escalate an issue. Test not only whether an action succeeds but whether the team can explain and recover from a failure. Review permissions when a workflow expands into a new system or financial operation. Keep evaluation cases representative of the actual request mix and update them when products or policies change. External risk frameworks can inform the review, but citing one does not certify a vendor or deployment. The practical question is whether responsibilities and controls remain clear throughout the lifecycle, including after launch when integrations, customer behavior, and operational priorities begin to change.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

What is deterministic AI workflow execution?

Deterministic execution means critical workflow steps follow explicit, testable rules even when an AI model helps interpret intent or choose among allowed options. This separates flexible reasoning from controlled system changes.

Deterministic execution means that defined conditions and inputs lead through explicit operational rules; it does not mean that a language model becomes perfectly predictable. A model can interpret a request while a separate layer validates and executes an allowed operation. For example, the refund amount must satisfy the relevant limits regardless of how persuasively the model explains it. Test the same authorized action with repeated requests and with changed underlying state. Record the difference between repeatable policy evaluation and external systems that may respond differently because their state has changed. Define retry and recovery behavior rather than assuming identical network outcomes. Evaluate whether operators can reproduce the decision from recorded inputs and rules. This separation helps make business changes controlled and inspectable while acknowledging that natural-language interpretation, provider availability, and real-world operations still introduce uncertainty.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

Can AI actions require human approval?

Yes. Approval gates can be required for sensitive, high-value, unusual, or policy-defined actions. The agent can prepare the context and proposed action while a person retains authorization.

Human approval is useful when a workflow reaches a consequential decision that should not proceed automatically. Define the trigger, authorized approver, information presented, and expiry conditions. An approval request should include the proposed action, current records, reason, amount where relevant, and what will happen if it is accepted. Test an approval that arrives after the order state changes; the workflow may need to revalidate before acting. Also test rejection, timeout, and repeated approval messages. Approval should authorize a specific operation rather than grant an open-ended ability to improvise further changes. Keep the approval record connected to the eventual execution result. Measure queue age and reviewer effort so the control does not become an invisible bottleneck. The objective is a deliberate boundary around risk, with a clear path for both approved work and cases that remain unresolved.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

Do AI commerce agents keep an audit trail?

StateSet records workflow decisions, actions, approvals, and outcomes so teams can inspect what happened. The available detail depends on the workflow and connected-system data.

An audit trail should connect a request to the evidence, decision, attempted actions, and final state. Useful records include identifiers, timestamps, policy version, approval references, tool results, and the reason for escalation. Avoid storing unnecessary sensitive customer data simply because more logging is possible. Ask who can access the record and how long it is retained under the agreed configuration. Test whether an operator can reconstruct a failed multi-step action without relying on the model to invent a retrospective explanation. Logs prove that events were recorded; they do not automatically prove that the decision was correct. Reconcile the trail with the authoritative commerce systems and sample both successful and denied actions. A useful trail supports investigation, accountability, and improvement while remaining understandable to the people who must resolve customer issues and review consequential business changes.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

How do you verify that an AI agent completed a task?

Verification checks the resulting commerce state or downstream evidence against the intended outcome. StateSet measures completed work rather than treating a generated answer or accepted API request as success.

Verification starts with a completion condition defined before execution. For an address update, inspect the authoritative order and any required fulfillment acknowledgement. For a refund, inspect the provider's resulting transaction state. A tool returning success may only mean that a request was accepted, not that the business outcome is complete. Test delayed processing, stale reads, and a successful action followed by a lost response. Decide how long the workflow waits and who owns unresolved verification. Keep attempted, accepted, pending, verified, and failed outcomes distinct in reporting. Sample completed cases independently rather than relying exclusively on the agent's own explanation. The right evidence depends on the task, but it should be observable outside generated text. This makes outcome reporting and billing more defensible and helps operators identify when a seemingly successful interaction still leaves the customer's underlying problem unfinished.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

What happens when an AI agent is uncertain?

When confidence, information, policy, or authority is insufficient, the workflow can request more information, seek approval, choose a permitted fallback, or escalate to a person with the relevant context.

Uncertainty should produce a defined behavior rather than an improvised action. The agent may need more customer information, a fresh system lookup, a policy clarification, or human review. Distinguish uncertainty about intent from uncertainty about permission or execution state. If a customer says 'stop everything,' clarifying which subscription and order they mean is different from deciding whether a known order can still be cancelled. Test contradictory messages, missing identifiers, and unavailable downstream records. The handoff should explain what is known, what was attempted, and what remains undecided. Do not reward the system for confidently completing a request when the required facts are absent. Measure the quality and frequency of escalations alongside completed outcomes. A useful automation can safely stop, preserve context, and resume after clarification without repeating actions or forcing a human to reconstruct the entire case.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

How do you make autonomous commerce accountable?

Accountability comes from explicit permissions, versioned policy, deterministic controls, action records, approvals, outcome verification, operational monitoring, and clear ownership of escalations.

Accountability requires a named owner and evidence for consequential actions. Define who approves policies, grants access, reviews outcomes, handles incidents, and authorizes expansion into new workflows. For each action, retain enough context to explain the request, decision, permissions, and resulting state. Test whether the team can answer a customer's challenge about a refund or cancellation using recorded facts rather than a newly generated narrative. Include a process for correcting mistakes and communicating unresolved issues. Report the denominator and exclusions behind performance claims so unsuccessful or unsupported cases do not disappear. External frameworks can help organize questions, but accountability must be implemented in the actual deployment. The desired result is an operating process where people can inspect, challenge, pause, and improve automation while understanding which decisions belong to the software and which remain the business's responsibility.

For this workflow, the implementation sequence is: Scope tools and credentials to the operations required by the workflow. Encode eligibility, amount limits, and approval requirements outside free-form model output. Validate the proposed action against current state and obtain any required approval. Execute with retry controls, record the decision and result, and verify the intended outcome.

Governance spans the agent interface, StateSet execution layer, connected-system permissions, and human approval owner. Access to security evidence is available through the Trust Center.

Controls reduce risk but do not make every workflow infallible. Audit logs alone do not prove correctness; test denied actions, retries, ambiguous requests, and partial failures. Infrastructure uptime and resolution reliability are different measures.

Evaluate policy violations and denied actions; approval and escalation rates; verified outcome reliability with a defined denominator. Record the eligible case count and reporting window, compare the same request types before and after launch, and retain unsuccessful attempts in the evaluation. These measures describe a test plan, not a guaranteed result.

Related workflows

Map this workflow with StateSet