On-premises · COBOL · RPG · CL · DDS · PL/SQL

Afunana documents what your legacy code actually does.

It connects to your IBM i or Oracle system, reads the source, and builds one cross-referenced model of every program, file and field. From that model it produces:

  • A document for every program — what it does and the business rules it enforces, in plain language, every statement linked to the line it came from.
  • A map of the whole system — a data dictionary of every field, and the call trees, data flow and file relationships drawn from the code.
  • Answers to questions — ask in plain language, and the answer cites the program and line so a developer can check it.
  • The blast radius of a change — name a field and it lists every program, file and screen it touches, with the recompile order and the tests to run.

Your developers stop spending days reading code before they can change it, and the faults that normally surface at month-end — a truncated value, an unhandled file status — are caught on the build before the change ships.

CNKEMPERR call tree cblninjar demo collection
CNCEMPERR CNKEMPERR CNKCHKID CNKCHKDT CNKCHKMAIL CNPEMPS CNPEMPERR
reached by widening the national ID not reached
What it is for

Why the documentation is missing

Core banking, insurance and government systems still run on COBOL, RPG and Oracle applications written decades ago. They work. What is missing is documentation: the people who wrote them have retired, and what they knew was never written down.

So every change request, production incident and audit question begins the same way: a developer opens a program nobody can explain and reads until it makes sense. It is also what makes a migration, re-platform or decommission hard to scope: the plan is only as good as the map of the system it is built on, and that map is usually a document written years ago. Afunana generates it from the source and rebuilds it as the code changes, so it describes the system as it stands today.

The whole system described in plain language, with its subsystems listed down the side Every program in the system, each with a description of what it does One program's documentation: purpose, processes, rules, inputs and calls

The whole system, in plain language.

Capabilities

What it does

Afunana connects to the system, pulls the source, and builds one cross-referenced model of every program, file and field. Everything below works from that model.

A document for every program — what it does and the business rules it enforces
Diagrams — call trees, data flow, field lineage, file relationships
A data dictionary for the whole system — every field, and every program that uses it
Your own specs alongside the code — PDF, Word, text and Markdown
Ask in plain English — "which programs update the customer balance?"
Every answer cites its source lines, so a developer can open the code and see for themselves
Cross-reference any field across every program and file
Common questions answered with no model call at all — how many programs, which ones touch this file — so the routine questions cost nothing and return instantly
Your vocabulary, not ours — the words your business uses for its own entities are mapped to the fields and files they mean, so people can ask in their own terms
Impact analysis — every program, file and field a change would touch
An ordered plan — what to edit, in what order, and which tests to run
Defect detection on every build — truncating moves, unhandled file status, dead code, unsafe control flow
Parameter and byte-size mismatches between a caller and the program it calls
The system says what it could not work out — a business rule whose intent is unclear, a dependency it had to infer, a question the source cannot answer
Those become a queue of specific questions, each tied to a program, a rule and the exact lines
Every later answer uses it — the note goes back into the index, so the knowledge outlives the person who had it
A business rule expanded to show why it exists and the source lines behind it The chat answering a question about the system in plain English The chat returning an ordered plan naming the files and copybooks a change would touch

Read what a program enforces, traced to its source.

How it works

How the output is checked

Each claim below is checked against the machine’s own record rather than against the model that wrote it.

Accuracy is checked against the IBM i’s own record

When the documentation says one program calls another, that claim is checked against the IBM i's own record of what calls what, not against the model that wrote it. You get a count you can read: how many claims were made, how many the machine confirmed, and which it could not. On the system we test against, 23 of 23 were confirmed. Anything unconfirmed is listed for review.

The defect checks are deterministic

Truncating moves, unhandled file status, dead code and unsafe control flow are found by reading the code structurally, not by asking a model. The same source gives the same findings every time, whichever model you have configured, and each finding names a line someone can open. Every check is yours to set — off, a note, or an error.

Rebuilds read only what changed

After a code change, a rebuild reads only the programs that actually changed. A system of a few thousand programs does not have to be processed again from the start, which is what keeps the documentation current: a refresh is a routine overnight job rather than a project somebody has to schedule and justify.

You choose the AI provider and the network it runs on

Each AI endpoint is a named connection you configure and test: Anthropic, OpenAI, Azure, Microsoft Foundry, AWS Bedrock, a model on your own hardware, or your organisation's own AI gateway in front of any of them. Several can be configured at once, with different jobs pointed at different ones. Changes take effect on the next call.

