Entry

What is a system prompt and what belongs in it?

I think of a system prompt as the highest-priority instruction block for a conversation. It tells the model who it is, what job it is handling, and which rules it must follow.

How to answer it in an AI engineer interview: what is being tested, a step-by-step framework, a sample answer and the mistakes to avoid.

$19.99 on Gumroad, instant download

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Practiced one out loud? Paste your answer into the free self-check and get a score in 30 seconds

What the interviewer is testing

Whether you can define a system prompt, separate stable instructions from request data, keep secrets out of it, and explain how caching and refusals affect behavior.

Answer framework

  1. Put the assistant's role, task scope, and non-negotiable rules in the highest-priority instruction block.
  2. Define output style, required structure, and the desired level of detail.
  3. State refusal behavior for requests that fall outside the allowed scope.
  4. Keep the system prompt stable across requests so the same prefix can be prompt-cached.
  5. Keep secrets and credentials out of it, assume its contents can be extracted, and put per-request data in the user turn.

Sample answer

I think of a system prompt as the highest-priority instruction block for a conversation. It tells the model who it is, what job it is handling, and which rules it must follow. I put the stable role, scope, behavioral rules, output style, and refusal behavior there. I also define the required output format, such as a schema or concise sections, so the task is explicit before the conversation starts.

One practical rule is to keep that block stable. A stable prefix can be prompt-cached, so the provider may reuse that computation across requests. I separate that shared policy from request-specific information. If a user supplies a document, question, or other request payload, I put it in the user turn rather than rebuilding the system prompt for every call.

I never put secrets in the system prompt. The prompt can be extracted, logged, cached, or shown to someone reviewing the application, so I assume any value there is visible and treat it as unsafe. The same applies to credentials and sensitive data. In an interview, I would explain that the system prompt sets policy, but it is not a security boundary. I would enforce authorization and data protection in the application around the model.

Likely follow-ups

How do I keep a system prompt from becoming too long? I keep only stable instructions such as role, scope, rules, style, and refusal behavior, then put request-specific data in the user turn.
Can the system prompt be used to protect sensitive information? I would not treat it as a security boundary. I assume its contents can be extracted, so secrets stay out and access controls live in the application.
What if a user asks for something the system prompt forbids? I give the system instructions precedence and apply the refusal behavior defined there.

Common mistakes

The PlaybookWant the full method?

The 0 to 1 AI Engineer Interview Playbook covers the answer frameworks, system-design walkthroughs and an 8-week plan.

Get the playbook

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Interviewing for PM or TPM? See the full PM package, $59 on Gumroad: a resume system, a PM, TPM and PGM interview handbook, a 1:1 cheat sheet and a PM playbook. PM and TPM content, not AI engineer prep.

Related questions

Based on question #24 in the full question bank.

AI Engineer Interview PlaybookStructured practice for AI engineer interviews

A structured interview practice pack with prompts and scoring notes for AI engineer rounds. Price is $19.99.

Get the AI Engineer Interview Playbook, $19.99

Also: Grok Bot Team Setup Pack ($49)