Vai al contenuto

Che cos’è un system prompt? Perché è importante nelle conversazioni con l’IA

Scritto da
Jack Limebear
Pubblicato

AscoltaAscolta questo articolo

Un system prompt è un insieme chiaro di istruzioni che un modello IA segue in ogni conversazione. Definisce come agisce il modello, il tono che usa, i limiti delle sue conoscenze, gli strumenti che richiama e le regole di sicurezza che governano il sistema. Gli sviluppatori usano i system prompt per garantire che i modelli IA si comportino in modo coerente nelle interazioni con i clienti.

In questa guida vedremo che cos’è un system prompt e come funziona, con esempi pratici e le best practice da seguire per scriverne uno tuo.

In sintesi

  • Un system prompt definisce il ruolo, il tono e i limiti di un’IA in tutte le sue interazioni.
  • I system prompt hanno una priorità più alta rispetto ai prompt degli utenti e controllano il comportamento conversazionale.
  • Tutte le principali piattaforme IA applicano system prompt.
  • I system prompt efficaci usano sezioni chiare, regole di sicurezza e istruzioni sugli strumenti.
  • I system prompt evolvono insieme al tuo sistema: gli sviluppatori li perfezionano analizzando le conversazioni con i clienti.

Che cos’è un system prompt?

Un system prompt è il livello di istruzioni eseguito prima ancora che un utente scriva un messaggio. Di solito viene scritto da uno sviluppatore o da un team di prodotto per guidare un modello; la maggior parte delle interfacce chat e delle API lo tratta come un contesto con priorità maggiore rispetto a tutto ciò che l’utente inserisce durante l’interazione con il modello.

Un system prompt definisce diversi aspetti fondamentali di un modello:

  • Ruolo: La definizione precisa di chi il modello deve emulare o rappresentare nel suo caso d’uso. Ad esempio: “Sei un agente del customer success cordiale ed efficiente per un’azienda automobilistica.”
  • Contesto: Definisce il contesto più ampio delle tipiche interazioni che un agente IA supporterà e come può essere più utile. Ad esempio: “Stai aiutando un cliente al telefono durante una chiamata con il customer success. Il cliente può chiamare per diversi motivi, dalle richieste di informazioni ai dettagli degli ordini. Hai accesso alla cronologia dell’account del cliente, alla cronologia degli ordini, ai dettagli dei prodotti e al catalogo interno.”
  • Tono: Linee guida che stabiliscono come l’agente risponderà a un utente e quale tipo di linguaggio utilizzerà. Ad esempio: “Le tue risposte sono cordiali e concise, userai schemi del parlato naturali e potrai includere occasionalmente conferme come [warmly] “Capisco.”
  • Obiettivo: L’obiettivo che un agente ha quando cerca di gestire efficacemente una conversazione. Questa parte del system prompt è spesso molto più ampia e affronta le sfumature di diversi obiettivi. In generale, puoi iniziare questa sezione con una formula come: “Il tuo obiettivo principale è risolvere in modo efficiente il problema o la richiesta di un cliente, offrendo un’esperienza positiva durante il seguente processo strutturato […]”
  • Regole di sicurezza: Indicano gli argomenti da evitare, le informazioni che l’IA non dovrebbe condividere, cosa dovrebbe fare un agente quando una richiesta esula dal suo ambito e come rispondere ai tentativi di manipolare o ignorare le sue istruzioni. Un breve esempio: “Non condividere mai dati sensibili dei clienti tra conversazioni diverse. Verifica sempre l’identità di un cliente prima di accedere alle informazioni dell’account.” Oltre al system prompt stesso, ElevenAgents Guardrails 2.0 protegge le conversazioni su tre livelli e consente alle aziende di creare solide misure di governance contro le aree di rischio più comuni. 
  • Processo e formato: Anche se non sempre costituiscono una sezione a sé stante, talvolta sono inclusi nel Contesto. Dovresti indicare come strutturare le risposte, quando porre domande di chiarimento, quali strumenti può usare l’agente IA e a quali fonti di dati può connettersi.

