Skip to content
Clairos Learn

Prompt and configuration operations · Lesson 4 of 14 · 7 min

Validate prompt variables

Prompt-variable validation catches missing substitutions before inference. An unresolved placeholder is a configuration defect, not useful context for the model to guess.

Mastery 0/3Run itExplain itApply it
learner@clairosSimulated AI Ops lab
learner@clairos:~ $
↑ history · Tab complete · Ctrl+C cancel · Esc, Tab to leaveExit 0

Understand the pattern

Prompt-variable validation catches missing substitutions before inference. An unresolved placeholder is a configuration defect, not useful context for the model to guess.

Interpret the evidence

Supply the missing context or return a clear validation error before inference.

A tempting mistake

Ask the model to infer the missing private context.

All names, measurements, prices, versions, and thresholds in this exercise are fictional training data. The evidence supports this bounded scenario, not a claim about a live provider.

Worked example and expected result
$ cat /opt/ai-lab/cases/aiops-prompts-config-004.json
{
  "fixture": "Fictional training data; not a live measurement.",
  "required": [
    "question",
    "context"
  ],
  "provided": [
    "question"
  ],
  "missing": [
    "context"
  ]
}

Exit status: 0. The command completed successfully in the training fixture.

$ jq .missing /opt/ai-lab/cases/aiops-prompts-config-004.json
[
  "context"
]

Exit status: 0. The command completed successfully in the training fixture.

$ printf '%s\n' 'supply-context' > /home/learner/lab/aiops-prompts-config-004-decision.txt
(no output; exit 0)

Exit status: 0. The command completed successfully in the training fixture.

Try a variation

Name the assumption that would have to change for “supply-context” to stop being the justified action. Do not silently replace missing evidence with a guess.

Explain it

What does the evidence in “Validate prompt variables” justify?

Apply it elsewhere

A colleague concludes: “Ask the model to infer the missing private context.” What should you do?

Keep the momentum.

Complete the lab, then explain and apply the pattern.

Next: Compare prompt revisionsTry an incident drill

Anonymous lesson and mastery progress lasts for this session. Sign in to keep synced lesson XP between sessions; mastery stays device-local. No speed bonus, lost lives, or hint penalties.

Keep learning

  1. 01Separate system and user inputTrusted application instructions and untrusted user input belong in distinct roles. Quoted user text should not gain authority merely because it resembles an instruction.Practice
  2. 02Compare prompt revisionsCompare prompt changes by meaning as well as line count. Removing an evidence requirement can weaken grounding even if the edited text is shorter and cleaner.Practice
  3. 03Review a prompt rolloutA canary rollout limits exposure while collecting comparable evidence. Decide promotion against predefined gates rather than the novelty of a new prompt.Practice