The short version

Start in one area with a maintainer, a documented behavior and an isolated way to run the relevant checks. Decide what the agent may read, change and run. Widen those boundaries in separate steps as the team learns what it can verify.

Choose one behavior a maintainer can explain

A large repository usually contains more than the code for your ticket. Similar paths may serve different products, release branches may behave differently, and part of the business logic may live in jobs or services maintained by another team. Identify the active path before choosing a first change.

A good candidate has a maintainer who can state the current rule, an approved way to reproduce it, and a narrow change that can be reviewed in a single sitting. Begin by adding coverage or fixing a well-understood local failure. Move the trial elsewhere if the first task depends on an unexplained calculation or a cross-team contract.

Decide what the agent needs to see and do

Write down the starting revision, the files that define the behavior, the closest boundary with another service, and one approved test command. Provide a short explanation of which client or workflow depends on it. Use example records made for testing.

Treat the task description as guidance and the account, checkout and runtime permissions as controls. For a first project, use an approved repository scope, allow writes to a separate branch or working copy, and keep merge, deployment and production access with the team. Confirm what your chosen tool can actually access in that environment.

  • Read: the component and the contracts needed to understand its callers.
  • Write: the files and tests covered by the ticket in an isolated working copy.
  • Run: approved local checks with test credentials and data.
  • Escalate: stop for a human when a file, dependency or environment outside scope is needed.

Give the first ticket an observable finish line

Consider a fictional order system that reports a malformed supplier reference as an empty value. The first ticket could ask the agent to reproduce the case with a fixture and add a narrow regression test. The ticket identifies the parser and a caller that consumes the result. The maintainer writes down the expected outcome before the agent starts.

Review whether the test runs in the usual CI command, uses the active parser and preserves the outcome for a valid reference. If the agent discovers that release branches disagree about what should happen, ask the maintainer to settle the rule before changing either path.

Expand one capability at a time

After the team can reproduce and explain the results, expand from reading and tests to one local implementation change. Expand to shared integrations only when the relevant owners agree on the contract and can review the full effect. Keep the same release controls that production changes already require.

Track the tasks that were sent back, the context that had to be supplied and the time spent validating output. Those reasons tell you what to improve before authorizing another class of work, whether it is test coverage, a local setup command or clearer ownership.

Common questions

What first task works well for an AI coding agent in legacy software?

Choose one observed behavior with a maintainer, a repeatable local check and a narrow scope. Reproducing an existing defect and adding a regression test in a separate branch gives the team something it can validate.

Does a coding agent need access to the whole legacy repository?

Start with the code, callers and contracts used by the selected workflow. When more context becomes necessary, confirm why and use the access controls available in your environment to widen the scope deliberately.

Further reading

Want to explore what this means for your systems?

Explore the relevant service