It keeps up with the models on its own

Model providers change what they accept — a parameter is deprecated, a field is renamed, a deployment is retired. Afunana learns each model's request shape from the provider's own error, adjusts, retries and remembers, so a change that would normally break a pipeline costs one request instead of an outage. Where a job can no longer be served it falls back to the next model you have named for it.

What it cannot fix by itself, it tells you about: a model being withdrawn and the date, a route that has started refusing, answers coming back with values redacted by someone else's content filter. That is the part worth having — the ones that need a decision arrive as an alert rather than as a failed build.

The programs one program calls, checked against the cross-reference Every program with what references it and what it reaches One field with every program and file that reads or writes it

Every call the documentation claims.

The output

The documentation it produces

Afunana writes six kinds of document, stores them in your own SQL Server, and exports every one of them to PDF, Word, Markdown or plain text. Nothing is held on our side, so there is nothing to retrieve if you stop using the product.

A document for every program

What the program does, and the business rules it enforces, in plain language. Written three ways from the same analysis: for the business reader, the analyst and the programmer. Every statement links to the source line it came from.

A data dictionary

Every field in the system, the files it sits in, and every program that reads or writes it. It traces the path a value takes from the screen that captures it to the file that stores it. Name a field and you get everything a change to it would touch.

A verification report

How many dependency claims the documentation made, and how many the IBM i’s own cross-reference confirmed. It also lists what failed to generate. The figures are counted by the machine, not written by the model that produced the text.

A record of what was sent out

Which AI providers received data, and over what period. It is counted from the log of actual calls rather than read off a settings page, so it reports what happened rather than what was configured to happen.

A statement of applicability

111 requirements across ISO/IEC 42001, the EU AI Act and NIST AI RMF. Each row carries the position your own people recorded, and beside it what the running system reports about the same question. Printable as it stands.

A system overview

What the application as a whole is for, the subsystems inside it, and how they relate. It is the starting point most people use: read it first, then open the subsystem, then the program underneath it.

Governance

Where AI is used, and who is responsible for it

Afunana uses language models to write the documentation, so most organisations have to be able to say which models are involved, what they are given, and who inside the organisation approved that. The product keeps those records itself, reading them from the running software rather than from a policy document.

A register of every AI use

Each place the software calls a model is listed: what it is for, what data it sees, who owns it, and which risk tier it was placed in. The list is read from the running software, so it cannot claim a use that is not configured or leave one out.

A list of approved models

Configuration says which model an administrator wants. A separate approved list says which models are permitted, and anything else is refused when the call is made. Changes can be set to need a second administrator to sign them off.

Impact assessments

Each use above minimal risk carries an assessment: who is affected, what data leaves, how it can fail, and what controls are in place. It records who carried it out, it is dated, and it expires so it has to be redone.

Standards and regulations

Each requirement is held as a row carrying two things side by side: the position your own people recorded, and what the running system reports about the same question. They are kept separate so you can see where the two disagree. Requirements published by your own regulator are added alongside these. None of this is legal advice.

ISO/IEC 42001 — 62 requirements

The certifiable management standard for AI. Every clause from 4 to 10, and all 38 Annex A controls, exportable as a statement of applicability.

EU AI Act — 30 requirements

Article by article, including the Article 26 deployer obligations and Article 25. Each row records who carries the requirement, you or your supplier.

NIST AI RMF — 19 requirements

The four functions — Govern, Map, Measure and Manage — at category level. This is the vocabulary most enterprise risk teams already work in.

Every requirement carries one of five positions — met, partial, planned, not applicable or not assessed — and the record holds who decided it, when, and on what basis. How the governance layer works

Running it

Measuring what the AI uses

Language models are charged by usage, so an organisation running this needs to see what is being used before the invoice arrives. Afunana records its own usage as it goes, holds it to a limit you set, and estimates a run before you start it.

Every call is recorded

Tokens and money for each call, attributed to the job that made it, the model that served it, and the system it was analysing. Prices are read from a table you maintain, so a change in provider rates does not need a software release.

Limits you set

Set a ceiling per period and choose what happens when usage reaches it: record it, warn somebody, or refuse the call. The check happens at the moment the call is made, not in a report afterwards.

An estimate before you start

