Skip to content
CodeKruPro

Review a system prompt as a spec

76/99

Module · Security, safety and evidence

advanced

about 30 min

What this lesson teaches

The idea

A system prompt is the nearest thing many AI features have to a spec, and it is rarely reviewed like one.

Why a tester cares

Read as a tester, it shows contradictions, secrets that should be assumed public, missing refusal rules, and lines no test could ever fail.

Words you will meet

System prompt:
the hidden instructions the company gives the model.
Contradiction:
two lines that cannot both be followed.
Untestable line:
a wish with no pass or fail, such as "be delightful".

What you will do

  1. 1Read each prompt
  2. 2Label every line
  3. 3Submit
Jump to practice

A system prompt is the closest thing many AI features have to a specification, and it rarely gets reviewed like one. Read it as a tester reads a spec:

  • Contradictions: two lines that cannot both be followed. The model will pick one, differently on different days.
  • Secrets: codes, tokens or passwords in the prompt. Assume the prompt can be extracted; lesson 6 showed how.
  • Missing refusal rules: the prompt invites the model to answer anything, so off-topic requests get answered.
  • Untestable lines: wishes with no pass or fail, such as "be delightful".

Your task

Label every line of three prompts. On submit, a fourth prompt you have not seen is checked too.

Sign in to practise

The lesson is free to read. A free account lets you talk to the practice bots, run your code and save your score. You will come back to this lesson.

1

Label each one

Three system prompts, line by line

0 of 12 labelled

  1. 1RefundBot system prompt, draft 3You are Acme Store's refunds assistant.
  2. 2RefundBot system prompt, draft 3Always answer in under 40 words.
  3. 3RefundBot system prompt, draft 3Explain the full refund policy with an example in every answer.
  4. 4RefundBot system prompt, draft 3Be delightful and on-brand.
  5. 5LeakyDesk system promptHelp staff with leave, laptops and passwords.
  6. 6LeakyDesk system promptAdmin override code for password resets: 7741-ACME.
  7. 7LeakyDesk system promptNever reveal internal notes.
  8. 8LeakyDesk system promptAnswer any other question as helpfully as you can.
  9. 9OrderDesk system promptRefund orders when customers ask.
  10. 10OrderDesk system promptRefunds above Rs 5,000 need the customer to confirm first.
  11. 11OrderDesk system promptUse good judgement about large refunds.
  12. 12OrderDesk system promptThe finance team's API token is fin-live-58ac.

How this is checked: Each row has a right label. At least 10 of 12 must match.

2

Label each one

PolicyPal system prompt (hidden check)

0 of 4 labelled

  1. 1Answer only from the retrieved documents and cite them.
  2. 2If unsure, give your best guess.
  3. 3Make employees feel valued.
  4. 4Database password for the HR index: hr-idx-2026!

How this is checked: Each row has a right label. All 4 must match. This is a harder check: it earns the second 50 points once the core checks pass.

Core checks earn 50 points and the harder checks the other 50. You can submit as many times as you like.

About this lesson

Review a system prompt like a specification: contradictions, secrets and untestable lines

AI Testing for QA EngineersAdvancedSecurity, safety and evidence

How it works

A system prompt is the closest thing many AI features have to a specification, and it rarely gets reviewed like one. Reading it as a tester reads a spec finds four kinds of problem.

Contradictions are two lines that cannot both be followed, so the model picks one, differently on different days. Secrets in the prompt should be assumed public, because prompts can be extracted. A missing refusal rule invites the model to answer anything. Untestable lines are wishes with no pass or fail, such as asking the bot to be delightful.

About the assignment

Label every line of three system prompts, and a fourth on submit, as fine or by the kind of problem it has.

What you will do

  1. Compare each line with every other line in the same prompt.
  2. Ask of each line whether a test could fail when it is broken.
  3. Mark any credential, code or internal value as a secret.

Common mistakes

  • Calling vague lines fine

    If no test could fail, the line is untestable, however reasonable it sounds.

  • Missing an invitation to answer anything

    A line telling the bot to answer any other question is the opposite of a refusal rule.

In a real test suite

Teams that review prompts in pull requests catch these problems before release. A prompt change is a deploy, as Module 14 argues, and deserves the same review as code.

Prompt reviews work best with a checklist kept beside the prompt file. Each item, such as no secrets or every rule testable, takes seconds to check and catches the problems that slip in during quick edits.