Use Twilio-authored language operators
Twilio-authored language operators are pre-built GenAI operators that simplify adding AI-powered intelligence to your communications workflows. They are optimized for scale, latency, and accuracy, and can be triggered in real time or at a defined point in the conversation across channels, including Voice, SMS, WhatsApp, RCS, and Chat.
A trigger determines when your rule and its attached language operators run during the conversation lifecycle. For more information, see available triggers and on-demand rule execution.
Operator ID: intelligence_operator_01kf34tcyefpyb1t4m0nbd8rxg
The Script Adherence operator helps customer care centers shift from post-call Quality Management (QM) to in-the-moment course correction. It provides agents with real-time guidance during active conversations to help them stay compliant.
- Language guidance: Ensure agents use required language and avoid prohibited language during interactions.
- Upsell: Encourage agents to deliver offer and value messaging when it's relevant.
- Faster onboarding: Onboard new agents quickly with live guidance.
To configure the Script Adherence operator, add your script when configuring the operator. Each script uses the following format:
- Category: The name of the stage. For example, Greeting, Verification, or Closing.
- Criteria: One or more criteria under each category, each formatted as a dash, a unique criteria key, a colon, and a description.
Required phrases and false positives
The GPT-5.4-mini model evaluates general adherence rather than exact phrase matching. When you specify "Required Phrases", the model might mark the category as succeeded even if the agent didn't use the exact wording, which can result in false positives.
Learn more about writing effective criteria in Script Adherence best practices.
1Category: introduction2- introduction: The agent should identify themselves by first name. Required Phrase: Thank you for calling Owl Health, this is [Agent Name].34Category: assistance5- offer_assistance: The agent should offer assistance or ask how they could help.67Category: security8- security_justification: The agent should clearly explain the need to verify the caller's identity before discussing account details.9- security_full_name: The agent should request the member's full name as it appears on the account. Required Phrase: May I confirm your first and last name as it appears on the account?10- security_additional_information: The agent should request at least one additional required identifier (e.g. date of birth, member ID, or address).1112Category: protected_data13- phi: The agent should avoid disclosing PHI prior to completing verification.1415Category: diligence16- call_reason_confirmation: The agent should restate or confirm the caller's reason for calling. Required Phrase: Just to confirm, you're calling about [issue], is that correct?17- specify_disclaimers: The agent should provide required disclaimers when discussing benefits, coverage, or eligibility. Required Phrase: Benefits are subject to eligibility and plan provisions at the time services are rendered.18- payment_or_coverage_guarantees: The agent should avoid guaranteeing payment or coverage when discussing claims or coverage.1920Category: wrap_up21- clear_timelines_or_next_steps: The agent should set clear expectations for timelines or next steps, if applicable.22- closing_recap: The agent should recap actions taken and use the customer's name while closing out.
The Script Adherence operator evaluates the transcript against the criteria and outputs a JSON object. The JSON object contains a single categories array property. The categories array contains a set of items with two properties; a category_key property and a criteria property. The category_key property is a string containing the name of a category; this name is taken from the provided script. The criteria property is an array containing criteria items. A criteria item contains a criteria_key and a criteria_met property. The criteria_key is the criteria key specified in the script. The criteria_met property is a string containing a value indicating if the criteria was met or not. A criteria_met key will always have a value of either Succeeded or Failed.
1{2"categories": [3{4"category_key": "introduction",5"criteria": [6{7"criteria_key": "introduction",8"criteria_met": "Succeeded"9}10]11},12{13"category_key": "assistance",14"criteria": [15{16"criteria_key": "offer_assistance",17"criteria_met": "Failed"18}19]20},21{22"category_key": "security",23"criteria": [24{25"criteria_key": "security_justification",26"criteria_met": "Succeeded"27},28{29"criteria_key": "security_full_name",30"criteria_met": "Failed"31},32{33"criteria_key": "security_additional_information",34"criteria_met": "Failed"35}36]37},38...39]40}
Each output response has a maximum limit of 8,800 characters. When designing complex script adherence, we recommend streamlining your requirements to avoid exceeding this threshold. Learn more about schema guidelines.
Each category and criterion you add when designing your Script Adherence operator increase the number of output characters in the generated response. To reduce output length, limit the number of Categories and Criteria, and use simple, descriptive values for Category names and Criteria keys. Use common words or standard abbreviations, and avoid obscure code words. For example, for an agent introduction criterion key, use intro instead of agent_int.
Operator ID: intelligence_operator_01kea27sy7ffsafmtsfp17nzx4
The NBR operator acts as a live co-pilot for agents, analyzing the conversation in real time and recommending the most effective next message or action based on your business rules and knowledge. This can help agents respond faster and improve First Call Resolution (FCR).
- Shorter handle time: Suggest ready-to-send responses and next steps.
- Consistent tone and policy: Keep tone and policy aligned across teams with standardized, approved guidance.
- Accurate information: Surface the most relevant knowledge article or procedure to prevent misinformation and rework.
The operator synthesizes three data streams to generate recommendations:
- Live Conversation: Captures real-time context and intent from the active transcript.
- Enterprise Knowledge: Cross-references the conversation with your uploaded company manuals, FAQs, and policies.
- Customer Memory: Uses historical interaction data and customer profiles to personalize the response.
- Tone customization: Define a custom tone for responses (for example, "professional" or "friendly") to match your brand.
- Performance optimization: The NBR operator uses the GPT-5.4-mini model and limits each generation to one knowledge base lookup (tool call), targeting sub-3-second real-time latency.
- Grounded responses (AI guardrails): Suggestions are derived only from the provided Enterprise Knowledge and Customer Memory. If no relevant context is found, the operator suppresses the response rather than hallucinating. Responses maintain a professional tone without flowery or redundant AI prose.
Operator ID: intelligence_operator_01kcv35pnkeysaf6z6cqtbpegn
The Summary operator generates concise summaries of customer interactions. The Summary operator uses GPT-4o-mini.
- After-call summary: Generate summaries for agents to review after each call.
- Case note: Create case notes for Customer Relationship Management (CRM) systems.
- Handoffs: Help smooth transitions between agents or departments.
- Audit: Ensure compliance and quality control.
You can configure the Summary operator based on your use case and needs. For example, you can specify the level of detail, the format of the summary, or when the summary should be generated.
You can set the summary length to:
shortmedium(default, 3-5 sentences)long
You can specify a structural format for the summary, such as bullet points, STAR (Situation, Task, Action, Result), or SOAP notes for medical contexts.
Operator ID: intelligence_operator_01kcrvw16kfa88qvgrfmr7y151
The Sentiment operator evaluates the sentiment of the conversation.
Note: The Sentiment operator doesn't analyze a specific participant of the conversation.
positive: The sentiment of the conversation was positive.negative: The sentiment of the conversation was negative.neutral: The sentiment of the conversation was neutral.mixed: There was more than one sentiment detected during the conversation.
Public beta
Task Completion and Hallucination Detection operators are currently in public beta and the information contained in this document is subject to change. Some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Task Completion and Hallucination Detection operators are not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
Operator ID: intelligence_operator_04aesmz370ev5vz77jed2vec1k
The Task Completion operator evaluates whether an agent completed the customer's task. It runs when the conversation ends and returns a label with a one-sentence reason. While this operator's primary purpose is to measure the effectiveness of AI agents, this can also be used to measure if human agents were able to solve the customer's problem without having to escalate.
- Measure self-service containment: Track how many conversations your AI agent resolved without a human and how many were escalated.
- Agent effectiveness: Find the conversations where customers didn't get what they needed.
- Track agent compliance: Track conversations where the agent declined to answer the customer's question due to compliance or guardrails.
For a detailed guide on supervising AI agents with Task Completion and Hallucination Detection, see Supervise AI agents.
The operator reads the full conversation and identifies the customer's primary stated goal from their opening turns. It then reads the customer's reaction to the agent's response. The operator returns a label and a one-sentence reason that cites the moment that drove the label.
The operator evaluates the primary task in the conversation and ignores follow-up tasks. If the customer's intent is too vague to evaluate, the operator returns UNRESOLVED.
The operator returns a label and a reason.
label | Description |
|---|---|
RESOLVED | The agent addressed the customer's task, with the customer confirming resolution explicitly or implicitly. |
UNRESOLVED | The agent didn't address the task and the conversation ended without resolution. |
ESCALATED | The conversation was handed off to a human. |
AGENT_DECLINED | The agent deliberately refused because of a policy, compliance, or scope guardrail. |
1{2"label": "RESOLVED",3"reason": "Customer confirmed 'perfect, thank you' after agent reset the password successfully"4}
- The
reasonfield is free text. You can't filter on it in Conversation Insights. - If your agent gives a vague or unhelpful answer to an out-of-scope request instead of declining it, the operator returns
UNRESOLVED, because it can't distinguish that from a genuine failure. Design your agent to decline out-of-scope requests explicitly so they returnAGENT_DECLINED.
Public beta
Task Completion and Hallucination Detection operators are currently in public beta and the information contained in this document is subject to change. Some features are not yet implemented and others may be changed before the product is declared as generally available. Public beta products are not covered by the Twilio Support Terms or Twilio Service Level Agreement.
Task Completion and Hallucination Detection operators are not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
Operator ID: intelligence_operator_01m4wvhe37ebarkr9wbhy2w3n4
The Hallucination Detection operator finds statements your AI agent made that are factually incorrect or inconsistent. It runs when the conversation ends and returns every flagged statement along with what the source says.
- Catch inaccurate answers: Find conversations where the agent contradicted your knowledge base.
- Catch inconsistent answers: Find conversations where the agent contradicted itself.
- Pair with Task Completion: A conversation can end politely with the task marked
RESOLVEDwhile the agent gave the customer the wrong refund window. Using both operators shows whether the agent solved the problem with accurate information.
For a detailed guide on supervising AI agents with Task Completion and Hallucination Detection, see Supervise AI agents.
The operator extracts the factual claims your agent made, such as policies, prices, and dates, and checks each one against your Enterprise Knowledge, Conversation Memory, and the conversation itself. It uses only the context you provide and never searches the web, so a claim your knowledge base doesn't cover isn't treated as wrong.
| Field | Type | Description |
|---|---|---|
hallucination_detected | boolean | Whether one or more hallucinations were found. |
hallucination_count | integer | The number of findings that aren't context gaps. |
hallucinations | array | One entry per finding. Empty when nothing was flagged. |
hallucinations[].type | string | The conflict type (external_context_conflict, conversation_context_conflict, or context_gap). See conflict types below. |
hallucinations[].source | string | (Optional) The context source the finding relates to: knowledge, memory, or both. Can be set on any conflict type, including context_gap. |
hallucinations[].evidence | string | The flagged agent utterance. Always present. |
hallucinations[].expected | string | (Optional) What the source actually says, paraphrased. Set only for conflict types. |
The conflict types include:
external_context_conflict: The claim contradicts your Enterprise Knowledge, Conversation Memory, or both.conversation_context_conflict: The claim contradicts something the agent said earlier in the conversation, or is clearly fabricated.context_gap: The claim can't be verified against your knowledge, memory, or the conversation.
1{2"hallucination_detected": true,3"hallucination_count": 1,4"hallucinations": [5{6"type": "external_context_conflict",7"source": "knowledge",8"evidence": "We have a 60-day return period",9"expected": "The returns period is 30 days"10},11{12"type": "context_gap",13"evidence": "our warehouse team usually ships same-day"14}15]16}
1{2"hallucination_detected": false,3"hallucination_count": 0,4"hallucinations": []5}
You can configure the operator to check your agent's statements against your knowledge base, or detect contradictions within the conversation if you don't provide one.
To use your knowledge base for hallucination detection, select it when you define a rule with language operators.
The hallucination_count field might not match the number of items in the hallucinations array. The operator uses an AI model to fill in this field, and the model can occasionally miscount. For the correct count, count the items in the array.