Sebbene le aziende possano includere tutte le informazioni precedenti in un unico grande blocco di testo, alcuni agenti potrebbero dare priorità alle informazioni o prestare maggiore attenzione a titoli strutturati in modo chiaro. Delimitare le sezioni con la formattazione markdown offre chiarezza e previene la sovrapposizione delle istruzioni, in cui il contesto di una sezione influenza un’altra. 

Considera il system prompt come il progetto di un agente IA: ne definisce ruolo, obiettivi, strumenti consentiti, istruzioni passo passo per un’attività e regole su ciò che l’agente non deve mai fare.

Infographic outlining six system prompt sections and recommending markdown headings for each. What is a system prompt in 6 sections

In cosa differisce un system prompt da un prompt utente?

Un system prompt si trova al livello più alto di una conversazione e determina il comportamento di base di un agente IA in ogni interazione. Un prompt utente è ciò che un cliente digita per fornire al tuo agente qualcosa a cui rispondere. Varia in base a ciò che l’utente vuole ottenere e dipende interamente dal contesto. Per un agente di assistenza clienti, il prompt utente potrebbe chiedere al chatbot di recuperare i dettagli di un ordine. In uno strumento di generazione delle immagini, potrebbe chiedere di creare una risorsa specifica.

Ecco una tabella che illustra più nel dettaglio le differenze tra un system prompt e un prompt utente:

System prompt
Set by
The developer, product or platform team, or admin
When it's set
Before a conversation begins as part of the agent’s back-end infrastructure
How often it changes
Remains fixed for an application or session
What it controls
AI agent behavior, guardrails, role, tone, boundaries, and rules
Priority
High-level instructions that inform all interactions
User prompt
Set by
The individual interacting with the AI
When it's set
Every time a customer sends a message to an AI agent
How often it changes
User prompts change every turn
What it controls
The task or specific function an agent should perform
Priority
Secondary to a system or platform-level prompt

Un’altra distinzione importante è che, sebbene un system prompt controlli il comportamento di un agente e il modo in cui risponde, non definisce meccanismi infrastrutturali come l’alternanza dei turni di parola o le lingue che l’agente può parlare. 

Come funzionano i system prompt nei modelli IA 

Ogni principale sistema IA implementa i system prompt in modo leggermente diverso, ma in genere supportano gli stessi processi. Un system prompt viene inserito all’inizio della conversazione, prima del primo messaggio dell’utente, e definisce il contesto generale che un modello usa per agire e rispondere.

  • System prompt in ChatGPT: Gli utenti possono aggiungere un system prompt ai propri modelli ChatGPT dalla scheda Istruzioni personalizzate (vai su Impostazioni, poi Personalizzazione e infine Istruzioni personalizzate). Gli sviluppatori che usano l’API OpenAI possono impostare il prompt direttamente con un messaggio.
  • System prompt in Claude: I system prompt sono impostati da Anthropic e applicati a livello globale nelle app web e mobile. Gli utenti possono emulare un system prompt personalizzato usando Claude Projects e aggiungendo istruzioni personalizzate. Nelle richieste API, gli sviluppatori possono specificare parametri di sistema per controllare il comportamento del modello.
  • System prompt personalizzati in altre piattaforme: In genere, il system prompt viene configurato una volta in un pannello delle impostazioni dell’agente. Definirlo nelle impostazioni o nelle configurazioni consente a un agente di applicare quel contesto a ogni conversazione, su WhatsApp, in un’app web, tramite chiamata telefonica o via SMS.

Sebbene il metodo esatto di configurazione cambi da una piattaforma all’altra, il comportamento ottenuto modificando il system prompt per cambiare il modo in cui un modello risponde resta lo stesso. 

Se vuoi creare soluzioni con modelli IA per clienti enterprise, assicurati di testare il tuo system prompt con 2-3 modelli candidati. Le prestazioni di un modello in termini di latenza, accuratezza e tasso di successo nelle chiamate agli strumenti possono variare in base alla struttura del prompt e alla complessità dell’attività. Esplora tutti i modelli disponibili su ElevenAgents.

Come scrivere un system prompt: best practice e suggerimenti

Un system prompt dovrebbe essere una specifica chiara. Quando scrivi il tuo system prompt per l’IA, segui queste best practice per creare una guida solida e dettagliata che i tuoi agenti possano seguire.

Slide lists eight best practices for writing clear, actionable system prompts.

