Skip to main content

Best Practices for AI Agent Actions

AI Agent Actions enable instant access to third-party data, allowing personalized responses without human intervention. To ensure optimal performance and appropriate use, follow these best practices.


Writing Effective Action Descriptions

A well-written When to use description is crucial. Use 2-4 sentences to clearly define when the AI Agent should trigger an action. Be specific and include:

  • Examples of customer queries that match this action.
  • Key phrases customers might use.
  • Common scenarios where this action is applicable.

Examples of Strong Descriptions

Be Descriptive

Good ExampleUse this action to retrieve customer order details and assist with troubleshooting order-related issues. It provides information such as order status, purchased items, shipping address, tracking details, and other relevant data.
Poor ExampleUse this action to get information about their order.

Avoid Pronouns

Replace pronouns like "we," "us," and "their" with specific proper nouns.

Good ExampleUse this action to look up a customer’s electricity usage with Examply.
Poor ExampleUse this action to look up their electricity usage with us.

Be Specific

Clearly define scenarios where the action applies.

Good ExampleUse this action to look up unresolved incidents, including when customers ask about the incident start time, current status, affected services, or system performance.
Poor ExampleUse this action to look up unresolved incidents.

Include Customer Phrases

Identify keywords and phrases from past customer queries.

Good ExampleLook for phrases like “failed order,” “issue with orders,” “orders not appearing in the system,” or “difficulty with order.”
Poor ExampleNot including key customer phrases.

Choosing the Right API Endpoint

Selecting the correct API endpoint is essential for retrieving accurate customer data, whether from a third-party app or an internal system.

Guidelines for Selecting an API Endpoint

  • Consult an engineer if unsure which API provides the required data.
  • Use an API that accesses data with a unique identifier, such as an ID or email.
  • If multiple results exist for a customer name or email, refine the request (e.g., include the order date).
  • Minimize data retrieval—request only what’s necessary (e.g., a Order ID instead of multiple data points).

To collect an Order ID, AI Agent can prompt the customer for this input, inserting it into the API request automatically. Access the input field by hovering over the menu at the end of the URL input box.

Variable AI Agent integration

Using Multiple API Endpoints

If customer data spans multiple endpoints, consider creating additional actions to fetch related information (e.g., product availability and shipping details for an order modification request).

By following these best practices, you can ensure AI Agent Actions provide relevant, accurate, and seamless customer support.

Risks and Mitigations for Parameter Passing

There are potential risks associated with parameter passing in AI Agent Actions that could result in unauthorized data access. Below is a table outlining the risks and best practices to mitigate them.

Use CaseRiskBest Practice to Mitigate
AI Agent retrieves personalized data based on a value provided by the customer.A bad actor could provide an unauthorized value to access restricted data.Perform access control checks on the API server side to verify the user’s permissions before providing data.
AI Agent retrieves personalized data based on a value it collected.AI Agent may hallucinate a value and retrieve incorrect data for another user.While this risk is low, it is recommended to perform access control checks on the API server side to verify the user’s permissions before providing data.

Implementing these best practices ensures the security and integrity of customer data while using AI Agent Actions.