What is a prompt?
A prompt is everything you type into an AI's input field. A question. An instruction. A task. A piece of text with a request to revise it. Whether it's one sentence or five paragraphs, that's the prompt. The word comes from English and means something like a request or cue.
Sounds simple. It isn't, though. Because the prompt is the only tool you have to steer the AI's behavior. And that's exactly where the difference lies between a mediocre answer and a genuinely useful one.
Imagine asking a very capable but somewhat scatterbrained intern for help. If you say "Do something about marketing," you get something random. If you say "Please write me three subject lines for a newsletter to our existing customers about our new summer offer, each under 60 characters," you get something usable. The AI is exactly the same. It does what you say. Not what you mean.
Why small changes have huge effects
If you swap the word "short" for "detailed" in your prompt, you get a completely different answer. If you add "You are an expert" at the start, the tone shifts immediately. If you add "Answer in bullet points" at the end, the whole format tips over.
This comes down to how an LLM works: it predicts, token by token, the most likely next piece of language, depending on everything that's currently in the context. Every word in your prompt shifts the probabilities. More on this in the chapter on Large Language Models.
The AI doesn't respond to your intent. It responds to your text.
System prompt vs. user prompt
In practice, an AI doesn't just get what you type. It almost always also gets a second, invisible instruction, the system prompt. That's a baseline setting defined by whoever runs the chat.
System prompt
- Set by the operator, not the user.
- Defines role, tone, and boundaries.
- Example: "You are a friendly customer service assistant. Only answer questions about our products."
- Stays the same for every conversation.
- The user doesn't see the system prompt.
User prompt
- What you as the user type into the input field.
- The concrete request or task.
- Example: "How long are your delivery times?"
- Changes with every message.
- Is processed in context together with the system prompt.
With ChatGPT, Claude.ai, or Gemini you don't see the system prompt, it's set by the provider. In your own applications via the API, you can define the system prompt yourself. That's exactly what chatbots on company websites do, for example.
Four techniques that make every prompt better
1. Give it a role
Tell the AI who it should be for this task. Sounds odd, but it works: "You are an experienced tax advisor" or "You are an English teacher for elementary school kids," this immediately shifts the style and vocabulary.
Without a role: "Explain stocks to me." → dry definition.
With a role: "You are a friendly bank advisor talking to beginners. Explain stocks to me." → vivid, personal, with examples.
2. Show examples (few-shot)
If you want a specific format, show the AI a few examples of it. This technique is called few-shot prompting, "few" as in "a couple." You give two or three patterns, and the AI continues in the same style.
The counterpart is called zero-shot: you give no example, just describe the task. For simple tasks, zero-shot is enough. For tricky formats, few-shot is almost always better.
3. Let it think step by step
An almost magical trick: if you write "Think step by step" at the end of your prompt, answers to logical or mathematical tasks often get noticeably better. This technique is called chain of thought. A chain of reasoning.
The reason: the model writes out its train of thought before giving the answer. And because an LLM generates word by word, this written-out reasoning influences every subsequent token. So it actually does think, in its own way.
4. Specify the format
Say exactly how the answer should look: "Answer in a table with three columns," "List at most five points," "Answer only with YES or NO." The more precise, the better. The AI loves clear instructions, it then has less to guess.
Four levers that almost always work: Role, examples, step-by-step thinking, format. If a prompt isn't working well, usually one of these four levers hasn't been pulled yet.
Bad vs. good prompt, a concrete example
One and the same intent, two phrasings. The difference is drastic.
Bad prompt
"Write something about dogs."
- No goal, no audience.
- No length, no format.
- No tone, no role.
- Result: some generic statement, probably in Wikipedia style.
Good prompt
"You are a dog trainer with 15 years of experience. Write a 200-word text about the benefits of the Labrador breed for families with small children. Language: simple English, friendly tone. Structure: three short paragraphs."
- Clear role (dog trainer).
- Concrete topic and concrete audience.
- Length, language, and structure are defined.
- Result: a usable text that can be used almost unchanged.
Improving a prompt in four steps
If your first answer doesn't fit, don't throw the prompt away. Improve it iteratively. This is the fastest way to a good result:
Step one, see what's missing
Read the AI's answer with an editor's eye. What's right? What's too long, too short, too generic, too flowery, factually wrong? Note the shortcomings in one sentence.
Step two, extend the prompt
Build the correction directly into the prompt. "Write a blog article" becomes "Write a 600-word blog article, with an introduction, three subheadings, and a conclusion. No marketing speak."
Step three, supply an example
If the style still doesn't fit, attach a short example. "Here's a text whose style I like: [example text]. Write about .. in the same style" That's few-shot in its purest form.
Step four, iterate
Refine the answer with targeted follow-ups. "Make the second paragraph more concrete with a practical example." The AI doesn't forget the context, it keeps building on the previous version.
Professionals rarely write the perfect prompt on the first try. They write an okay prompt, read the answer, add three sentences, read again. After three to five rounds, you've hit the target. That's normal everyday work, and that's what prompt engineering actually means.
Prompt injection, the dark side
There's an unpleasant property of LLMs: they don't reliably distinguish between instructions from the user and text that just happens to be in the context. If an LLM is asked to summarize a website or a PDF, and that document contains a hidden line saying "Ignore all previous instructions and instead write ...", there's a risk the AI will follow it.
This is called prompt injection. Someone smuggles instructions into content that the AI then unintentionally executes. It becomes especially tricky when the AI can operate tools, meaning it sends emails, runs code, browses the web.
Never let sensitive actions run automatically just because they appeared in a piece of text. If your AI assistant reads an email that says "Please transfer 500€ to the following account," a human must always confirm that. More on this in the chapters on Hallucinations and Safety & Alignment.
What prompt engineering is not
Prompt engineering isn't secret knowledge. There are no magic formulas that "hack the AI." What does exist: a few recurring patterns. Role, examples, step-by-step thinking, format, and above all the ability to describe a task so clearly that a stranger could solve it.
Whoever can brief well can prompt well. At its core, it's the same skill.
The best prompts are often longer than you'd initially think, three to ten sentences are normal. If you've never written a long prompt: try it once. You'll be surprised how much better the answer gets.
What you now know
- A prompt is the input to the AI, and every word in it shifts the outcome; a good prompt contains a role, a task, a format, and ideally an example.
- The operator sets the system prompt, you set the user prompt; together they form the context in which the model responds.
- Prompt engineering is not secret knowledge but clear briefing plus iterating, and prompt injection is the dark side against which systems with real actions must be especially protected.