Skip to main content

Build Trustworthy and Intuitive AI Experiences

Learning Objectives

After completing this unit, you’ll be able to:

  • Configure specific Slack Assistant methods to maintain user context and app status.
  • Design AI responses that incorporate trust signals like citations, disclaimers, and feedback loops.

Best Practices for AI-Enabled Apps

Successful AI-enabled apps in Slack rely on trust and consistent user experiences. This unit covers best practices for foundational setup, conversation management, content quality, and user interaction. Use these guidelines to meet user expectations and access the full agents and AI apps feature set. Many practices use Block Kit—refer to the Bolt documentation for Java, Python, or JavaScript for specific implementation details.

Foundational Setup

Centralize Configuration in the App Home

Use the App Home tab to provide a persistent, private space for users to manage preferences. This centralized interface reduces friction and ensures users always know where to customize their experience.

Implementation: To enable the Home Tab in your app settings, select Features and then select App Home. Refer to the App Home guide for customization.

Define App Availability and Entry Points

Clearly communicate where your app operates, such as in channels, DMs, or the split view. Use the App Home tab or onboarding messages to ensure users know how and where to interact with your app.

Implementation: Listen for app_mention events to support channel interactions and document these capabilities in App Home.

Protect Data Privacy and Security

Use the search:read.public scope to ensure your app only accesses public channel data where the user is a member. This permission-based approach maintains workspace security and aligns with enterprise compliance standards such as FedRAMP.

Implementation: Restrict search scopes to specific workspaces. Refer to the Data Access API guide for privacy best practices.

Note

AI-Enabled Apps and Prompt Injection

Integrating with AI carries an inherent risk of prompt injection. To protect against data exfiltration, review the security documentation.

Manage the Conversation Experience

Maintain Context with Dynamic Thread Titles

Update thread titles to reflect the current conversation topic and help users stay organized. Use the user’s initial message to set the starting title, then refresh it as the conversation evolves.

Implementation: Call assistant.threads.setTitle to set and update titles.

Increase Engagement with Relevant Prompts

Display dynamic suggestions based on the user’s profile or workspace data to encourage repeat use. Context-aware prompts build trust by providing relevant shortcuts that replace static, generic options.

Implementation: Use assistant.threads.setSuggestedPrompts and update prompts as the context shifts.

Simplify Interactions with Conversation History

Provide your AI agent with the full conversation history so users can reference previous exchanges naturally. This continuity ensures the agent understands the context without forcing the user to repeat information.

Implementation: Call conversations.replies with thread_ts to gather the necessary message history.

Build Trust with Real-Time Status Updates

Inform users during long-running tasks to prevent the assumption that the app is stuck or unresponsive. Frequent status updates manage user expectations and demonstrate that the app is actively working.

Implementation: Use assistant.threads.setStatus to provide progress updates.

Example: The following JSON defines how you format a status message to provide real-time feedback while your AI agent works behind the scenes.

status="is thinking..."
status="is searching company knowledge..."
status="spinning the digital hamster wheel..."

Increase Content Quality and Trust

Ensure Professional Formatting with Block Kit

Use the Block Kit Builder to maintain consistent message layouts and prevent rendering errors with rich text features, such as Slack mrkdwn. Since AI agents often default to standard markdown that Slack doesn’t support, use the Markdown Block to ensure your rich text displays correctly.

Build Transparency with Content Disclaimers

Label AI-generated responses clearly to set accurate expectations and build long-term user trust. A consistent disclaimer reminds users to verify information, which protects your brand and reduces liability; for example, “AI generated this content. Review it carefully before acting, as it might contain inaccuracies.”

Implementation: Add a context block to the footer of every AI-generated message. Check out this example in Block Kit Builder.

Example: The following JSON defines how to use a context block to label AI-generated content.

{
 "type": "context",
 "elements": [
   {
     "type": "mrkdwn",
     "text": "This tool uses AI to generate responses, so some information might be inaccurate."
   }
 ]
}

Validate Responses with Citations and References

Include direct sources for AI-generated content to prove accuracy and encourage deeper research. Use inline links for immediate context and list full references in a footer to provide a complete audit trail.

Implementation: Use link formatting to formatting inline citations and a context block for a bibliography at the end of the message.

Example: The following JSON defines how to cite a specific source at the end of a message.

{
   "type": "context",
   "elements": [
       {
           "type": "mrkdwn",
           "text": "Slack stands for ’Searchable Log of All Conversation and Knowledge.’ <https://app.slack.com/slackhelp/en-US/115004071768|[1 Help Center]>"
       }
   ]
}

Enhance User Interaction and Support

Influence Adoption with Clear Onboarding

Provide a welcome message with specific next steps—like login or account connection—to help first-time users get started. For repeat users, skip the introductory messaging to ensure a fast, efficient experience that respects their time.

Implementation: Use interactive buttons or links for required setup actions.

Example: The following JSON defines how to build an onboarding message that guides users to connect their accounts.

{
   "type": "rich_text",
   "block_id": "Vrzsu",
   "elements": [
       {
           "type": "rich_text_quote",
           "elements": [
               {
                   "type": "text",
                   "text": "It looks like you’re not logged into the TeamworkDreamwork app.\n Sign in now to use this feature."
               }
           ]
       }
   ]
},
{
   "type": "actions",
   "block_id": "actionblock789",
   "elements": [
       {
           "type": "button",
           "style": "primary",
           "text": {
               "type": "plain_text",
               "text": "Sign in"
           },
           "value": "sign_in_123"
       },
       {
           "type": "button",
           "style": "danger",
           "text": {
               "type": "plain_text",
               "text": "Ignore"
           }
       }
   ]
}

Reduce Friction with Prefilled Modals

Prepopulate modal fields with approximate data when capturing structured information from a user. This approach allows users to simply review and edit information rather than entering every detail manually.

Implementation: Use the initial_value or initial_options properties to prefill your modal fields.

Improve Model Performance with Feedback Collection

Allow users to rate response quality using interactive buttons or emoji reactions. Collecting written feedback for poor ratings provides the data you need to fine-tune your prompts and improve accuracy.

Implementation: Use buttons for ratings or subscribe to reaction_added events.

Maintain Trust with Graceful Error Handling

Send clear error messages and reset the app status immediately if a process fails. This prevents the user from waiting indefinitely and clarifies exactly why a request didn’t complete.

Implementation: Call assistant.threads.setStatus with an empty string to clear a status.

Manage Expectations for Media Support

Clearly define which media types your app supports to prevent user frustration. If a user uploads an unsupported format, suggest an alternative interaction.

Implementation: Use this guide to detect file types and trigger helpful support messages.

Recap

AI-enabled apps combine large language models with Slack’s collaborative messaging. By setting clear boundaries, maintaining context, citing sources, and handling errors gracefully, you build trustworthy experiences users rely on daily. These best practices ensure your app—whether extending an existing product or building Slack-first—delivers intelligent assistance where users work, creating native AI experiences that encourage adoption and improve productivity.

Resources

Partagez vos commentaires sur Trailhead dans l'aide Salesforce.

Nous aimerions connaître votre expérience avec Trailhead. Vous pouvez désormais accéder au nouveau formulaire de commentaires à tout moment depuis le site d'aide Salesforce.

En savoir plus Continuer à partager vos commentaires