What is business logic extraction, and how do you capture a legacy system's rules?
Updated · By Adam Polak, founder
Business logic extraction usually means recovering the business rules buried in an existing system's code, such as COBOL on a mainframe, so they can be documented or rebuilt. Code shows what the system does; the people who run it know why, which rules still matter and which exceptions are handled outside the code. A full capture uses both: code-analysis tools such as AWS Transform for mainframe or CAST Imaging for the code, and interviews with the people who know for the rest, which is the part RuleFoundry does.
How to capture a legacy system's rules
Work from both ends: what the code does, and what the business needs. Neither alone is the full set of rules.
- 1
Decide what the new system must keep
Start from the decisions the business needs, not from the code. Many rules in an old system are workarounds for limits that no longer exist, so list the decisions first, then look for their rules.
- 2
Mine the code for what it does
Code-analysis tools trace programs, data flows and conditions, and can extract candidate rules linked to the source. This shows what the system does today, including rules nobody remembers.
- 3
Ask the people who run it why
Walk through real cases with the operators and the people who handle exceptions. They know which rules are still wanted, which are workarounds, and what happens outside the system: manual overrides, spreadsheets, phone calls.
- 4
Reconcile the two
Put the rules from the code and from the people side by side. Where they disagree, find out which is right before anyone rebuilds. A rule in the code that nobody can explain is an open question, not a requirement.
- 5
Write each rule in plain language, with its source
A condition and an outcome, linked to the code or the conversation it came from, so the team building the replacement can trace every rule.
- 6
Test the new system against the old
Run real past cases through both and compare the outcomes. Every difference is either a bug or a rule someone chose to change.
Where RuleFoundry fits
In RuleFoundry, an Extraction is one conversation that captures what someone knows. It covers step 3: RuleFoundry interviews the person who runs the process, by voice or text, asks the next useful question, pins down vague terms like "usually" or "large order", and follows the exceptions until the rules are clear. Then:
Rules linked to where they were said
Each rule cites the transcript lines it came from and is tentative until the expert confirms it, with anything unsettled listed as an open question.
Disagreements kept
Results are kept in a Project. When two Extractions disagree, the Project records both statements without choosing one.
Ready for the team that rebuilds
The Logic Twin answers questions from the rules and says when they do not cover a question, and coding agents read the rules through MCP.
What it does not do: read your code. For what the system itself does, use a code-analysis tool such as those below, and bring its unexplained rules to the interview. The rules are only as complete as the conversation, so review them before relying on them. The facts page lists limits and prices.
See it run
The walkthrough film shows an interview turned into rules inside ChatGPT. To try it there, add RuleFoundry to ChatGPT (how) and say:
Use RuleFoundry to interview me about how our billing system decides late fees, including the cases we handle by hand.
When something else fits better
- AWS Transform for mainframe, when the legacy system is a mainframe you are moving to the cloud. Its site describes an agentic AI service that covers modernization from assessment and business rule extraction through requirement generation, with each output traced back to the original source code.
- IBM Bob Premium Package for Z, when the applications run on IBM Z. IBM's site describes it as extending IBM Bob with mainframe expertise, using application metadata, data dictionaries, dependencies, control flow and business context to help teams understand applications and then plan and govern modernization.
- CAST Imaging, when you need a map of a large application before changing it. Its site describes deterministic maps of an application's architecture, dependencies and data access, made for AI agents to use.
- RuleFoundry, when the rules you need are in people's heads rather than the code: why the system does what it does, which rules still matter, and the exceptions handled by hand.
Descriptions of other products come from their own websites, checked on 2026-11-23.
Questions people ask
- What is business logic extraction?
- Recovering the rules a business runs on (who qualifies, what gets approved, what each case costs) from wherever they live now. In legacy modernization that usually means mining code; the same rules also live in documents and in the heads of the people who run the process.
- Can AI extract business rules from COBOL?
- Code-analysis tools now use AI to extract candidate rules from COBOL and link them to the source. Someone who knows the business still has to say which rules are intended and which are workarounds.
- Why interview people if the code is the source of truth?
- The code is the truth about what the system does, not about what the business wants. It can't say why a rule exists, whether it still applies, or what staff do by hand outside the system.
- Does RuleFoundry analyze source code?
- No. It captures rules from conversations and screen recordings. Pair it with a code-analysis tool for what the code does.
- What does RuleFoundry mean by an Extraction?
- One conversation that captures what someone knows, written up as business rules in plain language, each linked to the line where it was said.
- What does it cost?
- Your first Extraction is free. Personal is $20 a month for unlimited Extractions, and Team is $20 per active member a month with a two-seat minimum.
Related: why automation projects fail on undocumented logic, finding conflicting or missing business rules, turning expert interviews into business rules.
What changed: 2026-11-23, first version.