Skip to content

How the assistant on this site is guarded and tested

Seven narrow tools, free models with a fallback chain, a guard on every answer and 100 eval cases: what keeps the assistant on this site from inventing facts about me, and what it still cannot catch.

Published 4 min read

The assistant on this site answers questions about my work. A wrong answer here is not a small bug: it would put a skill, a date or a result on my name that is not true. So it is built to say less rather than more, and it is measured. This is how.

What it may do

It is one agent with seven tools. Four read the published site: search, a single document, the project list and the CV. Two guide the visitor: one opens a page, one suggests follow-up questions. The seventh hands a message to me, and only after the visitor says yes. None of them can change the site. Publishing is out of reach of every agent, and a test fails if that ever changes.

Each answer may read at most four documents and 40,000 characters. Asking for the same search or the same document twice returns “already provided”, so the model works with what it has.

Before the model is called

The cheapest checks come first: kill switches, a daily budget, per-visitor rate limits kept in the database, so a restart does not reset them, and a cap on simultaneous streams. Only free-tier models are in the chain; a model that would bill is left out, and the server says so in its boot log.

The visitor’s text goes into the prompt fenced as data, never as instructions. The conversation history comes from the browser, which could send anything, so an earlier answer is replayed only if it carries the server’s signature: a keyed hash over the session, the message id and the exact text. An edited or invented “assistant” turn is dropped.

While it writes

Gemini answers first, then free models on OpenRouter. A circuit breaker pauses a model after three failures in a row or any rate limit, so a model that is down costs no visitor a timeout. The chain may switch models only before the first word reaches the visitor. After that, a failure ends the answer and the visitor can retry: an answer never starts twice.

As the answer streams, an output guard removes three things before anyone sees them: a canary line in the instructions that no answer has a reason to contain; any run of twelve words copied from the instructions, unless the site’s content says the same; and secrets, internal addresses and key-shaped strings. It holds text back only while it could still become one of these, and it never cuts a word in two.

After it answers

Every finished answer gets deterministic checks. They are free, take milliseconds and are stored with the answer. They flag an answer of 25 words or more that cites nothing, a citation to a document that does not exist (its marker is removed), a figure that no cited document holds, an answer in the wrong language, and a prompt injection in the question. An answer that ended with no words gets one more call, with tools off. In the admin, each answer keeps its trace: what it cited, which model answered, how long it took and what the guards caught.

How it is tested

Unit tests drive the real agent with a scripted model, so no test calls a real one. Property tests stream answers cut into random pieces and check that the canary, a key-shaped string or twelve copied words never get through, that no invented citation survives, and that the assistant can open only this site’s own pages.

Then there are evals: 100 cases in 15 categories, from plain facts and questions that need several steps to hallucination traps, prompt injections, personal data and German. The recorded run of 2 November 2026 passed 93 of 100: all 3 hallucination traps, all 9 German questions, 8 of 9 injections and 16 of 18 fact questions. That run is the baseline. A change to the system prompt gets a new version, and the new version must not score below it.

What it still cannot catch

A filter on text cannot see a leak the model encodes, in base64 or a cipher, or one that travels through a tool’s input. Tool inputs are checked after the fact; encoded text is an open problem. It is one more reason the tools only read published content.