How long a run will take and how much throughput it will demand, worked out from your own completed runs. Your AI provider applies a rate limit, and this is the figure that limit has to accommodate.

Thirty days of daily model cost, with total spend, tokens and cache tokens A table of roles, each assigned a primary and a secondary model

What the models cost, day by day.

For your architecture review

Security and architecture

The answers your security, data-protection, risk and audit functions will each ask for. Five points under each heading.

Where it runs

  • It runs on your servers, in your data centre. There is no vendor access, no shared tenancy and no route in from our side.
  • It makes one outbound call of its own: a version check against a URL you set. Leave that blank and it never runs.
  • Installation is one command, on Docker or Podman, under RHEL, AlmaLinux, Ubuntu, Rocky or Debian.
  • It uses your SQL Server, your backup policy, your encryption and your DBAs. A bundled database is available if you would rather not.
  • In air-gapped mode every model call goes to a model on your own hardware, and a call that would leave the network is refused.

Identity and access

  • People sign in through the identity provider you already run. SAML 2.0 and OIDC are built in.
  • Group membership from your directory grants roles and access, held as data an administrator edits rather than in code.
  • Automatic account creation is optional, and the role it assigns can never be administrator.
  • Credentials are read from your own vault. None is pasted into a configuration file.
  • Access is granted one part of the estate at a time, rather than all of it or none of it.

Evidence

  • Every administrative action is written to a hash-chained log that the database itself will not allow anyone to edit.
  • Those events are forwarded to your SIEM in your own format, and kept locally too, so the two can be compared.
  • Every model call is recorded: who made it, which model served it, which data it saw and what it cost.
  • Which providers actually received data is counted from that record, rather than read off a settings page.
  • A configuration change stores the value before and after it, so who set something and what it was before are both answerable.

How the estate is divided

  • You divide it the way the business is actually organised: a division, then a domain inside it, nested as deep as you need.
  • Each part carries the libraries that scope a new analysis, so nobody re-enters them every time.
  • IBM i and Oracle are read into the same internal model and documented the same way, so one team can work across both.
  • A new part can be added without touching the ones already running.
  • Access follows the same divisions, so a person is given a business area rather than a list of systems.

Control of the AI

  • You choose the provider and the model for each job, and change either without rebuilding anything.
  • Models can be reached directly or through your own AI gateway, so the traffic follows a path you have already approved.
  • An approved-model list is enforced when the call is made, so a model nobody approved cannot run.
  • A change to either list can be set to require a second administrator, and nobody can approve their own request.
  • A spending ceiling is enforced at the moment of the call, rather than reported after the period ends.

Updates and backups

  • An update re-pulls the image and restarts. Your data, configuration and generated documentation are preserved.
  • Enterprise sites pull from an internal registry, or install from an offline bundle where there is no internet at all.
  • The database is yours, so your existing backup and restore procedure covers it. The bundled option takes a daily backup.
  • Every deploy records the version, the time and the results of its dependency and static-analysis scans.
  • Production is updated by pulling a signed image, so nobody needs shell access to the running system to change it.
In your tools

VS Code, MCP and the REST API

The analyzed system is not locked inside one web application. Developers reach it from VS Code, AI assistants query it over MCP, and your own scripts call the REST API — all with the same permissions and the same answers.

VS Code extension

A developer reads a program's documentation in the editor, hovers any field to see what it holds, and gets the findings as ordinary diagnostics. Source members can be opened, edited and saved back under that person's own sign-on.

MCP server

Point Claude, Cursor or Copilot at your own installation and they answer from your analysed system rather than from general knowledge. Each person signs in, sees only what they are permitted to see, and cannot write anything.

REST API

Everything the web application does is available to your own scripts and integrations over HTTP. The same permissions apply, so a script cannot reach further than the person whose credentials it runs under.

The Afunana collection tree in the VS Code sidebar A program's business rules beside its source in VS Code Hovering a database file name in COBOL source explains what the file holds

Your whole system, in the editor's sidebar.

Platforms

What Afunana reads

Two platforms are supported today and a third is being built. All of them go through the same pipeline and produce the same documentation.

Supported

IBM i / AS/400

COBOL · RPG · RPGLE · CL · DDS · embedded SQL

The platform Afunana has been run against the longest, and the one the accuracy check works on, because the IBM i keeps its own record of what calls what and that record is what we check against. A server-side agent extracts the source; nothing stays running on the box.

