TecnoStack
Start a projectالعربية
Five stacked cards joined by downward arrows show a staged LLM rollout for legacy software: Inventory, Read-only pilot, Shadow mode, Routed rollout and Write-back, with Write-back highlighted as the last stage.
AI engineering

LLM integration with legacy software works best in five stages: inventory the touchpoints, pilot a read-only feature, run it in shadow mode, widen a routed rollout with a rehearsed rollback plan, and let the model write back last.

In this article

Silent video with on-screen text. The transcript below repeats every screen and describes what it shows.

Watch on the video page

  1. 0:00–0:06

    CRM summary • Inventory before building • Data owner • Off switch • System of record • LLM feature • Reads • Proposes

    The one-record figure appears: System of record feeds the LLM feature along a solid Reads arrow, and a dashed Proposes arrow returns toward the record and stops before it. A marker carries data along Reads into the feature; a second marker runs back along Proposes and halts at its head, short of the record. Two tags, Data owner and Off switch, travel in and are tied to the record stack with cyan strings.

  2. 0:06–0:12

    CRM summary • Pilot it read-only • Named reviewers • Record unchanged • LLM feature • Reads • Proposes • System of record

    A panel headed Named reviewers, with three faceless reviewers and an empty slot, slides in. One blank summary card rises from the LLM feature box and settles in the slot, and the reviewers' blank name bars draw in. The record stack does not move: its label fades and Record unchanged takes its place. Reads and Proposes stay as they were.

  3. 0:12–0:18

    CRM summary • Run it in shadow • Outputs to a log • Own budget and cap • Shadow call • Side effects off • Protected log • Permitted data

    The shadow-controls figure appears: Permitted data enters through a screened inlet and a glass run into the Shadow call; one open drop leads down into the Protected log, and a second outlet ends in a sealed cap labelled Side effects off. Two cyan request pulses run from the inlet into the shadow call, vanish inside it and reappear in the drop, sinking into the log; the capped outlet carries nothing. Outputs to a log appears by the log, and an Own budget and cap tag is tied to the shadow call.

  4. 0:18–0:24

    CRM summary • Widen by cohort • Internal team first • Route back if needed • Old path

    The routing band appears: an incoming track meets a switch whose blade is set for the thick track to the Old path block, and a thin branch rises to a small block. A request rides the old path. The blade swings toward the branch while its old position stays as a dim ghost; the branch lights up and a second request rides it to the small block, labelled Internal team first. A dashed outline marks that ghost: Route back if needed. Nothing is flipped back.

  5. 0:24–0:30

    CRM summary • Write back last • One write type at a time • Recovery plan first • System of record

    The record stack returns with its System of record label, and a small routing switch appears to one side. A sheet headed Recovery plan first slides in beside the stack and its blank rows draw. A card reading One write type at a time moves toward the stack and stops beside the sheet; nothing is written. The routing switch dims: switching the route back cannot undo a completed write.

For LLM integration with legacy software, we recommend a five-stage rollout. First, take an inventory of touchpoints and data owners. Next, pilot a read-only feature, then run it in shadow mode, then route a growing share of users to it behind a switch, and add write-back last. Keep the old path working as a fallback, alongside a plan for requests and actions already in progress.

Below you will find the order of work and the evidence each stage needs before you move on. For what to build, including the adapter service, identity and tool permissions, read our guide on how to place an LLM beside an old system first.

Each stage changes one thing: who sees the model's output, or what the model is allowed to touch. Move on only when the stage's exit criteria pass. A route switch can stop new exposure; it does not reverse outputs already seen or actions already completed.

StageWho sees the outputWhat the model can changeMove on whenHow you step back
1. InventoryNobodyNothingEvery touchpoint has a data owner and an off switchNot needed
2. Read-only pilotNamed reviewersNothingReviewers accept the suggestions on your agreed test setTurn the pilot off
3. Shadow modeReviewers; outputs go to a logNothingDisagreements are understood, and latency and cost fitStop the shadow call
4. Routed rolloutInternal team, then small cohorts, then wider groupsNothingEach cohort meets its gatesFlip the route back
5. Write-backUsers who approve each actionRecords, through existing interfacesThe owner signs off on each write typeCompensating procedure; a switch cannot undo a write

A legacy system carries behaviour nobody wrote down: a batch job that runs at 2 a.m., a field that means two things, an integration that fails if a reply arrives one second late. An LLM feature adds a dependency that can be slow, wrong or unavailable. Stages keep each surprise inside a small, known area.

The idea is borrowed from modernisation work. AWS Prescriptive Guidance describes the strangler fig pattern as replacing functionality one component at a time, with a proxy layer that routes each request to either the legacy system or the new one while the old system keeps working. Our guide to modernising a legacy system in slices covers that pattern on its own. Here we use the same routing point for a narrower job: deciding whether a request goes through the existing path or the new LLM feature.

Requests already in flight when you flip the route need their own rule. Decide in advance whether you let them finish, cancel them, or drain them to the old path.

Start with a list, not a model. Walk through the screens, workflows, batch jobs and inbound channels where a model might help, and record five things for each:

  • Data read: which fields, who owns them, and whether they include personal or confidential data.
  • Writes: whether the touchpoint changes anything, and through which interface.
  • Failure behaviour: what happens today when a dependency is slow or down.
  • Load and timing: peak volume and any hard time limits.
  • Control: who approves changes, and where an off switch can sit.

Settle data ownership in this stage. The legacy system stays the system of record for the whole rollout. The LLM component may read, summarise and propose; it must not become a second source of truth for the same data.

