Concepts / What Is a System Prompt

What Is a System Prompt

Prompt attacks are attempts to manipulate or extract information from an AI application, and they pose multiple risks, some more severe than others.

  • Programming

Why an Application's Prompt Attracts Attention

An AI application often depends on a prompt that the developer wrote in advance. That prompt shapes how the model behaves for every user who talks to the application. Because the prompt sits at the center of the application, anyone who can interact with the application has a reason to probe it. Attempts to manipulate or pull information out of an application through its prompt are called prompt attacks.

Keep the starting point in mind as you read the rest of this article: the developer's prompt is the thing that makes the application behave the way it does. Each attack family below is defined by what it goes after, whether that is the prompt itself, the model's behavior, or the knowledge the model holds.

Prompt Attacks as an Umbrella Term

Definition

A prompt attack is an attempt to manipulate or extract information from an AI application. The source material states plainly that prompt attacks pose multiple risks for applications, and that some of those risks are more devastating than others.

Prompt attacks are the umbrella term. Underneath it sit three attack types, and each one has a different target. The first aims at the application's prompt itself. The second aims at the model's behavior. The third aims at what the model knows, meaning its training data and the information placed in its context. The source names these three families to start with, and this article works through each one before showing how to tell them apart in a real attempt.

The Three Attack Families

Each family gets its own subsection below. Read each one with the same question in mind: what is the attacker trying to pull out or change?

Telling Prompt Extraction Apart from Information Extraction

The difference between these two families is subtle but important. Prompt extraction is about the instructions the developer wrote for the application. Information extraction is about the knowledge the model holds or has been given. An attack can target both, but the source frames them as separate types, so it is useful to classify them by what is being pulled out.

Attack familyWhat it tries to reveal or changeStated goal
Prompt extractionThe application's prompt, including the system promptReplicate or exploit the application
Jailbreaking and prompt injectionThe model's behaviorGet the model to do bad things
Information extractionTraining data or information used in contextGet the model to reveal that information

Each family is classified by its target, not by how clever the attempt looks.

Trying the Three Families on One Application

Suppose an application wraps a language model with a hidden instruction that tells the model how to answer questions about a company's products. The three attempts below are illustrative examples written for this article, not taken from the source. Each one is worth classifying by what it is trying to get, before you read the answer.

Worked example

Classifying three attempts by their target

A user sends three messages to the product assistant. Attempt A asks the assistant to print the hidden instruction it was given. Attempt B tells the assistant to ignore its product rules and write something the company's policy forbids. Attempt C asks the assistant to quote a confidential internal document that was pasted into the conversation's context. Which family does each attempt belong to?

  1. 1
    Identify the target of Attempt A

    Attempt A asks for the hidden instruction itself. That instruction is the developer's prompt, so the target is the application's prompt, including the system prompt. This matches prompt extraction.

  2. 2
    Identify the target of Attempt B

    Attempt B does not ask for any text to be revealed. It tries to make the model act against its rules. The goal is to get the model to do something it should not, which places it in the jailbreaking and prompt injection family.

  3. 3
    Identify the target of Attempt C

    Attempt C asks the model to reveal information that is being used in its context. The document was supplied during the interaction, so this is information extraction. It is not the developer's instruction, so it is not prompt extraction.

  4. 4
    Check the distinction

    Attempt A and Attempt C both ask for hidden material, which is why they can look alike. Classifying by target separates them: one wants the developer's instructions, the other wants supplied information.

Result

Attempt A is prompt extraction. Attempt B is jailbreaking or prompt injection. Attempt C is information extraction.

Classifying an Attempt Step by Step

When you meet a real attempt, you can follow the questions in the flowchart. Each question asks what the attempt is aiming at. The answer to each question either identifies the family or sends you to the next question.

Apply the questions in order. The first question checks for the application's prompt, because that is the most specific target. The second checks for a change in the model's behavior. The third checks for knowledge: training data or context. An attempt that wants none of these falls outside the three families this source describes.

What do you think happens?

An attempt asks the application to show the exact wording of its hidden system prompt. Which family does it belong to?

  • Prompt extraction

  • Jailbreaking and prompt injection

  • Information extraction

Reveal answer
Answer:

Prompt extraction

The attempt targets the application's prompt, including the system prompt. Prompt extraction is defined by that target.

Mistakes When Classifying Attacks

  • Common mistake

    Classifying by how the attempt is phrased rather than by what it targets

    What it looks like

    Calling every polite request for hidden text a jailbreak.

    Why it fails

    The families are defined by target. A request for the developer's instructions is prompt extraction, and a request for supplied context is information extraction, however it is worded.

    Do this instead

    Ask what the attempt is trying to obtain or change, then match that to the family.

  • Common mistake

    Treating prompt extraction and information extraction as the same thing

    What it looks like

    Thinking that any request for hidden material belongs to one family.

    Why it fails

    Prompt extraction targets the developer's instructions. Information extraction targets training data or information in context. The source frames them as separate types.

    Do this instead

    Separate the attempt by whether it wants the instructions or the knowledge.

  • Common mistake

    Inventing a mechanism for jailbreaking or prompt injection

    Why it fails

    The source gives the goal of this family, getting the model to do bad things, but no step-by-step mechanism and no separation between the two names.

    Do this instead

    Describe the goal, and say that the source does not separate the two.

  • Common mistake

    Ranking the three families by severity without evidence

Assessing Risk Without a Ranking

The source states that prompt attacks pose multiple risks and that some are more devastating than others. It lists only a few risks and does not rank them. So the safe reading is that severity varies, and the source does not say which of the three families is most damaging in every case.

Best practice

When you assess an application, treat each attack family as a separate risk to evaluate against what the application actually exposes. Ask whether the application has a sensitive prompt, whether the model's behavior matters in a sensitive setting, and whether private information sits in its context.

Practice: Classify New Attempts

EASY

For each of the following attempts against the product assistant, name the attack family and state the target that decided your answer. Attempt 1: the user asks the assistant to repeat the instructions that define its role. Attempt 2: the user tells the assistant to disregard its guidelines and answer without restrictions. Attempt 3: the user asks the assistant to reveal a private customer record that was loaded into the conversation context.

Hints
  • Look first at whether the attempt wants the developer's instructions. That is prompt extraction.
  • If the attempt wants the model to act against its guidelines, the goal is bad behavior, which places it in the jailbreaking and prompt injection family.
  • A record loaded into the conversation is information in context, so it points to information extraction.

Key Takeaways

  • Prompt attacks are attempts to manipulate or extract information from an AI application, and they pose multiple risks, some more severe than others.
  • Prompt extraction targets the application's prompt, including the system prompt, to replicate or exploit the application.
  • Jailbreaking and prompt injection aim to get the model to do bad things, which means they target the model's behavior.
  • Information extraction targets the knowledge the model holds: its training data or information used in its context. Classify attempts by what they target to tell the three families apart.

Related concepts

More concepts starting with W