Exams / DBX-CEA / D1 System Prompt and Instruction Design
System Prompt and Instruction Design
- Exam domain: System Prompt and Instruction Design
Grounding instructions in a RAG agent
The system prompt is the interface between retrieved data and the model. If it does not say how to weigh retrieved passages against pretraining knowledge, the model may answer from memory.
| Symptom | Likely cause | Fix |
|---|---|---|
| Right passages in context, but answer uses stale training knowledge | Weak or missing grounding instruction | Add an explicit "base the answer on the provided context, not on training data" sentence |
| Model silently picks one of two conflicting sources | No conflict-handling rule | Tell it how to handle conflicting or missing information |
| Answer invented when context is insufficient | No "insufficient context" rule | Define what to do when context lacks the answer |
Cheap fixes (one sentence in the prompt) come before changing retrieval infrastructure. Change one variable at a time and measure it on your evaluation metrics.
Tool descriptions and routing
An agent chooses tools from their descriptions. Databricks Supervisor Agent docs: "For better results, provide a description for each tool/sub-agent." and "The supervisor uses the information in the description to help it coordinate agents." When two working tools overlap in apparent scope (live inventory vs static catalog), the cause of wrong routing is ambiguous descriptions and routing guidance, not the data.
Context failure modes
| Mode | What happens |
|---|---|
| Poisoning | A wrong statement enters context and is treated as fact, then reused |
| Distraction | Context so long the model drifts from the task |
| Confusion | Irrelevant content or tools influence the response |
| Clash | Parts of the context contradict each other |
In the billing trace the outdated FAQ claim becomes the agent's own summary, is reused turn after turn and overrides the correct policy: poisoning.
Reasoning mode and cost
Databricks reasoning models expose effort controls: "Higher reasoning effort may result in more thoughtful and accurate responses but may increase latency and token usage." For a high-throughput, latency- and cost-bound classification task, choose low/reduced reasoning. Note budget_tokens is deprecated for newer Claude models; Databricks recommends adaptive thinking with output_config.effort.
Few-shot examples vs prose
Examples "better condition the model to respond as desired" and show the behavior directly. When comparing prompt configs in MLflow, evaluate versions on the same dataset and weigh accuracy gain against token and latency cost.
Exam traps
- Stale answers with correct passages present = missing grounding instruction, not retrieval failure, not a training cutoff disclaimer, not formatting.
- Poisoning (wrong fact reused) is not clash (contradictory sources producing inconsistent output).
- High volume + tight latency + cost = reduced reasoning, not full extended thinking and not none when judgement is needed.
- Attribute accuracy gains to the element that changed in kind (few-shot examples), not to token count.
- Wrong tool chosen although both work = ambiguous descriptions/routing guidance.
Docs
- https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/rag/rag-prompt-engineering
- https://docs.databricks.com/aws/en/machine-learning/model-serving/query-reason-models
- https://docs.databricks.com/gcp/en/generative-ai/agent-bricks/multi-agent-supervisor
- https://docs.databricks.com/gcp/en/mlflow3/genai/prompt-version-mgmt/prompt-registry/evaluate-prompts
- https://learn.microsoft.com/en-us/azure/ai-foundry/openai/concepts/prompt-engineering