Supported

Oracle applications

PL/SQL · packages · procedures · functions · triggers · views

Whole applications rather than just the schema, read into the same model and documented the same way, with defect checks written for PL/SQL. Extraction is read-only and agentless: nothing is installed on your database server and no Oracle client is needed. Where you run both platforms, a field can be followed straight across from one to the other.

On the way

IBM z/OS

Mainframe COBOL

Built on the same foundation and already selectable in the product. The connector and the extractor are still being written. If z/OS is in your plans, ask us and we will tell you exactly where it stands.

Getting started

How a proof of concept runs

The proof-of-concept runs on your own source, on your own infrastructure. Usually one subsystem, usually within days.

Step 01

Tell us what you have

Platform, languages, roughly how many programs. We pick a first collection together.

Step 02

Install it

One command on your own network, with the AI provider you choose, or fully air-gapped.

Step 03

It reads and builds

Source extracted, model built, documentation written, accuracy checked against your own system's record.

Step 04

We walk you through it

On your own code, with the accuracy report in hand. Whatever you decide, the output is yours to keep.

If a full install is too early, ask for a sample analysis on a system you would recognize.

A business rule beside the COBOL source, with the lines it was read from highlighted Hovering a section in the functions tree shows what that section does The call flow of the whole system, program by program

Click any rule and the source it came from lights up.

Questions

Questions we get

Where does our source code go?
Nowhere. Afunana installs on your infrastructure, and the embedding model is inside the container image and runs locally, so there's no external embedding service. You choose the AI provider. Where no outbound connection is allowed, air-gap mode keeps every call on local models and the installer runs from a pre-loaded image.
How do we know the documentation is accurate?
We count it. Every time the documentation says one program calls another, that claim is checked against the machine's own record of what calls what, and you are told how many were confirmed and which were not. More on how that works. The check reads the IBM i's cross-reference, so today the count is an IBM i number. Oracle gets the same documentation and the same defect checks, and we will always tell you which figures are measured and which are not.
How do we know it won't break production?
The default is that Afunana stops at a plan and hands it to a developer. Where write-back is switched on, it's approved per plan, runs in a workspace library of its own, backs up the original members first, and stops cleanly if a step's prerequisite doesn't hold. Compiling and verifying stay with your team. Afunana writes out the recompile order and hands it to whatever build tooling you already run.
What access does it need to our systems?
Read access to the members in scope, and nothing standing. A server-side agent extracts the source on IBM i; on Oracle, extraction is read-only and agentless. Writing anything back to a live system is off until an administrator turns it on, and then only per approved plan.
Is it SOC 2 or ISO 27001 certified?
Not yet. Certification is underway, and the controls behind it are already in place and mapped to OWASP Top 10, ISO/IEC 27001:2022 and SOC 2, with a hash-chained audit trail and syslog forwarding to your SIEM. A screen inside the product reports on each control from what it can actually test. We are happy to walk your security team through the controls and the mappings in as much detail as they want.
How long until we see something?
The first build documents every program in scope and is the longest run. How long it takes depends on the size of the system and on how fast your AI provider answers. After that, builds are incremental: only what changed is re-read. A proof-of-concept usually starts with one subsystem, so you're reading real documentation of your own code within days.
What will it cost us to run?
Two figures, and Afunana measures both rather than estimating them. The one-off is the first full build of an estate, which is where the tokens go — large, and bounded, and you are told the size of it before you start. The ongoing cost is questions and incremental rebuilds, which is small by comparison: a chat question is cents, and only the members whose source actually changed are re-read.

Every call is metered to the role, the model and the collection, priced from a table you control. Budgets are enforced at the moment of the call — record, warn, or refuse — so the ceiling you set is the ceiling you get, not a number you find out you passed. And because you choose the provider, the rate you pay is one you negotiated.
Get in touch

Start a proof of concept

Tell us how many programs, which platform and languages, and what you're trying to understand.

Afunana

169 Madison Ave. #2172

New York, NY 10016

+1 888 890 2534

support@afunana.io

Systems integrators and managed-service providers doing legacy work at scale — we support partner and OEM arrangements. Write to partners@afunana.io.

Thank you. We'll get back to you shortly.

That didn't send — please try again, or email us at support@afunana.io and we'll pick it up from there.