Cognition explains how its AI agent Devin took on COBOL on mainframes
XORit Editorial · Sources, AI assistance and corrections

Cognition has published a breakdown of how its AI agent Devin is being used on COBOL. Over eight months, several Fortune 500 companies handed the agent projects in the language: documenting millions of lines of code, migrating batch jobs, and fixing logic in hundreds of programs.
The demand is easy to explain: COBOL specialists are in short supply. According to estimates cited in the publication, 47% of organizations cannot fill COBOL vacancies, and 92% of developers working in the language plan to retire by 2030. At the same time, 68% of COBOL modernization projects end in failure, by the company's own estimate.
The main technical difficulty is that COBOL lives on mainframes, while agents run in Linux virtual machines and cannot execute the code. The usual write-test-fix loop breaks down. On top of that, COBOL has no types or shared schemas: data moves between programs through copybooks, and the same value can go by different names in different programs, identified only by its position in memory. An error in one such place makes every subsequent change wrong.
Cognition names two conditions for success. First, the agent needs a complete map of the codebase — all call chains and connections between programs — so it can understand what each field means. Second, it needs a restored verification loop wherever the code has to be executed. If the input and expected output are known in advance, Devin reproduces the logic in a modern language on its own machine and checks the output until the results match. The company also describes playbooks — sets of instructions that capture the language's constraints and engineers' experience.
Who this has already helped: at one of the largest automakers, Devin migrated a 25,000-line COBOL customs batch process into AWS Lambda functions, and by Cognition's estimate the migration delivered about 73% in cost savings. Latin America's largest private bank, Itaú Unibanco, was changing its corporate tax ID from numeric to alphanumeric: the code turned out to contain about 20 variants of a single field, and the work finished three months ahead of schedule with no errors in production.
The limitation is stated honestly: transactional systems that serve users in real time are still beyond what agents can do. There is no isolated environment to safely replicate the system, and no clean input-output pairs to verify against. For documentation, batch migrations, and large-scale refactoring, agents already work; for live transactional systems, not yet.

Translation editor: Салтанов А.
Source: cognition.com ↗