Concept and motivation
An enterprise architecture is easy to describe on a slide. The interesting part starts when you connect the systems: an operator needs an answer, an API has to enforce access, a workflow may require a human approval, and an AI agent has to explain where its information came from.
I built MiniBank as a controlled, synthetic environment to test those boundaries hands-on. It is not a banking product, and it does not copy any employer’s environment. It is a place to turn architecture questions into working integrations and repeatable experiments.
Goals and scope
The lab explores payment and hold investigations, evidence-backed policy explanations, operator workflows, approvals, identity and authorization, AI-assisted counterparty research, and orchestration across cloud and business applications.
It deliberately does not process real money, execute transfers, keep a banking ledger, perform KYC, connect to payment networks or hold genuine customer data. Every bank transaction is synthetic. The only real data is public: legal-entity records from the GLEIF registry, which stay separate from the invented payments.
Architecture
The operator works in a Power Apps canvas app. Payment questions go through a custom connector to Azure API Management and an Azure Function, which reads synthetic payments from Azure SQL and a versioned policy document from private Blob storage, then asks a Foundry model for an explanation that must name the policy version and section it used. Counterparty questions take a different path: the app saves a request in Dataverse, and a Python worker, built on Microsoft Agent Framework, runs two Foundry agents. One resolves a company against the public GLEIF registry; the other searches a small graph of synthetic payments that uses a pinned subset of the FIBO ontology. When a name is ambiguous, the investigation stops and a Teams approval decides which entity is meant.
The diagram is a conceptual overview. Solid lines are paths I have seen work in this snapshot; dashed ones are designed or not re-verified. A connected box on its own does not prove that an authorization boundary was tested.
- Operator → MiniBank Operator verified
- Operator → Assistant (designed path) not verified
- MiniBank Operator → Dataverse (saves the investigation request) verified
- Dataverse → Python worker (the worker reads queued requests and writes results back) verified
- Python worker → Two prompt agents (runs both agents in Foundry) verified
- Python worker → GLEIF registry (public API, registry text treated as untrusted) verified
- Python worker → FIBO subset + RDF graph (searches synthetic payments) verified
- Dataverse → Teams approval (when the name is ambiguous) verified
- MiniBank Operator → Custom connector (payment lookup and hold explanation) verified
- Assistant → Custom connector (same connector) not verified
- Custom connector → API Management verified
- API Management → Azure Functions verified
- Azure Functions → Azure SQL (read-only queries) verified
- Azure Functions → Private Blob (selects the policy section) verified
- Azure Functions → Model deployment (explanation with source and version) verified
Text version of this diagram
An operator uses a Power Apps canvas app. For payments, the app calls a custom connector, API Management and an Azure Function, which reads synthetic payments from Azure SQL and policy documents from private Blob storage and asks a Foundry model for a cited explanation. For counterparty investigations, the app saves a request in Dataverse; a local Python worker runs two Foundry agents that use the public GLEIF registry and a small graph of synthetic payments, and a Teams approval resolves ambiguous names. A Copilot Studio agent that uses the same connector is designed but was not re-verified in this snapshot.
- Operator → MiniBank Operator: verified.
- Operator → Assistant (designed path): not verified.
- MiniBank Operator → Dataverse (saves the investigation request): verified.
- Dataverse → Python worker (the worker reads queued requests and writes results back): verified.
- Python worker → Two prompt agents (runs both agents in Foundry): verified.
- Python worker → GLEIF registry (public API, registry text treated as untrusted): verified.
- Python worker → FIBO subset + RDF graph (searches synthetic payments): verified.
- Dataverse → Teams approval (when the name is ambiguous): verified.
- MiniBank Operator → Custom connector (payment lookup and hold explanation): verified.
- Assistant → Custom connector (same connector): not verified.
- Custom connector → API Management: verified.
- API Management → Azure Functions: verified.
- Azure Functions → Azure SQL (read-only queries): verified.
- Azure Functions → Private Blob (selects the policy section): verified.
- Azure Functions → Model deployment (explanation with source and version): verified.
- Ask → Queue verified
- Queue → Resolve verified
- Resolve → Confirm (only for an ambiguous name) verified
- Confirm → Search (resumes with the selected identifier) verified
- Search → Answer verified
Text version of this diagram
The operator asks whether a company, or another company in its group, has been paid. The request is queued in Dataverse. A research agent resolves the company with the public GLEIF registry. If the name matches several entities, the run pauses for a Teams approval and resumes with the chosen identifier. An analyst agent then searches a graph of synthetic payments and the result returns to the app with the registry records and ontology version it relied on.
- Ask → Queue: verified.
- Queue → Resolve: verified.
- Resolve → Confirm (only for an ambiguous name): verified.
- Confirm → Search (resumes with the selected identifier): verified.
- Search → Answer: verified.
Implementation
- Power Apps and Copilot Studio: the operator experience, the investigation entry point and, by design, a conversational assistant that calls the same connector.
- Dataverse, Power Automate and Teams: requests, investigations, review cases, and the human decision with its approval state.
- API Management and Azure Functions: the payments API and its enforcement points, with a managed identity for data access.
- A second, on-demand API Management instance for the MCP tools: see the decisions below.
- Azure SQL and private Blob storage: synthetic payments and versioned policy documents. The documents stay private; the API returns the exact section the answer relied on.
- Microsoft Foundry and Python (Agent Framework): a model for cited explanations and two prompt agents for counterparty research, with read-only access to their sources and registry text treated as untrusted input.
- GLEIF and a FIBO subset (RDF): public legal-entity and group-relationship data, with source records and the ontology version recorded alongside each result.
- Terraform and PowerShell: the Azure side is deployed with Terraform (remote state, separate plan and apply), the data is generated with a fixed seed, and a start and stop script targets the parts that bill while idle.
Design decisions
A running log. I add an entry when I make a decision that shapes the lab, and I keep the old ones, so the reasoning stays visible as the project changes. Newest first.
2026-11-22 A second API Management instance, only for MCP, created on demand
- Why
- I want the payment tools available as an MCP server for Foundry agents. The payments API sits behind a Consumption-tier API Management gateway, and that tier does not support MCP servers. The Developer tier does, but it is not free: roughly seven cents an hour in the region I use.
- Decision
- Keep the Consumption gateway and the Power Apps path as the always-on route, and add a second, Developer-tier instance used only for MCP. Terraform and a start and stop script create it when I need it and remove it afterwards, restoring the same API, the same two tools and the captured portal configuration on the next start. I bring it up only while I test flows that use MCP.
- Consequence
- MCP flows work only while that instance exists, and provisioning takes a while. Idle cost is close to zero, and the rest of the lab does not depend on it. The first full stop and restore cycle has not run yet.
2026-11-23 Two agents, each with only the source it needs
- Why
- The counterparty question mixes a public registry with an internal payment graph, and registry text is untrusted input.
- Decision
- One agent resolves the company against the public registry. A second agent receives only the confirmed identity and searches a read-only graph of synthetic payments. Both run read-only, and the second never sees raw registry text.
- Consequence
- A manipulated registry record can at most mislead the first step, which a person can check before any payment is searched. It costs two agent runs instead of one.
2026-11-23 Ambiguity stops the investigation and asks a person
- Why
- A company name can match several legal entities, and picking the wrong one would produce a confident but wrong answer.
- Decision
- When identification is ambiguous, the run pauses before any payment lookup and sends a Teams approval. The decision is bound to that investigation and candidate, and the same investigation resumes with the chosen identifier.
- Consequence
- A run can wait for a human, so it is not fully automatic. In the live run, four candidates came back and the search waited for the approval.
2026-11-22 Policy documents stay private; the API returns the cited section
- Why
- The operator app first tried to open the policy file by its storage link, and the private storage correctly refused.
- Decision
- Keep the storage private and return the exact policy section the answer relied on, with its identifier and version, through the payments API. The app shows that section inline.
- Consequence
- Evidence travels over an authenticated path instead of a public link, at the cost of one more field in the API contract and in the connector.
2026-11-22 The database is disposable because its data is reproducible
- Why
- The SQL database bills while it exists, and everything in it is synthetic and generated from a fixed seed.
- Decision
- Stop takes a BACPAC export and then removes the database. Start recreates the schema, the grants and the seed data. Components can be started separately, so a SQL-only session does not start API Management.
- Consequence
- Idle cost is lower, but start takes time and the lifecycle scripts become part of the lab that has to be tested too.
Current state
This is a snapshot from the project notes and run records of 2026-11-22 and 2026-11-23. Each row says what kind of evidence stands behind it. Nothing is marked as working when I could not point at a run.
| Capability | Status | Evidence and limits |
|---|---|---|
| Payment lookup and hold explanation from the operator app | Verified live | Works in the Operator app with a synthetic payment: a lookup, then an explanation that names the policy version and section it relied on, with the cited policy section shown inline (first screenshot below). |
| Counterparty investigation with two Foundry agents | Verified live | On 2026-11-23 a request queued from the Operator app ran both agents through a local worker. It returned a direct and a group-linked synthetic payment, with the registry records it relied on. |
| Ambiguous company name, Teams approval, resume | Verified live | A name that matched four legal entities paused before any payment was searched. After a Teams approval picked one identifier, the same investigation resumed and completed (2026-11-23). |
| Fixture tests for the counterparty scenario | Tested locally | Eight automated tests cover the pause, approval binding, replay, a registry outage and untrusted text in registry data. They use fixtures, so they say nothing about live behaviour. |
| Worker running without a person | In progress | The worker runs on demand under the operator's own login. Running it unattended needs a scoped Dataverse application user, which is not set up yet. |
| Review cases opened from the Copilot Studio assistant | Not verified | The assistant, its agent flows and the case table are built. I have not re-verified this route for this snapshot, so it carries no green mark. |
| Payment tools exposed over MCP | Verified live | A Foundry prompt agent called GetPayment and ExplainHold through an MCP toolbox and answered a question about a held payment, with the tool calls approved by the user (trace below). The gateway behind the tools is a temporary Developer API Management instance with exactly two read-only tools; a live check shows anonymous calls to it are rejected (HTTP 401). |
| On-demand start and stop to avoid idle cost | In progress | Scripts and Terraform exist and were validated with previews. The first paid start and stop cycle has not run. |
| Repeatable Foundry evaluations and governance | Planned | On the list, with no results to report yet. |
| Analytical slice in Microsoft Fabric | Planned | Designed only. It depends on Fabric capacity that I have not confirmed. |
Engineering challenges and lessons
- Authentication at the API edge and authorization of the operation are different questions. A call can reach the gateway and still lack the consent for the scope it needs. My early authenticated attempts from the command line failed on exactly that, a missing delegated Payments.Read consent, which is the boundary the design relies on.
- A private document can be good evidence without being a public link. The app first tried to open the policy file directly and the private storage correctly refused. The fix was to return the cited excerpt through the API and keep the storage private.
- Human approval is part of a reliable workflow, not an exception. An ambiguous company name should stop the investigation instead of quietly picking a company. In the live run, four candidates came back and the payment search waited for a person.
- An ontology represents relationships; it does not turn one into another. A shared accounting parent is not a statement about beneficial ownership, and a missing parent record is not proof that none exists.
- A successful interactive run is not an independent background service. Both counterparty runs worked, but with a person present. The identity an unattended worker needs is still open.
Evidence and screenshots
Three pictures from the lab: the operator app answering a question about a held payment, the counterparty investigation result in Power Apps Studio, and a Foundry trace of the agent calling the payment tools over MCP. All data in them is synthetic, apart from the public registry records. Registry names and identifiers appear exactly as the registry returns them.



Source code and reproducibility
The code is public on GitHub under the MIT licence: net9876/minibank. It is a work in progress, like the lab itself, and some parts are unfinished. It holds no credentials: tokens come from your own az login, prompts or managed identities, and the files with your subscription settings are generated locally and git-ignored.
What is reproducible is the setup: Terraform for the Azure resources, a seeded generator for the synthetic data, scripts for the policy documents, and a run guide for the counterparty scenario. Running it needs your own Azure subscription and Power Platform environment, and it creates billable resources.
What’s next
- Run the worker without a person, with a scoped Dataverse application user.
- Run the first full start, stop and restore cycle of the on-demand gateway, including the MCP tools.
- Add repeatable evaluations for the agents: identity resolution, citations, tool arguments, ambiguity handling and injected instructions in source text.
- Extend the scenarios across more platforms, with tool-level observability.
- Keep ASA pointed at it: the next questions about MiniBank are the ones an independent auditor asks.