Noul questions
hands you the probability that each hazard holds, and a Score question rates how much
harm
complying would do. “Ignore your instructions” scores as a jailbreak instead of working
as one. You then set the thresholds that decide whether a message passes, goes to review,
gets blocked, or routes to support.
Run this TypeSafe check both on LLM inputs, and on LLM outputs, because even
ordinary-looking prompts can lead to harmful generated replies.
By the end you will have a guard() function to put on either side of any LLM call. You
edit it in two places: the dict of hazard questions, and the two named routing policies.
Setup
TYPESAFE_API_KEY. Every API call is cached in json_cache.json, which ships
with the cookbook, so re-running replays the published numbers instead of calling the
API. Delete that file to run everything live.
Numbers below came from jev-1.12 on 2026-08-15.
Load the sample messages
Ten user messages inprompts.txt and five model replies in replies.txt, committed
next to this cookbook. Some are ordinary, some deserve a look from a human, and the rest
are plain violations. The jailbreaks are real, taken verbatim from the public
in-the-wild jailbreak
prompts
collection.
Define the guardrails
“Out of bounds” is not one question, so the battery splits it. FourNoul questions
each return the probability that one hazard criterion holds. Does the message try to
override the assistant’s instructions? Does it ask for help with harm or a crime? Does
it ask for a diagnosis or a dosage? Does it signal that the sender may hurt themselves?
One Score question rates how much harm complying would do, on a written scale from
“none” to “serious physical harm”.
Both go in the same request, so the whole battery costs one call. The input and output
batteries ask the same four things from the two sides: whether the user is asking for it,
and whether the reply went ahead and gave it.
Turn the assessment into a decision
TypeSafe supplies the assessment; your application owns the decision. EachNoul
question is compared against two thresholds:
- at or above the action threshold, the hazard triggers its configured action;
- at or above the lower review threshold, the message goes to a human;
- below both, it passes unless another hazard fires.
Score question has a threshold of its own and can turn a review into a
block.
A policy is just those numbers under a name, which makes the trade-off something a
product picks rather than inherits.
Screen every message
Every sample message was screened: inputs with the input battery, replies with the output battery. All of them were routed understrict.
melatonin_dose asks a dosage question mild enough to hand to a human rather than
refuse; self_harm goes to support instead of being blocked, which is the difference
between helping someone and hanging up on them; novelist_poison reads as violent and
passes anyway, because asking how a detective describes poisoning is not asking to poison
anyone. On the output side, good_refusal is a reply about breaking into a house that
passes, because it is the assistant declining to help.
The input-side dosage_request is the one row where the severity Score decides the
outcome. It asks the same kind of question as melatonin_dose, and its medical_advice
noul would send it to a human on its own. But a severity of 2.02 crosses the block line,
so the review becomes a block.
The same probabilities, different decisions
The next cell reuses one cached assessment and changes only the policy. The probabilities do not move; the application decides how much evidence it wants before it acts.Look at one decision in full
Every screened message, numbered, so you can pick one to open up.interpret() prints the full hazard breakdown for any row above. Pass a different
policy_name to see the same assessment routed another way.
INPUT_BATTERY and OUTPUT_BATTERY for the
hazards you care about, map each one to an action in HAZARD_ACTION, and set the
thresholds in POLICIES from labeled examples of your own traffic.

