Keep an agent from tidying load-bearing legacy code

Judgment callHard25 minAnthropic and OpenAI style

Your task

You inherited a 15-year-old Java monolith with no docs and few tests. It is full of code that looks wrong but makes up for something elsewhere: a sleep before a call, a field set twice, a catch that swallows one exception type. You want a coding agent to help modernize it, but the agent cannot tell a bug from a deliberate workaround.

How do you put the agent to work without breaking what holds the system up? Decide what it does first, what it may change, and what you check.

It covers

  • Legacy
  • Unfamiliar code
  • Guardrails