T03-L04 · Prompting & context · Level 4 Integrator · 18-minute read, plus 4 hours of doing

Two copies of the same prompt

The clinical research group's extraction prompt has grown up. At Level 3 a PhD student ran it by hand with a test set in a folder. Now it runs every night on the institute's server, reads new abstracts from the literature feed and writes rows straight into the group's review database, where four people screen them. On Monday a reviewer notices that sample sizes are back to being guessed. The test folder says the prompt is fine. It is: the folder holds version 2. The server holds a copy someone edited on Friday "to catch more outcomes". Nobody knows which of the 340 rows written since then came from which copy.

In a company the prompt sorts about 200 customer emails a day into queues inside the helpdesk system. Its text lives in the helpdesk's admin screen. A team lead with admin rights pasted in a new version on Thursday afternoon, and by Friday morning cancellation requests were sitting in the general queue. The old text is gone.

You are at Level 4 Integrator. The prompt now touches real systems: a review database, a customer inbox. A bad change reaches real records and real customers before anyone reads them. This book shows you how to make every change pass tests and a person, release it under a name, and undo it in minutes.

After this you can

  • Move a shared prompt and its test set into a repository on your organisation's code server, with access limited to the people who need it.
  • Make every prompt change go through a pull request that runs the test set automatically and needs one named reviewer's approval.
  • Release a tested version to production by its tag, and record that tag with every output the prompt produces.
  • Roll production back to the previous release in under ten minutes, and find the outputs the bad release produced.
  • Get IT and your data protection officer to sign off where the repository, the test cases and the keys live.

Before you start