Salesforce Decode
Salesforcedecode
Back to questions
LWCExpertagentforceeinsteinhuman-in-the-loop

Design LWC contract for AI-generated UI suggestions with human approval

Real World Scenario

Agentforce suggests next-best action configurations rendered in LWC; reps must approve before any field update applies to customer records.

Expected Answer

• Separate suggestion display from commit action — explicit Approve/Reject buttons • Show diff of proposed changes vs current record state • Never auto-apply Agent output without authenticated user confirmation • Log suggestion Id, model version, and approver for audit • Timeout suggestions stale after data changes via wire refresh • Handle partial apply when multi-field suggestion and one field fails validation • Graceful UX when Agent unavailable — manual workflow unchanged

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: Separate suggestion display from commit action — explicit Approve/Reject buttons Also consider: Show diff of proposed changes vs current record state In practice: Never auto-apply Agent output without authenticated user confirmation Validate against production-scale constraints and long-term platform evolution.

Architect Perspective

Human-in-the-loop is compliance and trust — architect Agent+LWC boundary before automating customer data.