Evergreen

Prompt Engineering: How to Get Useful Work Out of AI Agents and LLMs

Prompt engineering is not writing clever sentences. It is giving an agent a job it can actually do, with the tools, constraints, and checks it needs — then verifying the result instead of trusting it.

The loop

Perceive → Compare options → Plan → Act → Verify → Replan. A good prompt makes each step explicit. A bad prompt says “do this well” and hopes.

1. State the job, not the vibe

Bad: “Write a good summary.” Good: “Summarise this article in 5 bullets, each under 20 words, keeping every number and name exactly as written. If a fact is not in the article, say so instead of guessing.” The difference is checkability: the second prompt can be verified.

2. Give context, tools, and limits

Tell the agent: what it may use, what it may not touch, what format to return, and what to do when it is unsure. Agents fail most often at boundaries nobody stated — secrets, irreversible actions, and invented facts.

3. Use a framework, not a pile of tricks

A usable prompt template:

  • Role: what the agent is doing, in one line.
  • Goal: the exact deliverable.
  • Inputs: the facts, files, or tools it may use.
  • Constraints: format, length, tone, things to avoid.
  • Check: how the result will be verified, and what counts as failure.
  • Stop condition: when to ask a human instead of continuing.

4. Cheat sheet: prompts that survive contact with reality

  • Ask for a plan before the work, when the task has more than three steps.
  • Ask for sources, quotes, or exact values when accuracy matters — then check them.
  • Ask the agent to list its assumptions before it acts on them.
  • Break big tasks into small, verifiable steps; verify each step, don’t just verify the end.
  • Keep the human review point: agents should flag, not silently fix, consequential decisions.

5. Roadmap: beginner → reliable

  • Beginner: single clear task, one format, one check.
  • Intermediate: multi-step task with tools, constraints, and a stop condition.
  • Advanced: an agent that plans, uses tools, verifies its own steps, and hands back a checkable result with its assumptions listed.
  • Production: guardrails, tests, rollback, and a human in the loop for irreversible actions.

6. Common failures, and the prompt fix

  • Invented facts → “Use only the inputs given. Say ‘not in the inputs’ when unsure.”
  • Rambling output → fixed format, fixed length, fixed sections.
  • Tool misuse → list allowed tools, forbid the rest, require confirmation before irreversible actions.
  • Silent failure → “If you cannot complete a step, stop and report which step and why.”

Save this

This page is designed to be saved and reused: the template in section 3, the cheat sheet in section 4, and the checklist in section 6 work for coding agents, research agents, and everyday LLM use alike.

Related Agentic Affairs explainers