LLM sentinel.
classifier.kind: llmThe sentinel can be your only classifier. A chat model reads the sanitized content with no tools, skills or agent block available, and has to reply with one of the five tokens. Any other reply blocks the content.
If classifier.provider and classifier.model are empty, your agent model is the classifier. Set them to a local llama-server or Ollama model to keep untrusted content on your machine.
The same sentinel is used in two other places. With the embedded models it runs as phase 3, using a shorter list of tokens. With Jev it answers whenever Jev can't reach a decision.
- Default on
belai,belai-no-classifier- Model
- the classifier model, or the agent model if unset
- Checks for
- all four threat types
- Reasoning
- effort
noneby default - Bad reply
- content is blocked
How replies are parsed
All sentinel parsers use the same normalizer. It removes <thinking> and <reasoning> blocks, bold markers and code fences, then accepts a token only if it is alone on its line. If a reasoning block is never closed, everything after it is dropped, so a token inside unfinished reasoning can't count as the answer.
| reply | result |
|---|---|
<thinking>…</thinking>⏎SAFE | SAFE |
**JAILBREAK** | JAILBREAK |
SAFE. | SAFE |
maybe SAFE? | malformed, blocked |
| two different tokens on two lines | ambiguous, blocked |
The security sentinel only reads the content field. If a reasoning model uses up its token budget while thinking, content is empty and the content is blocked. Belai does not take the answer from reasoning_content. The budget leaves room for a short reasoning preamble and the token.
The classifier picker lists a limited set of providers. huggingface appears when HF_TOKEN is set, and openrouter appears when its key is available. Custom providers, llama-server and ollama are always listed, with a warning that general chat models are a poor fit. General chat providers such as OpenAI and Anthropic are not listed.
Content larger than classifier.chunk.max_bytes (1 MiB by default) is split into chunks that overlap by one eighth. Up to four chunks are classified at a time by default, and the strictest chunk verdict applies to the whole content. SAFE verdicts are cached for the session and blocked content is remembered by hash. The cache key includes the classifier's identity, so a verdict from one engine is never reused by another.