A System of record feeds an LLM feature along a Reads arrow; a dashed Proposes arrow returns toward the record and stops before it.

Settle data ownership before building. The legacy system stays the system of record for the whole rollout: the LLM feature reads, summarises and proposes, and never becomes a second source of truth for the same data.

Pick a feature that suggests and leaves the record alone. Good candidates are a summary of a customer's history on a CRM screen, a draft reply an agent edits before sending, or a suggested category for incoming tickets that a person confirms. If the model is slow or unavailable, the screen should work as it did before.

Keep the design simple. Anthropic's engineering guide to building agents separates workflows, where the model and tools follow predefined code paths, from agents, which direct their own process and tool use, and it recommends the simplest solution that works. For most legacy pilots that means fixed-path workflow automation: the legacy system calls the model at one defined point and shows the result to a named reviewer. If someone proposes several agents handing work to each other for a first pilot, read multi-agent systems explained before agreeing to the extra moving parts.

Read-only does not mean harmless. A summary can expose data the viewer should not see, or mislead a decision. Enforce the same access rules the legacy screen enforces, and test answer quality on cases your reviewers have labelled.

In shadow mode, the new component receives real inputs alongside the existing process, and you record its outputs instead of showing them. Martin Fowler describes the same idea as dark launching: users trigger the new behaviour without being able to tell, old and new code can both run, and only one answer goes back to the interface. You can review outputs before showing them in the user path; the extra processing still carries data and capacity risks.

Set it up with four controls:

  1. Only permitted data. Send the model only data you are allowed to process with this model and provider.
  2. No side effects. Disable sends, payments, notifications and writes in the shadow path.
  3. Its own budget. Give the shadow call separate capacity and a spending cap, so duplicated work cannot slow the live path.
  4. Production-grade logs. Keep shadow logs under the same access controls and retention limits as production data.

Then compare. Check the shadow outputs against expected outcomes your reviewers have checked, and against what staff or the legacy logic actually did. A disagreement on its own does not prove the model wrong or the old process right, so look at the types of disagreement as well as the rate, along with latency and cost under real load. Shadow runs surface what test data misses: odd record formats, Arabic and English mixed in one field, timeouts at peak hours.

Permitted data flows into a Shadow call whose only open outlet leads to a Protected log; a second outlet is capped and labelled Side effects off.

In shadow mode the model runs on permitted real inputs, but sends, payments, notifications and writes are switched off and its outputs go only to a log with production access controls. Reviewers then compare; this diagram shows no comparison result.

Widen exposure through the routing point, one cohort at a time: an internal team, then a small group of users, then wider groups. This is a canary release. Danilo Sato's description on martinfowler.com defines it as rolling a change out to a small subset of users first, with rollback done by rerouting users to the old version.

Your rollback plan has three parts:

  • The switch. Rolling back means flipping the route. Nobody redeploys under pressure.
  • A working old path. Keep the fallback maintained, with current permissions, deletion rules and compatible data formats. It is your safety net until you retire it.
  • Rehearsal. Practise the rollback before the first real users arrive and again before each expansion.

Write each cohort's gates before its results arrive. Our guide to rollback plans for model releases explains how to set release gates and what to monitor once real users are in. Agree in advance what lets you retire the old path, such as a period without serious incidents, stable quality measures and the owner's sign-off. Until then, old and new run side by side.

Only after the read-only feature has proven its value, and one write type at a time. Writes change operational records and cannot be reversed merely by switching the route, so they need controls of their own.

The OWASP Top 10 for LLM Applications (2025 edition) lists excessive agency, meaning an LLM that can take damaging actions after unexpected or manipulated output, as risk LLM06. Its mitigations match what a legacy write path needs:

  • Use existing interfaces. Send writes through the legacy system's validated API, queue or batch import, never straight into its database.
  • Act as the user. Execute each action in the context of the user who requested it, with the minimum permissions the action needs.
  • Ask first. Require a person to approve any high-impact action, and bind that approval to the exact proposed change. Re-check authorisation when it executes.
  • Make writes safe to repeat. Scope idempotency keys to the tenant, operation and payload, store outcomes atomically, and test duplicate and delayed delivery.
  • Plan recovery. Identify compensating actions, manual recovery and irreversible effects for each write type before enabling it. A routing switch does not undo completed actions.

If the legacy system stays the system of record, every accepted change lands there under its normal rules. Copies, search indexes and downstream systems still need reconciling. Microsoft’s compensating transaction guidance explains that recovery may need business rules and human intervention, and may not restore the original state. Record those limits when the owner approves a write type.

Stop when a stage misses its exit criteria. If shadow results fall short, fix the feature before any user sees it; otherwise you widen exposure to a failure you already know about.

Change course when the idea turns out to be a new product surface, such as a customer-facing chat or an analyst console. Build that beside the legacy system and read its data through an approved interface, instead of grafting it onto old screens.

This five-stage sequence is TecnoStack's guidance; AWS, Anthropic, OWASP and Martin Fowler do not prescribe it. If you are planning the first AI feature on an older platform, we can help you run the inventory and the stages as part of building AI features inside your existing software.

Sources checked in October 2026. The distinction between route rollback and recovery of completed actions was checked against Microsoft’s compensating transaction guidance on 25 October 2026; the remaining source review is unchanged.

Discuss your website, store, app or AI project in Arabic or English. We agree the scope before work starts.

Book a free scoping callCompare services and prices