Skip to content
Back to AI Glossary
AI Definition

Prompt Engineering

"Prompt Engineering is the practice of writing and testing the instructions, examples and context a language model receives so an agent behaves reliably."

In short

What is a Prompt Engineering?

Prompt Engineering is the practice of writing and testing the instructions, examples and context a language model receives so an agent behaves reliably. Related product: Chat Agents.

Reviewed by , Co-Founder · Last reviewed

Deep Dive

Prompt engineering is the work of deciding what the model is told. For a voice or chat agent that includes the system prompt (role, rules, tone, transfer conditions), the per-flow instructions, the few-shot examples, the description of each tool, and the shape of the retrieved context. It is less about clever phrasing than about specification: the prompt is the agent's job description, and most agent failures are specification failures.

How it works. The loop is write, test, read transcripts, revise. A prompt is drafted from the business rules; a test set of 30-50 real customer messages is run through it; the outputs are reviewed against what a good human agent would have done; the prompt is changed; the set is run again. Inputs to the prompt at runtime are assembled by the platform: the static instructions, the retrieved passages for this question, the tool results, the conversation history. Good prompts are structured so these parts do not compete: hard rules first and short, reference material in retrieval rather than in the prompt, examples only for behaviors the rules fail to produce. Every change is versioned so a regression can be traced to the edit that caused it.

Why it matters for reliability. The same model with two different prompts can be a careful receptionist or a liability. Prompt quality determines whether the agent declines when it should, asks for the order number before promising anything, keeps replies short on voice, and transfers an angry caller on the second turn instead of the fifth. It also sets cost: a prompt that doubles in length doubles the input tokens on every turn.

Example. A SaaS team's support agent is answering billing questions well but occasionally tells customers to 'contact their account manager' when the company has none. The transcript review finds the phrase came from the model's general training. The team adds a rule near the top of the prompt, 'this company has no account managers; billing changes go through the billing form', and an example in which a customer asks about changing a card and the agent sends the form link. The test set is re-run, the phrase is gone, and the change is tagged as version 14 with the three transcripts that motivated it.

Prompt engineering vs system prompt. The system prompt is one artifact: the standing instructions the model reads first. Prompt engineering is the discipline that produces it and everything around it: how tools are described, how retrieved passages are framed, how examples are chosen and how all of it is tested. A good system prompt is the output; the test set and the versioning are what keep it good after launch.

Common pitfalls.

  • Rules written as personality ('be helpful and friendly') instead of behavior ('answer first, then ask one question').
  • Negative rules without alternatives ('never discuss pricing') that leave the model guessing what to do instead.
  • Adding a rule for every incident until the prompt is thousands of tokens and the early rules are ignored.
  • Testing on the author's own phrasing instead of real transcripts.

Botcadence agents are configured with instructions, document training and handoff rules per agent, and the website widget is typically live in under 5 minutes once documents are uploaded; see chat agents and system prompt.

See Prompt Engineering in a Botcadence agent

Start on the Free plan and configure an agent that uses Prompt Engineering on your own website chat or WhatsApp number. No card needed.

Get Started Free

Website chat live in about 5 minutes

Common Questions

Prompt Engineering FAQs

As short as the rules allow; a few hundred to a thousand tokens is common for a support agent. Facts belong in retrieval and only behaviors in the prompt. When a prompt passes a couple of thousand tokens, rules at the top start being skipped and every turn costs more.

No, but you need someone who reads transcripts and writes precise instructions, usually the person who trains new support staff. Engineering helps with versioning, test sets and tool descriptions; the content itself is operational knowledge.

Weekly for the first month, driven by transcript review, then whenever a policy changes or a recurring error appears. Every revision should be run against the same test set so improvements in one area do not regress another.

Mostly, with drift in verbosity and rule adherence. Re-run the test set after any model change; prompts tuned to suppress one model's habits can over-correct on a model that did not have them.

Ask AI about this page