Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Databricks · Databricks Context Engineer Associate

System Prompts: Altitude, Fixes, Few-Shot Examples

Databricks Context Engineer Associate · Lesson 4 of 18 · 20:30

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Databricks Certified Context Engineer Associate exam. In this lesson: writing a system prompt at the right altitude, revising a misfiring prompt with a targeted change and a new evaluation, choosing few-shot examples by their marginal contribution (tool paths, output structure, ambiguous inputs), and the token cost of every instruction. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

A prompt that kept growing

Thistledown's support prompt has grown, one rule at a time, to three pages and forty examples. Every request now costs more, and the agent refuses questions it used to answer well. This lesson shows how to write a system prompt at the right altitude, how to revise one that misfires, and how to choose the few examples worth their tokens.

The right altitude

A system prompt can fail in two opposite ways. Too low, it hard codes brittle if then logic for every case, which breaks on the first unexpected request, and is costly to maintain. Too high, it gives vague guidance that assumes the model shares your context, which it does not. The right altitude is specific enough to guide behavior, and flexible enough to let the model use good judgment, organized in clear sections like role, rules, tool guidance, and output format. Aim for the minimal set of information that fully describes the expected behavior, which is not always short, then add instructions only for failures you have observed.

Revising a prompt

When a prompt misfires, start from the failure pattern in the traces, not from a guess. Find the instruction behind it: one that is too rigid, too vague, or that contradicts another instruction. Change that instruction, instead of adding a new patch for every case, since patches pile up into the brittle prompt you wanted to avoid. Then rerun the evaluation, to confirm that the failure is fixed, that nothing else broke, and that the token cost stayed flat.

Choosing examples

Few shot examples are one of the strongest ways to show an agent what good looks like. But a laundry list of edge cases is the wrong use: choose a small set of diverse, canonical examples instead. Each example must earn its tokens, by showing a tool path that no other example covers. Or by showing the exact output structure the agent must produce, like a work order in JSON. Or by showing how to handle an ambiguous input, for example by asking a clarifying question.

Examples on a token budget

Examples are expensive context, since they are sent with every request. Measure what each one contributes, by running the evaluation with and without it. Keep examples in sync with the tools and the output format, since an example that calls a renamed tool creates a clash with the tool list. And when two examples teach the same thing, keep the clearer one.

Recap

Let's recap. Write the system prompt at the right altitude, between brittle logic and vague guidance. Start minimal, and add instructions only for observed failures. Fix a misfiring prompt by changing the instruction behind the failure, then rerun the evaluation. Choose a few diverse, canonical examples, each covering a tool path, an output structure, or an ambiguous input. And measure each example's contribution, since examples are sent with every request.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A rule says never discuss money, to avoid financial advice. Now the agent refuses to state the deposit written in the tenant’s lease. Which revision fixes this with the least added cost?

    • Add twenty examples of allowed deposit questions
    • Move to a larger model
    • Rewrite the whole system prompt
    • Narrow the rule: state lease amounts, give no financial advice
    Show the answer

    Narrow the rule: state lease amounts, give no financial advice

    Narrow the rule to its real intent, so the agent states amounts from the lease, but gives no financial advice. “Add twenty examples of allowed deposit questions” is wrong, since twenty examples add many tokens, and leave the faulty rule in place. “Move to a larger model” is wrong, since a larger model still obeys a rule that tells it to refuse. And “Rewrite the whole system prompt” is wrong, since rewriting the whole prompt risks new failures, and costs far more effort than one targeted fix.

  2. The token budget allows three examples, and the team has four candidates. Which candidate should be left out?

    • The only example of the JSON work order structure
    • A second rent balance example, like the first one
    • The only example of a clarifying question
    • The only example that calls the parking tool
    Show the answer

    A second rent balance example, like the first one

    The second rent balance example repeats a pattern the first one already covers, so it adds tokens without adding coverage. “The only example of the JSON work order structure” is wrong, since it is the only example that shows the required work order structure. “The only example of a clarifying question” is wrong, since it is the only example that shows how to handle an ambiguous message. And “The only example that calls the parking tool” is wrong, since it is the only example of the parking tool path.

  3. After twelve new examples, evaluation scores stay the same and tokens per request grow by 30%. What should the team do?

    • Keep them all, since they do no harm
    • Add more examples until scores move
    • Remove examples one at a time, keep those that move scores
    • Move to a larger model
    Show the answer

    Remove examples one at a time, keep those that move scores

    Remove examples one at a time against the evaluation, and keep only those that move the scores. “Keep them all, since they do no harm” is wrong, since examples that add nothing still cost tokens on every request. “Add more examples until scores move” is wrong, since more examples would add cost, with no sign that they help. And “Move to a larger model” is wrong, since a larger model does not remove the useless tokens, it only makes each one cost more.