Question 25
Domain 3A team detects a system-field leak: `today's date` lives in the system prompt. Which fix is most aligned with API best practice?
Correct answer: C
Explanation
API best practice is to keep the system prompt stable and move variable request data into the user message, since system instructions should not leak changing fields. Labeling it as "Current date: …" makes the datum explicit while preserving a byte-stable system prefix, which reduces prompt drift and unintended exposure.
Why each option is right or wrong
A. Round the date to the nearest week so the prefix changes less often.
Rounding still leaves changing runtime data in the system prompt, only less frequently.
B. Delete the date entirely; the model can infer it from context.
Models do not reliably know the real current date unless you provide it.
C. Move the date into a labelled line at the top of the user message ('Current date: …') and keep the system prefix byte-stable.
OpenAI API prompt-assembly guidance treats the system message as the stable instruction layer, so changing request-specific fields there creates prompt drift and can expose internal scaffolding. The date is a per-request datum, so placing it in the user turn as a clearly labeled field preserves a byte-stable system prefix while still supplying the model with the needed context; that is the cleaner separation of instructions and variables the API design expects.
D. Add a second `cache_control` marker after the date to bound the cache differently.
Cache markers affect caching behavior, not the core issue of misplaced dynamic system data.