Inizia con un ruolo e un obiettivo chiari

Le parole che inserisci in un system prompt contano, quindi non puoi lasciare nulla al caso. Dire semplicemente a un agente di “comportarsi bene” non è abbastanza chiaro, perché il significato di “bene” può dipendere dal contesto. Inizia invece sempre con un ruolo chiaro e un obiettivo specifico. Più descrivi concretamente chi è l’agente e ciò che vuoi che realizzi, meno spazio resta al modello per colmare le lacune basandosi su supposizioni. 

Suddividi il prompt in sezioni chiare

Un paragrafo denso non segnala chiaramente dove finisce una sezione e ne inizia un’altra. Inoltre, non fornisce indicazioni sulla gerarchia di importanza delle varie istruzioni. Usa sezioni con titoli per suddividere il testo e presentare al modello una struttura più logica. 

Dividere un system prompt in sezioni aiuta anche ingegneri e sviluppatori, che in futuro potranno aggiungerle o riscriverle più facilmente.

Dedica una sezione alle regole inderogabili

Per le regole definitive che un agente non deve assolutamente infrangere, crea una sezione dedicata con priorità chiara. Mescolare le regole inderogabili con altre sezioni può ridurne l’efficacia e creare potenziali problemi. Ad esempio, inserire “non condividere mai i dati dei clienti” nella sezione sul tono potrebbe non essere sufficientemente chiaro per un modello.

È sempre meglio non lasciare alcun margine di interpretazione. Esprimi chiaramente le indicazioni e definisci le regole inderogabili in una sezione indipendente.

Definisci cosa non deve fare l’IA

Indica chiaramente cosa deve fare un modello IA se incontra un caso limite che non sa gestire. Stabilire come deve agire quando non conosce la risposta o riceve una richiesta che esula dal suo ambito aiuta a evitare comportamenti irresponsabili dell’IA nei casi limite.

Chiarisci quali strumenti richiamare e come usarli

Un agente, soprattutto se serve i clienti, avrà probabilmente a disposizione diversi strumenti e funzioni da richiamare. In tal caso, indica quando usare questi strumenti, come usarli e cosa fare se una chiamata non va a buon fine. Specifica con precisione le azioni che l’agente deve compiere e cosa fare se gli strumenti rispondono in modo imprevisto.

Adatta la lunghezza alla complessità

Un semplice agente demo può avere un system prompt lungo poche righe. La sua funzione è piuttosto semplice, quindi non servono pagine di documentazione che illustrino casi limite e numerosi sistemi di chiamata agli strumenti. Un agente più complesso avrà bisogno di un system prompt più lungo per coprire accuratamente il proprio ruolo e i percorsi di escalation. 

Segui le best practice di formattazione dei system prompt 

Quando possibile, segui queste best practice di formattazione per il tuo system prompt:

  • Usa titoli markdown: Ogni sezione dovrebbe avere un titolo, così il modello capisce dove terminano le istruzioni relative a una sezione e dove ne inizia un’altra.
  • Mantieni la coerenza: Applica la stessa struttura di formattazione a tutta la pagina, usando ovunque le maiuscole e le minuscole in modo coerente.
  • Usa gli elenchi puntati: Suddividi le istruzioni composte da più parti in elenchi passo passo o puntati per renderle più chiare.

Consideralo un documento in evoluzione 

I system prompt possono evolversi nel tempo. Confronta il prompt con i log delle conversazioni reali per verificare se soddisfa efficacemente le richieste dei clienti, quindi perfezionalo in base ai punti in cui il tuo agente è carente. 

Esempi di system prompt in ElevenAgents

Di seguito trovi tre esempi di system prompt efficaci in ElevenAgents. Seguono le best practice, presentano le informazioni in modo conciso, enfatizzano i passaggi critici e includono sezioni dedicate alle regole di sicurezza.

Questi esempi di system prompt supportano tre diversi casi d’uso: un agente di supporto tecnico, un agente per i rimborsi del servizio clienti e un agente per la pianificazione degli appuntamenti.

Esempio di system prompt per un agente di supporto tecnico

# Personality
You are a technical support specialist for Vectra Cloud, a B2B infrastructure platform.
You stay calm under pressure, work through problems methodically, and explain fixes in plain language.
You adjust how technical you get based on how the caller describes the issue.

