Presentiamo Eleven v4Scopri Eleven v4, il nostro modello più espressivo di sempre.

Vai al contenuto

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

Scritto da
Jack Limebear
Pubblicato
Ultimo aggiornamento

AscoltaAscolta questo articolo

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

In questa guida esploreremo 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à superiore rispetto ai prompt utente e controllano il comportamento conversazionale.
  • Ogni principale piattaforma di IA applica i system prompt.
  • I system prompt efficaci usano sezioni chiare, guardrail e istruzioni sugli strumenti.
  • I system prompt evolvono insieme al tuo sistema: gli sviluppatori li perfezionano analizzando le conversazioni con i clienti.

Cos'è un system prompt?

Un system prompt è il livello di istruzioni che viene 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 e la maggior parte delle interfacce chat e delle API lo tratta come un contesto più prioritario rispetto a qualsiasi testo inserito dall'utente durante l'interazione con il modello.

Un system prompt definisce diversi aspetti fondamentali di un modello:

  • Ruolo: La specifica esatta della figura che il modello deve emulare o rappresentare per il caso d'uso previsto. Ad esempio: «Sei un addetto al customer success cordiale ed efficiente per un'azienda automobilistica.»
  • Contesto: Definisce il contesto più ampio delle interazioni tipiche in cui un agente IA sarà di supporto e il modo migliore per aiutare. Un esempio potrebbe essere: «Stai aiutando un cliente al telefono durante una chiamata di customer success. Il cliente può chiamare per diversi problemi, dalle richieste di informazioni a quelle sugli 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 il tipo di linguaggio che userà. Ad esempio: «Le tue risposte sono cordiali e concise, userai schemi linguistici 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 qualcosa del tipo: «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 […]»
  • Guardrail: Indicano gli argomenti da evitare, le informazioni che l'IA non dovrebbe condividere, cosa dovrebbe fare un agente quando una richiesta esce 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. 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, consentendo alle aziende di creare solide misure di governance contro le aree di rischio più comuni. 
  • Processo e formato: Anche se non sempre costituisce una sezione a sé stante, talvolta inclusa nel Contesto, dovresti indicare come vuoi strutturare le risposte, quando porre domande di chiarimento, quali strumenti può usare l'agente IA e a quali fonti di dati può collegarsi.

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

Considera un system prompt come il progetto di un agente IA: ne definisce ruolo, obiettivi, strumenti consentiti, istruzioni passo passo per un'attività e guardrail 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 colloca 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 del servizio clienti, il prompt utente potrebbe chiedere al chatbot di recuperare i dettagli di un ordine. In uno strumento di generazione di 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, mentre un system prompt controlla il comportamento di un agente e il modo in cui risponde, non definisce meccanismi infrastrutturali come l'alternanza dei turni o le lingue che l'agente può parlare. 

Come funzionano i system prompt nei modelli di IA 

Ogni principale sistema di IA implementa i system prompt in modo leggermente diverso, ma in genere influenzano 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 tramite la scheda Istruzioni personalizzate (vai a Impostazioni, poi Personalizzazione, quindi Istruzioni personalizzate). Gli sviluppatori che usano l'API OpenAI possono impostare il prompt direttamente con un messaggio.
  • System prompt in Claude: I system prompt vengono impostati da Anthropic e applicati globalmente nelle app web e mobile. Gli utenti possono simulare 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 su altre piattaforme: In genere, il system prompt viene configurato una sola 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 SMS.

Sebbene il metodo di configurazione esatto cambi da una piattaforma all'altra, il comportamento ottenuto modificando il system prompt per cambiare le risposte di un modello rimane lo stesso. 

Se sei un cliente enterprise e vuoi creare con modelli di IA, 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 consigli

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 sono importanti, 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 cosa vuoi che realizzi, meno spazio avrà il modello per colmare le lacune basandosi su supposizioni. 

Dividi il prompt in sezioni chiare

Un paragrafo denso non indica chiaramente dove finisce una sezione e inizia la successiva. Inoltre, non chiarisce la gerarchia di importanza delle varie istruzioni. Usa sezioni con titoli per dividere il testo e presentare al modello una struttura più logica. 

Dividere un system prompt in sezioni aiuta anche ingegneri e sviluppatori, perché in futuro potranno aggiungere o riscrivere le sezioni più facilmente.

Dedica una sezione alle regole inderogabili

Per tutte 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'impatto e creare potenziali problemi. Per esempio, inserire «non condividere mai i dati dei clienti» nella sezione sul tono potrebbe non essere chiaro per un modello.

È sempre meglio non lasciare alcuno spazio all'interpretazione. Esprimi le cose chiaramente e definisci le regole inderogabili in una sezione indipendente.

Definisci cosa non dovrebbe fare l'IA

Indica chiaramente cosa dovrebbe fare un modello di IA se incontra un caso limite che non sa come gestire. Definire il comportamento del modello quando non conosce la risposta o riceve una richiesta al di fuori del 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, probabilmente avrà una serie di strumenti e funzioni che può richiamare. In tal caso, assicurati di indicare quando usare questi strumenti, come usarli e cosa fare se una chiamata non va a buon fine. Sii specifico sulle azioni esatte che un agente deve compiere e su cosa fare se gli strumenti rispondono in modo imprevisto.

Adatta la lunghezza alla posta in gioco

Un semplice agente demo può avere un system prompt lungo appena poche righe. La sua funzione è piuttosto semplice, quindi non servono pagine di documentazione che descrivano 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, usa queste best practice di formattazione per il tuo system prompt:

  • Usa titoli markdown: Ogni sezione dovrebbe avere un titolo, affinché il modello capisca dove terminano le istruzioni relative a una sezione e ne inizia un'altra.
  • Sii coerente: Applica la stessa struttura di formattazione a tutta la pagina, incluso l'uso coerente delle maiuscole e minuscole nelle frasi.
  • Usa elenchi puntati: Suddividi le istruzioni articolate in elenchi passo passo o puntati per offrire maggiore chiarezza.

Trattalo come un documento in evoluzione 

I system prompt possono evolvere nel tempo. Confronta il tuo prompt con i log di conversazioni reali per verificare se soddisfa efficacemente le esigenze 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 ai guardrail.

Questi esempi di system prompt supportano tre diversi casi d'uso: un agente di supporto tecnico, un agente del servizio clienti per i rimborsi 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 del servizio 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 di IA le istruzioni necessarie per svolgere il ruolo specifico che ti aspetti. Ciò che nel tuo caso è considerato «buono» evolverà nel tempo, con nuove aggiunte o modifiche ai system prompt che deriveranno dall'analisi delle trascrizioni dei clienti e dallo studio dei casi limite.

ElevenAgents offre ai team una configurazione dedicata per i system prompt, insieme alle impostazioni per 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 i guardrail mantengono le risposte allineate alle policy aziendali.

Esplora ElevenAgents per maggiori informazioni o contatta il team commerciale per iniziare oggi stesso l'implementazione enterprise. 

FAQ sui system prompt

Scritto da

Jack Limebear fa parte del team Growth e si occupa di scrivere contenuti e definire strategie per il blog e le pagine insights. Prima di arrivare in ElevenLabs, ha guidato la strategia dei contenuti per oltre dieci anni in realtà che vanno da startup SaaS in rapida crescita a grandi aziende Fortune 500. Ha conseguito un Master in Letteratura Inglese presso l’Università di Cambridge.

Articoli simili

Crea con l'audio IA della massima qualità