Skip to content
An AI assistant you can trust: four layers that make the difference

An AI assistant you can trust: four layers that make the difference

· Bert Altena

An answer that sounds right is not yet a right answer. What an AI assistant may know, what it may look up, how you can later see why it said something, and why a new check starts by only reporting.

An answer that sounds right is not yet a right answer. That is the tricky part of language models. A guess comes in the same tidy sentences as a fact, and without extra work you cannot tell them apart.

On a booking platform I work on, the internal AI assistant was given a memory this month. An assistant that knows more must also be easier to check. Four layers were built for that. None of the four is complicated, but together they make the difference between a handy toy and something you dare to build on.

Layer 1: permissions live in the data, not in the prompt

The temptation is to put it in the instructions: "do not tell staff commission amounts". The model usually complies. Usually is not enough.

Here it works the other way round. What a user may not see, the assistant does not even receive. When a staff member asks about a booking, the server only fetches the customer side: the status, what has been paid and what the customer still owes. Commission, the invoice to the owner and revenue figures are not in it. Only the administrator gets those. A sales agent only sees the bookings linked to them.

The outstanding amount comes from the same central formula as the rest of the system. The assistant calculates nothing itself. That removes a whole class of errors: a model reading a discount rule slightly differently from the accounts.

Layer 2: looking things up, read only, within the role

An assistant that only knows what you hand it in advance gets stuck quickly. So it may use tools itself: search bookings, check availability, read the handbook, search the task board. For the administrator, the source code, the settings and the logs are added.

Three limits keep that safe. Everything is read only; writing always goes through a person who confirms. The tools follow the same role as the user, so a staff member cannot reach through the assistant what they may not see themselves. And per round it may look up at most three things, with a limit on the length of what comes back.

Below every answer it says where it looked. That is the simplest form of control: if it says "Looked up in: availability", you know the answer came from the calendar and not from memory.

Layer 3: being able to see why, afterwards

Finding a mistake is only useful if you know where it came from. So for every answer the system records what went into it: the numbers of the lessons that went along, the data blocks with their length, the tools used, the version of the instructions and the engine. Customer texts are not stored, only a short subject. After 180 days it is removed.

Below every answer an administrator sees the link "Why this answer?" with the lessons in full. If an answer turned out wrong, you can see straight away whether it was an outdated lesson, missing data or the model itself.

On top of that, anyone can rate an answer with a thumbs up or down, with a field for what was wrong. A thumbs down automatically becomes a test question in a test set. After a change to the instructions you can run that set again and see whether things got better or worse. The ideas come from existing tools such as Langfuse and promptfoo, but it simply runs inside the application, on its own data.

Three or more thumbs down within 24 hours put the assistant into a cautious mode: more checking before it answers.

Layer 4: going outside through one gate

Sometimes it helps if the assistant looks something up outside the system: how a library works, what an error message means. Every question that goes outside is also a possible leak.

So there is exactly one way out. A search query containing something that looks like an e-mail address, phone number, booking or invoice number, IBAN or amount is refused before it leaves. Searching only covers a fixed list of approved domains, and that list is enforced by the model provider; the server itself never fetches a web page. An open-source project only counts as a source with at least 500 stars, recent maintenance, a licence and no open serious vulnerabilities.

There is a daily budget of 40 searches, and every request goes into a log.

Why a new check starts by only reporting

The last lesson is about what you let the assistant do. Since recently it compares, every day, the processed calendar notices of the past two weeks with the calendar. It looks for three things: a period that is still partly open while it should be booked, a block that is wider than the notice explains, and a block that stayed after a cancellation.

It changes nothing while doing so. It only reports, and each finding has a button "How did this happen?" that shows the traces without touching anything.

That turned out to be a good choice. Of the first 57 open findings, almost all came from a mistake by a person or by the system itself, not by the assistant. Had it been allowed to fix them right away, nobody would have seen where things actually went wrong. Now the real causes have surfaced, and only once the reports have been right for a while does the question come up whether it may fix anything.

What this delivers

None of these layers makes the model smarter. They make it checkable. You know what it knew, where it looked and why it said something, and you know for sure what it could not see.

That is also the advice I would give any company letting an AI assistant loose on its own data. Start with permissions in the code, not in the prompt. Record what went into every answer. And let a new task start by only reporting. How the same idea works on a public website, I describe in a website chat that answers only from your own facts.

More of the platform is in the portfolio. If you want to talk this through, you can reach me via the contact page.

Frequently Asked Questions

Is a rule in the prompt enough to keep an AI assistant from saying something?
No. An instruction is a request to the model, not a lock. What a user may not see, the assistant should not receive at all. That filter lives in the code that fetches the data, based on the role of the user.
How do you see why an AI assistant gave a particular answer?
By recording, for every answer, what went into it: which lessons, which data, which tools and which version of the instructions. An administrator can expand that below the answer, so a mistake can be traced back to its cause.
May an AI assistant search the internet?
It can, but through one fixed gate. A query that looks like customer data does not leave the system, only approved domains are allowed, there is a daily budget and every request is logged.
Chat met ons