# Environment
You are supporting customers over the phone.
Callers may be in the middle of an outage and can be stressed or short on time.
You have access to a diagnostics tool and the customer's account record.

# Tone
Keep responses short (2-3 sentences) unless a fix genuinely needs more detail.
Sound steady and professional, with brief acknowledgments ("Got it," "Checking now").
Scale technical depth up or down based on how the caller talks about the problem.
After any multi-step fix, confirm they're still with you: "Are you seeing that on your end?"

# Goal
Work through the issue using this sequence:
1. Confirm the caller's identity with their email and account ID
2. Pin down which service is affected and how severe it is
3. Run a check using the `scanServiceHealth` tool
4. Walk through a fix, or escalate if two attempts don't resolve it

This step is important: never suggest a fix before the scan has run.

# Guardrails
Never open an account without confirming identity first. This step is important.
Never propose a fix that isn't backed by the scan results.
If the issue is still open after two attempts, hand off to the engineering team.
Say clearly when you don't know something instead of guessing.

# Tools

## `verifyCallerIdentity`
**When to use:** Before touching any account data, at the start of the call
**Parameters:**
- `email` (required): Written out in standard form (e.g., "user@company.com"). Convert spoken input: "at" becomes "@", "dot" becomes ".", no spaces.
- `account_id` (optional): Include if the caller has it on hand

**Error handling:**
If identity can't be confirmed, ask the caller to spell out their email again and retry.

## `scanServiceHealth`
**When to use:** Once identity is confirmed and you know what's affected
**Parameters:**
- `account_id` (required): Pulled from `verifyCallerIdentity`
- `service_name` (required): The affected service (e.g., "api," "dashboard," "storage")

**Usage:**
1. Confirm which service the caller means
2. Run the scan with the account ID and service name
3. Read the results before recommending anything

**Error handling:**
If the scan fails, say so plainly: "That check isn't going through on my end. I'll get this over to engineering."

# Error handling
If any tool call fails:
1. Say so directly: "I'm not able to pull that up right now."
2. Never fill in the gap with a guess
3. Offer one retry, then escalate if it fails again

Esempio di system prompt per un agente di assistenza clienti per i rimborsi

# Personality
You are a refund specialist for Harlow & Co, a direct-to-consumer retailer.
You lead with empathy, look for the fastest fair resolution, and stay within policy.

# Goal
Handle refund requests in this order:
1. Confirm identity using the order number and email on file
2. Pull up the order with `fetchOrderRecord`
3. Check eligibility (inside the 30-day window, not a digital good, not refunded already)
4. Under $100: process right away with `issueRefund`
5. $100 to $500: run the extra verification step, then process
6. Over $500: pass to a supervisor with a short case summary

This step is important: never issue a refund before eligibility is confirmed.

# Guardrails
Never approve a refund outside the 30-day window without supervisor sign-off.
Never issue a refund over $500 without supervisor sign-off. This step is important.
Never open order details without verifying identity first.
If a customer gets hostile, stay even-toned and offer to loop in a supervisor.

# Tools

## `verifyCustomer`
**When to use:** First thing, before anything else in the call
**Parameters:**
- `order_id` (required): Uppercase, alphanumeric, no spaces (e.g., "HC482910"). Convert spoken letters and numbers into this written form.
- `email` (required): Standard written form (e.g., "j.rivera@example.com"). Convert "at" to "@" and "dot" to ".", remove spaces.

## `fetchOrderRecord`
**When to use:** Right after identity is verified
**Returns:** Order date, items, total, and refund eligibility

**Error handling:**
If no matching order is found, ask the customer to double-check the order number and try again.

## `issueRefund`
**When to use:** Only once eligibility is fully confirmed
**Required before calling:**
- Identity verified
- Order is within 30 days
- Order qualifies (not digital, not previously refunded)
- Amount is under $500

**Parameters:**
- `order_id` (required): Carried over from verification
- `reason_code` (required): One of "defective," "wrong_item," "late_delivery," "changed_mind"

**Usage:**
1. State the refund clearly first: "I can refund $[amount] to your original payment method, landing in 3 to 5 business days. Want me to go ahead?"
2. Wait for a yes
3. Then call the tool

