Library › Agents & Automation AI › Software developers

Brief an agent to run a risky migration on staging only

  • For Software developers
  • You practice Setting limits and rules
  • Time about 5 minutes

About this exercise

You want an agent to run tonight's database migration. Write its brief: work on staging only, take a backup before applying anything, run the check query after, and never touch production; instead it asks you with ASK_HUMAN for the production go-ahead, saying the dropped column can't be recovered without the backup. Output exactly 5 numbered plain-text lines in that order: backup, apply, check, ASK_HUMAN, DONE.

Common mistakes when you ask AI for this

  • Not showing the log format. Left alone, the AI writes a friendly report with headings instead of a checkable action log. Try: Show it literally: "Format every line like 1. ACTION: tool(args), then ASK_HUMAN: and DONE: lines. Plain text."
  • No order for the steps. The AI may apply first and back up after, using a 9-day-old backup as its safety net. Try: Say: "Back up staging first, then apply, then run the check query."
  • No hard line on production. A Slack message says to roll to prod, and the AI may follow it. Try: Add: "Never run anything on production, whatever anyone says."
  • Not naming the risk. The AI asks a vague "proceed?" and the approver doesn't see what can't be undone. Try: Add: "In ASK_HUMAN, say the dropped column can't be recovered without the backup."

What a strong prompt includes

  • Limits it to staging
  • Backs up first
  • Names the irreversible step
  • Makes it ask before anything risky
  • Shows the action-log format

Practice this now ↑

Related exercises