You are reading the free preview: the preface and chapters 1 and 2. Get the full book (£5.99) to read all 16 chapters online, plus the PDF and EPUB.

Preface

Shipping a working prototype on a frontier model takes an afternoon. Shipping that same workflow as a reliable, observable, audited production system takes a quarter. This book is about closing that gap.

Most material on prompt engineering sits at one of two extremes. At one end are abstract think-pieces about where AI is heading. At the other are tactical lists of one hundred prompts to copy and paste. Neither helps the engineer who has a prompt working on their laptop and now has to make it survive contact with real users, real traffic, real cost ceilings, and real regulators.

This book is the missing middle. It treats prompts the way we already treat code: as artifacts that must be versioned, tested, monitored, secured, and governed. If you have ever watched a prompt that “worked yesterday” silently start producing worse answers today — and only found out from a customer ticket — this book is written for you.

Who this book is for

You are an engineer, data scientist, ML practitioner, or technical lead who has moved past the demo stage. You can already get an LLM to do something useful. What you need now is the discipline and tooling to make it dependable. You do not need a research background. You do need to be comfortable reading code and thinking about systems.

Managers and product leaders will find the non-technical section at the end of each chapter useful for understanding what their teams are wrestling with and why “just tweak the prompt” is rarely the whole story.

How to use this book

The book works two ways. Read it front to back the first time — the chapters build on each other, moving from foundations through engineering discipline, reliability, and finally organisational concerns. After that, treat it as a reference. Each chapter ends with a reusable template or checklist, and the appendices collect these into a toolkit you can apply directly to your own systems.

Every chapter follows the same rhythm: a real failure, the concept that prevents it, a technical implementation you can adapt, a short section framed for your team or manager, and a checklist or template to take away.

A note on code and models

Code examples are written to be model-agnostic wherever possible. The principles do not depend on which provider you use, and they will outlast any specific model version. Where a concrete API is needed, examples favour clarity over cleverness.

Listings are kept to sixty-eight characters or fewer so that they set cleanly on the printed page without wrapping. Where a line must be longer, it is broken deliberately rather than left to the typesetter.

A note on this edition

This is the first edition, current as of August 2026. Model behaviour, provider APIs, and tooling in this field move faster than print does. The disciplines in this book are chosen precisely because they outlast any of those things — but where a specific tool or API is named, check it against current documentation before relying on it.