---
title: "AI prompts"
site: admin
version: 1.11
versions: "1.11+"
url: https://docs-new.servicely.ai/admin/1.11/sofi/ai-prompts/
type: reference
application: sofi_core
last_updated: 2026-11-24
commit: 88e011e506a8
---


An AI prompt is a single call to a language model with templated prompts, used for jobs such as summarising a ticket, classifying an email or drafting an article. This page lists its fields, how to test it and how to run it from a script. Some AI features have licensing implications, so check with your account manager before you build on them.

## Prompt fields

Prompts are under **Intelligent automation → Agentic AI → AI Prompts**.

| Field | Type | Required | Behaviour | Purpose |
| --- | --- | --- | --- | --- |
| **Name** | String | Yes | Shown in lists. | Identifies the prompt. |
| **Key** | String | Yes | Must be unique. | The value scripts use to run the prompt. |
| **Description** | Text | No | None. | Says what the prompt does. |
| **Model selection type** | Choice | No | Explicit, Fast, General, Complex or Coding. Explicit uses **LLM Model**, the others use the model set for that type. | Chooses the model. |
| **LLM Model** | LLM model | No | Used when the type is Explicit. Change it to compare providers and models. | The model, provider and token. |
| **System Prompt** | Text | No | Markdown. Can reference `${variableName}` and templates. | Sets the model's role, context, limits and output format. |
| **User Prompt** | Text | No | A template sent with each call. `${variableName}` values come from the context. | The task you ask the model to do. |
| **Pre-processing Script** | Script | No | Runs before the call. Receives `context`, `options`, `promptRec` and `evaluationPhase` (evaluate or test). | Reads Servicely data into the context for the templates. |
| **Post-processing Script** | Script | No | Runs after the response. Receives `context`, `promptRec` and `evaluationPhase`. | Checks or reshapes the response before it is returned. |
| **Test Setup Script** | Script | No | Assigns sample values to `answer`. | Supplies test input for the test buttons. |
| **Execution Mode** | Choice | No | Synchronous by default. Async runs as a background job and pushes the result back. Background runs without waiting and shows a message when done. | How the prompt runs from the interface. |
| **Timeout (Seconds)** | Integer | No | Overrides the default of 120 seconds. | Limits how long a call may take. |
| **Roles** | Roles | No | Blank means the prompt cannot be run from the interface. | Who can run the prompt. |
| **Active** | Boolean | No | Defaults to true. An inactive prompt cannot be run. | Turns the prompt on or off. |

## Test buttons

| Button | What it does |
| --- | --- |
| **Test prompts only** | Runs the pre-processing and shows the system and user prompts that would be sent, with a **Copy** button. Nothing is sent to the model. |
| **Test Model** | Sends the request to the model and shows the result, the model, the latency, the token usage and the cost. |

Both buttons use the **Test Setup Script** for their input.

## Script methods

The `AI` script global runs prompts from server-side scripts.

| Method | Returns | Description | Version |
| --- | --- | --- | --- |
| `AI.processAIPrompt(key, context)` | Any | Runs the prompt with this key and returns what the post-processing script returns. Roles are not checked. | 1.9 |
| `AI.processAIPrompt(key, context, enforceRoles)` | Any | As above. When `enforceRoles` is `true`, the caller must hold one of the prompt's roles. | In 1.11 |
| `AI.processAIPrompt(key, context, options)` | Any | Options are `enforceRoles` and `forRecord`, the record the usage log is attributed to. | In 1.11 |
| `AI.processAIPromptAsync(key, context, options)` | String | Starts a background run and returns the AI prompt execution ID. Options include `forRecord`, `runAs` and `notifyUser`. | In 1.11 |

### Example

This server-side script summarises the current incident with a prompt whose key is `itsm_inc_rec_summarisation`.

```javascript
var summary = AI.processAIPrompt(
    "itsm_inc_rec_summarisation",
    { current: current },
    { forRecord: current }
);
```

## Shipped prompts

### Platform

<!-- source: platform/data/SystemAIPrompt -->
| Prompt | Key | What it does |
| --- | --- | --- |
| Translation | `prompt_translation` | Translates text when the source and target languages are known. |
| Translation with autodetect | `prompt_translation_autodetect` | Translates text and detects the source language. |
| Translation for language pack | `prompt_translation_pack` | Generates language packs. |
| Major Incident Teams Chat Summarisation | `major_incident_teams_chat_summarisation` | Summarises the chat in a major incident's Microsoft Teams channel. |
| Test Generate Major Incident Chat Messages | `test_generate_major_incident_chat_messages` | Generates a sample major incident chat for testing. |
| Test | `prompt_test` | A test prompt. |

### AI Accelerator — ITSM

<!-- source: ai_accelerator_itsm/data/SystemAIPrompt -->
| Prompt | Key | What it does |
| --- | --- | --- |
| ITSM - Inc/Rec Summarisation | `itsm_inc_rec_summarisation` | Summarises the work done on an incident or request. |
| AI Journal Composition | `ai_journal_composition` | Rewrites an agent's draft customer update as a clear message. |
| AI Internal Note Composition | `ai_internal_note_composition` | Rewrites an agent's rough internal note as a clear working record. |
| Draft Knowledge Article | `draft_knowledge_article` | Expands a rough draft into an article, using the closure notes of a linked ticket. |
| ITSM - AI First-Reply | `itsm_ai_first_reply` | Decides whether a new ticket has enough information and, if not, writes a short reply asking for it. |
| ITSM - AI Auto Classification | `itsm_ai_auto_classification` | Decides whether an inbound message is an incident, a request or an HR case, and where it should go. |

### ITSM events and alerts

<!-- source: itsm_event/data/SystemAIPrompt -->
| Prompt | Key | What it does |
| --- | --- | --- |
| ITSM Event - AI Triage Enrichment | `prompt_itsm_event_ai_enrichment` | Suggests a corrected severity and configuration item for a new event. |
| ITSM Event - AI Triage Suppression | `prompt_itsm_event_ai_suppression` | Decides whether an event is noise to suppress. |
| ITSM Event - AI Triage Correlation | `prompt_itsm_event_ai_correlation` | Decides whether an event belongs to an open alert. |
| ITSM Alert - AI Triage Enrichment | `prompt_itsm_alert_ai_enrichment` | Suggests a severity and a triage summary for an open alert. |
| ITSM Alert - AI Triage Suppression | `prompt_itsm_alert_ai_suppression` | Decides whether an alert is noise to suppress. |
| ITSM Alert - AI Triage Escalation | `prompt_itsm_alert_ai_escalation` | Decides whether an alert needs an incident, or belongs to an open one. |


## Related

- [Connect an LLM provider](page:sofi/connect-an-llm-provider)
- [AI assistants](page:sofi/ai-assistants)
- [Sofi properties](page:sofi/sofi-properties)
- [How Sofi is built](page:sofi/sofi-overview)
