Guide

Prompt engineering for product teams, without the mystique

The five patterns we use across every production agent: role framing, structured output, evaluation harness, cost caps, and escalation. Nothing proprietary.

A product team reviewing a prompt evaluation dashboard with pass and fail rates

Product teams get sold the idea that prompt engineering is a secret skill. It is not. It is five patterns, applied with discipline, and the teams that get them right ship agents that stay in production.

What are the five patterns?

  • Role framing. The first lines of the prompt tell the model what it is and what it is not. "You are a three-way-matching agent. You do not write marketing copy. You do not invent SKUs." Explicit boundaries reduce drift.
  • Structured output. Every agent call returns JSON with a schema you own. No prose. If the model cannot fill the schema, it says so and escalates.
  • Evaluation harness. Every prompt change runs against a set of real examples with known-good answers. Pass rate goes down, change rolls back.
  • Cost caps. Every call has a maximum token spend and a maximum retry count. No infinite loops. No surprise bills.
  • Escalation path. When the agent cannot answer, it hands off to a human with the exact context, the question, and the attempted answer.

How do I evaluate prompts over time?

A production evaluation harness has three pieces:

  1. A fixture set. 50 to 200 real examples with known-good answers, versioned in your repo.
  2. An automated runner. A CI job that re-runs the fixture set on every prompt change and every model release.
  3. A pass threshold. A number below which the change does not merge, no matter who wrote it.

Teams that skip the harness end up re-platforming every six months because they cannot tell which change broke which workflow.

What is a reasonable cost cap?

For most production agent calls, we see three tiers:

TierMax tokensMax retriesTypical use
Fast2,0001Status lookups, simple answers
Standard8,0002Reasoning over a document
Deep32,0003Multi-step research or planning

Pick the tier per endpoint, not per team. One endpoint, one cap.

FAQ

Do I need a prompt engineer on the team?

You need someone who treats prompts like code: version control, tests, and a diff review process. That person is usually already on the team.

Which model should I start with?

Start with whichever model your evaluation harness scores highest on your actual tasks. Model preference without evaluation is a vibe.

Want this applied to your business? Talk to us.

Agent engineering services

Related reads

Spreadsheet of LLM evaluation fixtures with pass rates
Guide

Evaluating LLM outputs: a practical harness for small teams

Diagram comparing an AI chatbot and an AI agent transacting through an API
Guide

What is an AI agent (and what it isn't)

Prompt engineering for product teams, without the mystique | DQueens