07 / 1823 min read

Prompts Are Specifications

Turn intent into instructions a system can follow, test, and improve.

The instruction stack

A prompt is not only the sentence typed into a chat box. Agent behavior is shaped by a stack: product policy, system instructions, the current request, retrieved context, examples, tool descriptions, output schemas, and observations returned during the run. These layers may live in code, configuration, files, databases, and messages rather than one block of prose.

When the output is wrong, identify which layer owned the missing decision. A universal policy belongs in system instructions. A fact about this customer belongs in task context. A required JSON shape belongs in a schema. A risky action belongs in tool policy. Patching everything into the user message creates a prompt that is long, contradictory, and impossible to maintain.

A prompt becomes engineering when another person can test whether it carried the right intent into action.

Prompt types should match the work

Use static instructions for stable behavior, parameterized templates for repeated work with variable inputs, conditional instructions for known branches, retrieval-backed instructions when the answer depends on external truth, and composed instructions when several bounded stages must cooperate. The more dynamic the instruction, the more its assembly needs observability and tests.

Do not use a sophisticated prompt shape to conceal an undefined workflow. If the task has no agreed outcome, a dynamic prompt merely generates different interpretations faster. First define the job; then choose the smallest instruction mechanism capable of expressing it.

  • Static: stable policy and narrow recurring tasks.
  • Parameterized: repeatable templates with typed variables.
  • Conditional: explicit branches driven by known state.
  • Retrieval-backed: current facts assembled from authoritative sources.
  • Composed: several prompts or workers connected by validated artifacts.

Anatomy of an executable specification

A strong instruction names the objective, relevant background, authoritative inputs, constraints, non-goals, allowed actions, decision policy, output contract, failure behavior, and verification. It tells the worker what good looks like without dictating every token of implementation.

Separate facts from commands. Mark external content as untrusted evidence. Distinguish must, should, may, and must not. Give examples when form or judgment is hard to describe, but include counterexamples and edge cases so the worker does not mistake one demonstration for the whole task.

Write in the language of observable behavior. ‘Be careful’ cannot be evaluated. ‘Do not send externally; return a draft with recipient, subject, body, attachments, and unresolved claims’ creates a boundary another person and a test can inspect.

Case file

from ‘summarize tickets’ to a support decision spec

A support leader asks an agent to summarize yesterday’s tickets. The first output is polished but useless: it groups by broad theme, misses the urgent account, includes resolved noise, and provides no path back to the source cases.

The team rewrites the job as a decision specification. The objective is to prepare the morning escalation review. Inputs are tickets created or reopened in the last twenty-four hours plus account tier and incident state. The agent must identify unresolved customer impact, cluster only when evidence supports the relationship, cite case identifiers, separate fact from inference, and return owners plus missing context.

The new prompt is stored with five representative days and expected escalation decisions. A model or instruction change must run against those cases before replacing the current version.

Decisions made

  1. 01Replace a content request with the decision the output must support.
  2. 02Name authoritative inputs, time window, exclusions, and uncertainty behavior.
  3. 03Require structured output with links back to source cases.
  4. 04Version the instruction with representative regression examples.

The improvement did not come from more persuasive wording. It came from turning tacit managerial judgment into a testable interface between intent and execution.

Specifications are versioned assets

When an instruction drives recurring or consequential work, treat it like source code. Give it an owner, version, change history, representative cases, evaluation results, and a rollback path. A change to the prompt, model, context assembly, tool inventory, or output schema can alter the system even when application code stays untouched.

Keep stable instructions separate from dynamic context so changes are legible and caching remains possible. Store templates close to the workflow they govern. Record which version produced each run. Promote corrections from production failures into the specification or its test suite rather than relying on someone to remember a better sentence next time.

Prompt maturity is operational maturity

A prompt often begins as a request, becomes a checklist, then a reusable template, a typed contract, a context-aware specification, and finally one component inside a measured workflow. The goal is not maximum sophistication. The goal is enough structure for the consequence and variability of the task.

Manual prompting is valuable early because it exposes ambiguity. Automating prompt optimization before you understand failure modes can improve a metric while weakening the actual work. Develop domain judgment first, capture representative corrections, then automate the parts whose quality you can already recognize.

Failure mode: prompt patching

A brittle system responds to every error by adding another warning to the prompt. Soon the instructions contain exceptions to exceptions while the real defect lives in stale context, an overly broad tool, a missing type, a poor model fit, or an undefined workflow.

Classify the failure before editing text. Ask whether the model lacked knowledge, misunderstood the objective, received conflicting context, used the wrong tool, crossed an authority boundary, or had no way to verify the result. Repair the layer that owns the problem and add a regression case.

Across the business

What this looks like in other departments

The engineering principle stays the same; the workflow, risk, and proof change with the domain.

Finance

Variance explanations

Specify authoritative ledgers, materiality thresholds, comparison periods, permitted inferences, citation requirements, and when the agent must return an unresolved question.

People & HR

Policy guidance

Separate policy text from employee-specific context, require effective dates and source links, and prohibit the agent from making eligibility promises it cannot verify.

Customer support

Response drafting

Define tone, evidence, account actions, escalation rules, prohibited commitments, output fields, and the human review required for sensitive cases.

Operations

Daily exception briefs

Specify which systems are authoritative, what qualifies as an exception, how items are ranked, who owns the next action, and what evidence closes an item.

Technical deep dive

The specification compiler

Use this sequence to turn an ambiguous request into a versioned instruction package the workflow can execute and evaluate.

  1. 01FrameName the user, decision, outcome, consequence, and why this work should exist before writing instructions.
  2. 02SeparatePlace durable policy, task variables, retrieved facts, examples, tool contracts, and output schemas in distinct owned layers.
  3. 03ConstrainDefine authority, non-goals, source hierarchy, uncertainty behavior, stopping conditions, and the exact side effects that remain prohibited.
  4. 04DemonstrateAdd representative successes, edge cases, counterexamples, and dangerous cases that reveal judgment more clearly than explanation alone.
  5. 05VersionBind the instruction package to a version, case suite, owner, change note, system configuration, and rollback candidate.

Reference schema

spec.objective: decision + user + measurable outcome
spec.inputs: source + schema + freshness + trust class
spec.instructions: must + should + may + must_not
spec.authority: tools + side effects + approval gates
spec.output: format + required evidence + uncertainty
spec.evaluation: cases + rubric + deterministic checks
spec.version: owner + change + configuration + rollback

Try it yourself

Turn one request into a specification

Choose a request your team gives repeatedly and rewrite it as an instruction package another person could evaluate.

  1. 1Name the decision and user outcome behind the request.
  2. 2Separate policy, variables, current facts, and examples.
  3. 3Write constraints, non-goals, output fields, and failure behavior.
  4. 4Create three normal cases, two edge cases, and one dangerous case.

Reusable artifact

Executable specification

A reusable prompt contract for consequential recurring work.

Objective: [decision and outcome]
Authoritative inputs: [sources and freshness]
Instructions: [must / should / may]
Non-goals: [explicit exclusions]
Authority: [tools, writes, approvals]
Output: [schema and evidence]
Failure behavior: [ask / abstain / escalate]
Evaluation: [cases and acceptance rubric]

Before you move on

Receipt checklist

  • The instruction supports a real decision rather than a vague content request.
  • Stable policy, dynamic context, tools, and output schema are separate.
  • A representative case suite can detect regressions.
  • Every production run identifies the specification version used.

Primary sources

Further reading

Home
Book
Blog
Calugaru Labs
GitHub
LinkedIn
Email
Theme