Writing · · 6 min read
We designed a bank around Apache Fineract. Then a coding agent tried to take a shortcut.
A whole bank designed around Apache Fineract in Cortex Architect: 158 parts, 15 decisions, each one a rule that is checked. When a coding agent asked to read the core banking database directly, it was told no, and why.
Every bank has the rule. Nothing reads the core banking database except the core itself. It is in the architecture document, it was agreed at a review, and every engineer who joins is told it in their first week.
A coding agent has not read your architecture document. It was asked to make a balance screen load faster, the database is right there, and a direct query works. So it writes one.
We wanted to show what it looks like when the rule is not a sentence in a document but something the agent has to get past. So we designed a bank in Cortex Architect, and then we let an agent try.
- Look around without an account: the live demo
- Start free with one project: app.cortexagent.com
The bank
The real code here is Apache Fineract, the open source core banking platform. We connected the repository and Cortex Architect read it: the Fineract services, their database, the Kafka topics they publish to, fifty code modules and the tools the project uses for testing.
A core banking platform is not a bank. So we asked the architect in the side panel to design the bank around it. It proposed eight more applications: digital channels, an integration layer, payments and reconciliation, customer onboarding and lending, financial crime and fraud, data and reporting, operations and security, and disaster recovery in a second region.
The model now has 158 parts and 151 connections in nine applications. What was read from Fineract's code is drawn solid. The 97 parts that are only designed are dashed and say "Proposed".

It also left blanks, on purpose. No country is chosen. No payment scheme, no identity provider, no credit bureau. Their costs and availability are unset, and the model says they are unset. Cortex Architect does not guess about your organisation.
This is a reference design, not a real bank and not regulatory advice. Apache Fineract is a project of the Apache Software Foundation, and we have no connection to it.
Before: the agent is told yes
The first version of the design had its rules where most designs keep them: in the descriptions. The digital channels application said, in words, that channels never access core banking or payment databases directly.
Cortex Architect is an MCP server, so a coding agent can ask it questions before it changes code. We connected Claude Code and had it ask the obvious one: may the Customer experience API connect to the Fineract production database?
{ "allowed": true, "alreadyExists": false }
Allowed. The rule existed, everybody could read it, and nothing checked it. That is the state of almost every architecture rule in almost every organisation.
Turning sentences into rules
We asked the architect to record the rules the design already stated as decisions, and to turn each one into a guardrail. A few minutes later there were fifteen. Some of them:
- Only the Core banking adapter may call Fineract.
- Only Fineract's own runtime may access the Fineract production database.
- Digital channels never access core banking or payment databases directly.
- Only the Payment hub may call the Payment scheme connector.
- The data pipeline never reads the Fineract production database directly.
- Customer traffic and staff traffic enter through separate gateways.
- The mock OAuth server in Fineract's repository is never a production identity provider.
Each decision keeps its reasons. The first one records what was weighed. Letting every service call Fineract directly is less code, and it turns the core's whole API into what the record calls "an internal free-for-all". Putting a generic proxy in front is small and simple, and it controls routing without controlling which banking operations are allowed. So the design has one narrow adapter with a list of permitted operations, and the record names the cost of that choice too: the adapter is now a critical service that needs an owner.

After: the agent is told no, and why
Same agent, same question.
{
"allowed": false,
"violates": [
{
"rule": "Nothing except the Fineract runtime roles may depend on the Fineract production database.",
"decision": "ADR-0002"
}
]
}
We tried a second shortcut: may the Payment hub call Fineract itself, and skip the adapter?
{
"allowed": false,
"violates": [
{
"rule": "No component may call Fineract except the Core banking adapter; the mock OAuth server is a test-only exception.",
"decision": "ADR-0001"
}
]
}
And the route the design intends, the Payment hub calling the Core banking adapter, comes back allowed.
The agent is not only refused. It is given the rule and the decision behind it, so it can read why and take the permitted route. The refusal is decided on the server from the model, not by hoping the agent read a prompt.
Guardrails are also checked against the code each time the repository is read. If somebody adds the shortcut anyway, by hand or with an agent that never asked, it shows up as drift.
The same model answers the resilience question
Rules are one use of the model. Here is another. Open the stress test and take down the financial crime case store, the database where investigators keep their alerts and case notes.

Twenty-three other parts stop. Sanctions screening and fraud decisions both record their evidence in that store, and the Payment hub waits for both before it releases money. So a database that sounds like back-office record keeping is in the path of every payment.
That may be exactly right. A bank should not release a payment it cannot record a screening decision for. But it should be a choice somebody made, with a name on it, and the model puts it in front of you in one click.
What this does not do
- It is a design. Only the Fineract parts were read from code. The plan says the repository shows Fineract's capabilities and does not prove a production deployment.
- A guardrail in the model is not a firewall. The decision record says production network policy and code-level tests must enforce the same rules. The guardrail tells people and agents the rule and catches the breach; it does not block a packet.
- The stress test treats every dependency as fatal. The design says a payments failure must not stop customers from seeing their accounts. The simulation cannot show that yet, so read it as where to look.
- Development tooling is read as it is found. Fineract's repository includes a logging stack for local use, and the stress test ranks it among the worst things to lose. In a real project you would mark it as development-only.
- Costs are rough and incomplete. The design totals $67,700 a month, with 75 parts not estimated and no scheme or bureau fees.
Put your own rules where your agents can read them
You have rules like these. They are in a wiki, or in the heads of three people. Your coding agents cannot see them.
- Start free and connect a repository. Cortex Architect reads it and draws what is there.
- Tell the architect a rule you already have. It records the decision and the guardrail.
- Connect your coding agent with one command, and ask it to break the rule.
One project is free for one person, with no card. The Team plan is $199 a month or $1,990 a year for the whole team, not per seat, with 14 days to try it. See the plans.
If you look after architecture in a bank or an insurer, write to us. We would like to hear which of your rules you most want checked.