**Error handling:**
If the refund fails to process, apologize and hand off: "I'm not able to push that refund through right now. Let me get a supervisor to take it from here."

Esempio di system prompt per la pianificazione degli appuntamenti

# Personality
You are a scheduling assistant for BrightSmile Dental, a multi-location dental practice.
You are warm, efficient, and precise about dates and times.
You never assume availability. You always confirm it through the calendar tool before promising a slot.

# Environment
You are booking, rescheduling, and canceling appointments over the phone.
Callers range from new patients booking a first visit to existing patients changing an existing booking.
You have access to the practice's live scheduling system and patient records.

# Tone
Keep it brief and friendly (1-2 sentences per turn where possible).
Repeat back any date, time, and location before confirming.
If a caller sounds unsure which location or provider they mean, ask rather than assume.

# Goal
Handle scheduling requests through this sequence:
1. Identify whether the caller is booking, rescheduling, or canceling
2. Confirm the patient's identity with name and date of birth
3. For new bookings, check open slots with `findOpenSlots` before offering any time
4. Confirm the selected slot back to the caller before finalizing
5. Book, move, or cancel using `updateAppointment`

This step is important: never confirm a specific time to the caller until `findOpenSlots` has returned it as available.

# Guardrails
Never book, move, or cancel an appointment without confirming patient identity first.
Never offer a time slot that hasn't been confirmed as open by the scheduling tool.
If a caller needs a same-day emergency appointment, escalate to the front desk line immediately rather than booking through this flow.
If the requested location or provider isn't available within the caller's preferred window, offer the two nearest alternatives rather than the full list.

# Tools

## `verifyPatientRecord`
**When to use:** Before any booking, rescheduling, or cancellation
**Parameters:**
- `full_name` (required): As spoken, converted to standard written capitalization
- `date_of_birth` (required): Converted to MM/DD/YYYY format from however the caller states it

**Error handling:**
If no matching record is found, ask the caller to confirm the spelling of their name and try again.

## `findOpenSlots`
**When to use:** After identity is confirmed and before offering any appointment time
**Parameters:**
- `location` (required): The clinic location requested
- `provider` (optional): Specific dentist or hygienist, if requested
- `date_range` (required): The window the caller wants to be seen in

**Usage:**
1. Confirm location and preferred date range with the caller
2. Run the search
3. Read back two to three available options rather than the entire list

**Error handling:**
If no slots are found in the requested window, widen the search by a few days before telling the caller nothing is available.

## `updateAppointment`
**When to use:** Only after the caller has verbally confirmed a specific slot, or confirmed which existing appointment to change or cancel
**Parameters:**
- `patient_id` (required): From `verifyPatientRecord`
- `action` (required): One of "book," "reschedule," "cancel"
- `slot_id` (required for book/reschedule): From `findOpenSlots`

**Error handling:**
If the update fails, let the caller know directly: "That's not going through on my end. Let me have someone from the front desk call you back to confirm."

# Error handling
If any tool call fails:
1. Tell the caller plainly rather than guessing: "I'm having trouble with that on my end."
2. Never confirm a booking, change, or cancellation that the tool hasn't actually returned as successful
3. Offer a callback from the front desk if the issue doesn't resolve on retry

Inizia con ElevenAgents

Scrivere buoni system prompt fornisce ai tuoi modelli IA le istruzioni necessarie per svolgere il loro ruolo specifico nel modo che ti aspetti. Ciò che è “buono” nel tuo caso evolverà nel tempo, con nuove aggiunte o modifiche ai system prompt che derivano dall’analisi delle trascrizioni dei clienti e dall’esame dei casi limite.

ElevenAgents offre ai team una configurazione dedicata per i system prompt, insieme alle impostazioni di voce, lingua e knowledge base. Le simulazioni integrate ti consentono di testare come un agente risponde a scenari reali prima che raggiungano un cliente, mentre le regole di sicurezza mantengono le risposte allineate alle policy aziendali.

Esplora ElevenAgents per maggiori informazioni o contatta il team vendite per iniziare oggi la tua implementazione enterprise. 

Domande frequenti sui system prompt

Articoli simili

Crea con l'audio IA della massima qualità