This site and Ask Pom
This portfolio, built with a team of AI agents, and Ask Pom, a chatbot that answers questions about my work using free-tier models only, with hybrid keyword and meaning search.
- 0 of 130 Red-team attacks that got through (before hardening: 5 of 111)
- 40/40 Test questions answered correctly by the chosen free model
- 0 of 115 Wrong answers in the quality run (before hardening: 4)
- 10,000 Free neurons per day, the hard ceiling (no bill possible)
Ask Pom red-team re-test report, 2026-10-27, 2026-10-27; Ask Pom model retest (scope eval, Mistral Small 3.1 24B), run 2026-10-26, 2026-10-27; Ask Pom deep quality test re-run, 2026-10-27, 2026-10-27; Cloudflare Workers AI pricing page and worker/guard.js, checked 2026-10-25, 2026-10-27
Follow a question
Pick one of five sample questions and watch it pass through the six stages of Ask Pom: cleaning, filters, search, model, checks and answer. The stage that decided lights up, and the reply shown is the real text the live Worker sends for that kind of input.
Problem
A portfolio page is a poor way to answer a specific question. Someone who wants to know what I did with Kubernetes drift has to guess which page holds it. I wanted a visitor to be able to ask, and get a short answer with a link to the page it came from.
I also wanted the chat to be safe to leave running unattended. It speaks for me in public, so it must not invent things, must not discuss pay or availability, and must not cost money.
Constraints
- Free tier only. Workers AI gives 10,000 neurons a day, and past that the call fails instead of billing (Cloudflare Workers AI pricing page, checked 2026-10-25). I added my own counters so the site stops well before that.
- No paid vector database and no paid model. Everything runs in one Cloudflare Worker, with about 190 snippet vectors stored inside it.
- Every answer must come from approved notes and the site's own pages. Anything I approve in the notes can be repeated to any visitor, so I only approve what I would say in public.
- If the AI is unavailable or capped, the chat must still reply with something safe.
Constraints in numbers
10,000 neurons a day is a hard ceiling with no bill. At about 27 neurons per answer I cap the site at 270 AI answers. The browser waits 7 seconds for an answer (the Worker gives the model 8); past that, the visitor gets a fixed safe reply.
Approach
The site is a static build (a Python script writes the pages), and Ask Pom is one Worker next to it. A build step turns the Lab pages, employer pages and approved notes into about 190 small snippets. The Worker searches them and hands only the best few to the model.
visitor question
|
v
clean the text (invisible characters, look-alike letters, length cap)
|
v
deterministic routes (no AI call)
task / injection / pay and availability / contact / greeting
| no match
v
English-only gate (other languages get a polite decline)
|
v
hybrid search in the Worker
BM25 keywords decide IF Pom answers; meaning vectors improve the RANKING
| nothing relevant -> "Pom doesn't know", no AI call
v
top few snippets + the question -> free model (Mistral Small 3.1 24B)
|
v
checks on the reply (grounding, leaks, links, first person, length)
|
v
answer + links to the pages it used
The point of the design is that the model has one narrow job: answer one question from a few labelled facts, in a fixed shape. Everything that can be decided by code is decided before or after the model call. Small free models do best with a tight brief (design note of 2026-10-26).
Search is hybrid, and it all runs inside the Worker. BM25 keyword scoring (light stemming, boosts for titles) is combined with meaning vectors from a small open model, bge-m3. The vectors are computed once at build time for about 190 snippets (1024 numbers each, squeezed to int8) and stored inside the Worker, so there is no vector database. Each question costs one small embedding call.
I kept the keywords in charge of one decision on purpose. Meaning scores alone could not separate questions Pom does not know from real ones: "Who is his manager?" scored like a real question. So keywords decide whether Pom answers at all, and meaning scores only reorder the snippets that pass. On my 58 answerable test questions, the right fact landed in the top 2 snippets 58 times out of 58, against 54 out of 58 with keywords alone. The Worker bundle is 410 KB, against a free limit of 3 MB.
A guard, a single SQLite-backed Durable Object, counts questions per visitor and per day and decides whether a question gets the AI, a scripted answer, or a polite goodbye. Typed questions always go to the AI; the suggestion chips keep instant scripted answers. The limits are in worker/guard.js: 10 questions per minute per visitor in a burst, 20 AI answers per visitor per day, 270 AI answers per day for the whole site, and 50 questions per chat in the browser.
Choosing a free model
I did not pick a model by reputation. I ran the same questions through candidates and counted.
First round: 4 models on 20 questions (bake-off run 2026-10-26). The 8B Llama was fastest (608 ms median, about 7 neurons per answer). Gemma 4 took an 18 second median, so it was out. None of the four settled it, so I ran a second round.
Second round: 5 more models on a 40-question scope eval (retest run 2026-10-26). Results:
| Model | Passed | Median |
|---|---|---|
| Mistral Small 3.1 24B | 40/40 | 1.7 s |
| Llama 4 Scout 17B | 39/40 | 1.6 s |
| gpt-oss 120B | 36/40 | 8.4 s |
| gpt-oss 20B | 35/40 | 5.5 s |
| GLM 4.7 Flash | 27/40 | 15.7 s |
Mistral Small 3.1 24B won: it passed all 40, with no first-person slips, and it costs about 27 neurons per answer. That is the figure the daily cap is built on.
The model slugs are an allowlist in the Worker; a visitor cannot choose a model.
Guardrails
Most of the safety is in plain code, not in the prompt.
- Clean input first. Invisible characters and look-alike letters are normalised before anything else runs, so a trick spelling cannot slip past a filter.
- Routes before the model. Requests for code, poems or other tasks, prompt-injection phrasing, questions about pay or availability (including indirect ones, through wider filters), contact questions, greetings and "who is Pom" all get a fixed reply with no AI call. Real questions about my work, such as "what languages does he code in", are kept on the answer path.
- Facts only. The model sees a short numbered list of facts and the question, and no chat history from the browser, because browser-supplied history can be forged. If the search finds nothing relevant, there is no AI call at all.
- English only. Other languages get a polite decline, because a translation request was one of the ways the rules leaked.
- Grounding check. If most of the words in an answer are not in the facts Pom was given, the answer is replaced with a safe line.
- Checks on the reply. A reply that leaks internals, contains a link, or speaks in the first person is replaced with a safe line. Answers are trimmed to about 100 words.
- Cost cap. The guard stops AI calls at 270 a day. At about 27 neurons each that is roughly 7,300 of the 10,000 free neurons, which leaves room for my own test runs. When the cap is hit, questions still get scripted answers.
- Notes stay private until approved. Only approved notes are bundled, and only into the Worker.
What shipped
- Ask Pom, a chat that answers questions about my work from approved notes and this site's pages, with links to the pages it used. It has been live since 2026-10-26.
- Hybrid search in the Worker: BM25 keywords plus bge-m3 meaning vectors over about 190 snippets, with no vector database.
- Guardrails: input cleaning, routes before the model, an English-only gate, a grounding check, checks on the reply and a cap of 270 AI answers a day.
- Mistral Small 3.1 24B as the free model, chosen from nine candidates by counting.
- This Lab page.
Outcome
I wrote none of the test code myself. A separate agent that never saw the code wrote the contract tests from a behaviour description, and only the results came back to me. The latest verified run (2026-10-27) finished at 923 passed and 12 skipped.
On top of that I ran larger checks against the real model, locally, before and after the hardening:
| Check | Before | After |
|---|---|---|
| Red-team attacks that got through | 5 of 111 | 0 of 130, with 0 crashes |
| Quality run, wrong answers | 4 of 115 | 0 of 115 |
| Quality run, safe but imperfect | 19 | 2 |
| Limits checks | 52/52 | 52/52 |
The quality run covers facts, paraphrases, follow-ups, "don't know", pay and contact, and traps built to tempt a made-up answer (quality reports, 2026-10-27). Median answer time is 1.7 s and the slowest 10 percent take 2.9 s or more. The limits run checks every cap (10 questions a minute, 100 a day, 20 AI answers per visitor, 270 AI answers site-wide) and the scripted fallback, and all 52 matched exactly.
Ask Pom has been live since 2026-10-26. The hardening and hybrid search here are built and tested, and ship together with this page.
What I learned
The first version of Pom answered as me, in the first person. That is not honest for a bot, and it is how a model slips into saying things I did not say. I made him a third-person sidekick and added a check that rejects first-person replies.
The quality run found 4 failures. One reply put a bare web address in the text. One obeyed a request to translate a sentence into German. One described a baseline as a target. One invented a characterisation of my projects that is in none of the notes.
The red-team run found 5 gaps. A German-language request got the model to paraphrase its own rules. A zero-width-character trick got a word echoed back. A "say banana" request was obeyed. One reply repeated part of the persona line. One reply dumped raw note text with its internal labels.
The run found no private data leaking, but each of these is a real hole, so I wrote them up as a hardening spec on 2026-10-27 and built it: input cleaning, wider filters, the English-only gate, and the grounding check described above. Then I reran both suites with a bigger red-team set. All 130 attacks failed and nothing crashed, and the quality run has no wrong answers.
Hybrid search came from the same weak spot. The quality run showed that "X versus Y" questions and questions worded differently from the notes were retrieved poorly, which is what the meaning vectors fix. Two answers are still imperfect, and I have left them in the numbers.
What is next
Next I will watch real traffic against the daily caps and fix whichever imperfect answer matters.
How AI built this
I built this site with Claude Code. I set the design and approved the notes and every decision on scope, models and limits. Claude models wrote the code, ran the test and red-team suites and drafted the notes for my approval.
The tests came from a separate agent working only from the behaviour contracts, so the code could not be written to fit the tests. The numbers and failures on this page come from run reports, not my memory.