Sub topic 13
Design Practices and Pitfalls
This chapter assumes you have built a prompt template in Prompt Builder, added it to an agent as an action, and tested it. It collects the design habits that keep that setup reliable, and the errors that most often break it.
Keep Responsibilities Separate
A prompt template, topic instructions, and the action's inputs and outputs each do a different job. Most problems come from putting a rule in the wrong place.
| Layer | Job | Typical mistake |
|---|---|---|
| Topic scope and instructions | Decide when the agent calls the action and what it does with the result | Repeating the full writing rules of the template |
| Prompt template | Define how the text is written, from which data | Asking the model to find data it was never given |
| Action inputs and outputs | Pass the right record in, return the text out | Leaving an input unmapped or ambiguous |
If the agent calls the action at the wrong time, change the topic. If the text is wrong, change the template.
Design the Template Defensively
Ground the answer in data you supply, and tell the model what to do when data is missing. The template from earlier chapters does this with two rules:
Rules:
- Use at most five sentences.
- Use only the information above. If something is missing, say it is unknown.
- Do not promise refunds or dates.Follow these habits:
- Pass only fields the task needs. Extra fields add noise and expose data you do not need to expose.
- State limits in measurable terms, such as "at most five sentences", instead of "be brief".
- Name the forbidden behavior, such as promising refunds, instead of hoping the model infers it.
- Keep one template to one job. A template that summarizes, classifies, and drafts a reply is hard to test and hard to select from a topic.
Write Topic Instructions the Agent Can Follow
Instructions should name the action and the condition for using it. Compare a vague instruction with a precise one.
Vague: Help with cases.
Precise: When the user asks for a case summary, ask for the case number if it was not given. Once the case is identified, use the Summarize Case action and return its output without rewriting the facts.Give the action a clear name and description, because the agent reads them when it decides what to call. Limit the topic scope with a sentence on what it does not do, so that neighboring topics do not compete for the same request.
Common Pitfalls
- Testing only in Prompt Builder. A template can pass preview and still fail in the agent, because the agent must pick the action and supply the input. Test both.
- Previewing with one friendly record. Try records with empty fields, long descriptions, and unusual statuses.
- Editing an active version. Create a new version, test it, then activate it. Agents using the template pick up the active version, so a careless change reaches users at once.
- Letting the agent rewrite the output. Without an instruction to return the output as is, the agent may paraphrase and drop or change facts.
- Ignoring access. The data the template reads depends on who runs it. Check permissions for the users of the agent, not only for your admin account.
- Treating the Trust Layer as a full guarantee. It masks sensitive data and applies safeguards, but it does not make a wrong or poorly grounded answer correct.
A Short Review Checklist
Before you activate a version, confirm that:
- The template uses only the resources it needs, and missing data produces "unknown".
- Topic scope and instructions name the action and when to call it.
- The action's input is mapped to a record the user can identify.
- You tested records with missing and long values, in both Prompt Builder and Agent Builder.
- A new version is activated, not an edit to the live one.
Exercise
A user asks the agent for a case summary, and the agent answers in its own words without calling the Summarize Case action. The template itself previews correctly. Which layer do you change first, and what do you change?
Show answer
Change the topic. The template works, so the fault is in selection. Check that the topic's classification description and scope cover case summaries, and add an instruction such as "When the user asks for a case summary, use the Summarize Case action and return its output without rewriting the facts." Then retest in Agent Builder.
Exercise
Why should you create a new template version instead of editing the active one?
Show answer
Agents use the active version. Editing it changes live behavior before you have tested it. A new version lets you test first and activate it when ready, and you can return to the earlier version if the new one performs worse.