An AI agent can already prepare a set of company accounts. It can read a trial balance, map it to the lines of a micro-entity balance sheet, tag every figure in iXBRL and check the result against the published rules. The question that decides whether such a system belongs in production is a different one: who is allowed to press send, and what exactly do they send?
In an earlier post on this blog, The Reviewer Is Part of the System, the argument was that in healthcare the human reviewer is a layer of the architecture, not a safety net. Statutory filing is regulated too, but the human plays a different part. In filing, the person is not mainly a reviewer. The person is the credential. This piece describes the architecture that follows from that, as it is built in FileClerk, a UK company filing tool whose main users are AI agents.
Why this matters now
Two deadlines make agent-driven filing a practical problem in the UK rather than a thought experiment. HMRC and Companies House closed their joint Corporation Tax online service for small companies on 31 March 2026, so returns and accounts now go through commercial software. From 1 April 2028, Companies House will accept annual accounts only in iXBRL format from commercial software; its web and paper routes close for accounts (GOV.UK). Every company has to move, dormant ones included.
Many of the people who run several companies will not move to another web form. They will ask an agent to do it. So the filing layer has to be safe to call from an agent, and the safety cannot depend on the agent behaving well.
The rule: the agent prepares, the person authorises
A Companies House accounts filing needs two kinds of secret. The software holds a presenter ID and code, issued when Companies House accepts it as filing software. The company holds its own authentication code, which says that this company agrees to this filing. HMRC has the same split: the customer's Government Gateway user ID and password are theirs, and the software prompts for them at submission time.
FileClerk's rule is simple and it has no exceptions: the company's secret never enters an LLM prompt, a log, a database or a file. A person types it, at send time, and the server holds it in memory for that one request.
That rule shapes the whole interface. The agent can do everything up to the send: look up the company, compute deadlines, build the accounts, validate them, and ask for approval. The MCP tool that asks for approval does not take the authentication code. It cannot, because no parameter exists for it. It returns a link. The person opens the link, sees what will be filed, types the code, and the filing leaves at once.
This is less convenient than a fully autonomous agent. It is also a design where a compromised prompt, a confused agent or a leaked transcript cannot file on behalf of a company. The agent never had the key.
Approve one exact file
A link alone is not enough. If the person approves "the accounts" and the system then regenerates them, what they approved and what was sent can differ by one rounding change. So approval binds to bytes, not to a description.
- The agent asks for approval. The server runs the preflight on the final iXBRL file.
- When the preflight passes, the server stores the SHA-256 hash of that file with the approval.
- The approval page shows that file. The send takes only that file, and the hash must still match.
Any change to the figures means a new preflight, a new hash and a new approval. There is no path where the agent edits a number after the person agreed to it.
A preflight that refuses, and says every reason at once
Before an approval link exists, the file must pass three kinds of check:
- FileClerk's own accounts rules. These are deterministic code with tests. An LLM may suggest how a ledger account maps to a balance sheet line; code decides, and every figure that the schema says is an integer is an integer.
- The public Companies House validator. If the registrar's own tool rejects the file, the file is not sent.
- The totals. The balance sheet must balance.
Any failure refuses the request, and the response lists every reason in one reply. That detail matters for agents more than for people. A person fixes one error, tries again and finds the next one. An agent given one error at a time burns calls and context on a loop. Given the full list, it can fix everything in one pass.
Slow down the first live filings
Tests and validators catch most problems, but the first live filings are where unknown problems appear. So the first live filings wait for an operator. While fewer than five live filings have been accepted, every new one stops in a state called awaiting_operator_go. An email to the operator names the company, the period and the checks. The operator clears it with one command, and only then does the owner get a fresh approval link. A rejected filing resets the count to zero.
This is a human in the loop on the vendor's side, not the customer's side. It costs a few minutes per filing at the start, and it ends by itself once the record shows the path works.
Never resend an ambiguous reply
Gateways fail in untidy ways. A request can time out after the registrar received it. A reply can carry only a generic error. The tempting fix is a retry, and in filing a retry can mean a duplicate submission on the public register.
So a filing has explicit states: sending, submitted, unknown_will_poll and refused. A reply that cannot be classified goes to unknown_will_poll. A background job asks the gateway for the result later, and the system never sends that filing again by itself. An agent that calls the status tool sees the state; it cannot trigger a resend.
Prove it on the test service first
Companies House gives filing software a test account and reviews the test submissions before it issues live credentials. FileClerk treats that review as an exam: every test file is proved locally and against the public validator first, and no test submission number is ever reused. The same discipline continues in production. Its rehearsal mode runs the real product path, from the agent's approval request to the approval page, against the test gateway, with only the registrar's test company numbers allowed.
One core, three doors
People still use screens while they move to agents. In FileClerk every feature is one core function with three doors: an MCP tool, a REST route and a page in the Console. The approval rule sits in the core, so it holds the same way whichever door the request came through. A safety rule that lives only in the UI is a rule an agent will walk around.
What carries over to other regulated domains
Healthcare puts the human in the decision. Filing puts the human in the authorisation. The patterns are general:
- Keep the consequential secret out of the model. If the agent never holds it, no prompt can leak it.
- Approve bytes, not intentions. Hash what the person saw and send only that.
- Refuse with the full list. Agents fix in batches; give them the batch.
- Gate the first live runs by hand, and let the gate expire on evidence.
- Never retry what you cannot classify. Poll for the truth instead.
None of this makes the agent less useful. It makes the agent safe to give real work, which is the only kind of useful that matters in a regulated system.
Disclosure: FileClerk is built by the founder of Hackathon Raptors.

.jpg)
