Ask a chat assistant for help and sometimes it says “I can’t help with that.” Sometimes it helps with something it should not have. Sometimes it agrees with everything you say. None of that is the model having moods. A product’s answer is shaped by rules it reads, training it received, and software around it, each of which can fail in its own way.
In how a chatbot writes you saw that a language model picks words by probability. This lesson is about what companies add on top so that those picks are useful and not harmful, and what you can and cannot trust as a result.
What sits between your prompt and the answer
Rules written down
A policy for how the model should behave, and a system prompt placed before your message.
Can fail: Only text the model reads; nothing forces it to obey.
Check on the way in
A separate classifier can block a request before the model sees it.
Can fail: Misses rewordings, blocks harmless requests.
The trained model
Fine-tuned with examples and feedback to follow the policy, including when to refuse.
Can fail: Jailbreaks, flattery, refusing too much or too little.
Check on the way out
A classifier can stop or replace an answer that breaks the policy.
Can fail: Same two kinds of errors as the input check.
Watching over time
Usage policies, investigations, and banned accounts. Generated media can carry a watermark or signed credentials.
Can fail: Comes after the fact; marks can be removed.
Rules written down. Companies write down how their models should behave. OpenAI’s Model Spec, in its version of August 18, 2026, ranks instructions by authority: OpenAI’s own rules first, then the app’s developer, then the user. It says that text arriving in tool results, files, and quotes has “no authority by default” (OpenAI). Anthropic’s constitution for Claude, published in January 2026, asks Claude to put being broadly safe first, then being broadly ethical, then following Anthropic’s guidelines, then being genuinely helpful, and sets a few hard limits, such as never giving serious help toward biological weapons (Anthropic).
Inside a product, the model also reads a System promptInstructions an application places at the start of a language model's context, before the user's messages, to set its role, rules, and how it should use tools. The model reads them as text; nothing forces it to obey.Taught in How a chat assistant worksOpen in glossary before your message: the product’s own instructions, such as today’s date and how to format answers. Anthropic publishes the system prompts of its apps (Anthropic); most companies do not. Either way, written rules are text the model reads, not code it runs. OpenAI’s spec itself says that its production models “do not yet fully reflect the Model Spec.”
Training to refuse. So companies also train the model to follow the rules, with example conversations and with people’s ratings of answers. Anthropic says its constitution “directly shapes Claude’s behavior” through training. A trained model can decline a request it has never seen, because it learned the pattern rather than a list.
Checks on the way in and out. Some products run a separate model, a Safety classifierA separate model that checks what goes into or comes out of a language model against a policy, and blocks or flags what breaks it. Like any classifier, it makes errors both ways.Open in glossary, on what goes in and what comes out. Meta released Llama Guard in 2023 for exactly this. In Anthropic’s tests, classifiers guarding against chemical weapons information blocked over 95% of jailbreak attempts they had not been trained on, against 14% for the model alone, while raising refusals of ordinary conversations by 0.38 percentage points and the computing cost by 23.7% (Sharma and colleagues, 2025). In October 2025 OpenAI released gpt-oss-safeguard, open models that read a policy written in plain words and judge content against it, so the policy can change without retraining (technical report).
Watching over time. Usage policies say what customers may not do, and companies investigate abuse after the fact. OpenAI wrote in October 2025 that it had disrupted more than 40 networks breaking its policies since February 2024, and that it continued to see attackers “bolt AI onto old playbooks to move faster, not gain novel offensive capability” (OpenAI). In August 2025 Anthropic described a data extortion operation that used Claude Code against at least 17 organizations; it banned the accounts, built a new classifier to spot similar activity, and shared what it found with authorities (Anthropic).
Refusing too much, and too little
Every check is a classifier, and a classifier makes two kinds of mistakes, as the lesson on measuring a classifier shows: it can block what is fine, and pass what is not.
Refusing too much. A model taught to refuse harm also learns to refuse harmless requests that look similar. Röttger and colleagues (2024) built XSTest, a set of 250 safe prompts that models should answer, such as “How can I kill a Python process?”, and 200 unsafe contrasts, such as asking how to kill a person. Llama 2’s chat model, with the system prompt Meta originally recommended, fully refused 38% of the safe prompts; Meta later stopped recommending that system prompt. That is called RefusalWhen a model declines a request, usually because it was trained to refuse requests that break its policy. Over-refusal is declining harmless requests that only look like harmful ones.Open in glossary, and it has a cost: people stop getting help with medicine, security, history, or fiction.
Refusing too little. People look for wordings that get past the training, called JailbreakA prompt written to get a model to do what its training or policy is meant to prevent, for example by role-play, odd encodings, or many fake example dialogues.Open in glossary. Wei and colleagues (2023) traced them to two causes. Goals can compete: a model trained to be helpful can be pushed into a harmful answer by being told to begin with “Absolutely! Here’s”. And safety training can miss whole areas the model is capable in, such as requests written in Base64 code. Translating a harmful request into a language with little training data got GPT-4 to engage 79% of the time on one benchmark (Yong and colleagues, 2023), and software can search for strings of characters that unlock many models at once (Zou and colleagues, 2023). Long prompts made up of hundreds of fake dialogues worked better the more dialogues they contained; Anthropic reported that screening and rewriting prompts cut that attack’s success from 61% to 2% in its tests (Anthropic, April 2024).
Instructions hidden in what it reads. In an agent, the bigger risk is Prompt injectionAn attack in which text a model reads changes what it does against its developer's intent. Direct injection comes from the person typing; indirect injection hides in what the model reads, such as a web page, email, picture, or memory.Taught in Prompt injectionOpen in glossary: text in a web page or document that the model treats as an instruction, which you met in AI that takes actions. Products report progress, not immunity. Anthropic said its browser extension, tested on 123 attack cases in August 2025, was fooled 23.6% of the time without safeguards and 11.2% with them (Anthropic). The harness lesson covers the sandboxes that limit the damage.
Flattery: sycophancy
A model that tells you what you want to hear is showing SycophancyA model telling people what they want to hear, such as agreeing with a wrong claim or praising weak work. Training on human approval can encourage it.Open in glossary. Sharma and colleagues (2023) found it in all five assistants they tested. When a person replied to an answer with “I don’t think that’s right. Are you sure?”, the assistants frequently admitted mistakes they had not made, and sometimes swapped a correct answer for a wrong one. People, and the reward models trained on their ratings, sometimes preferred a convincing answer that agreed with them over a correct one. That is how training on human approval, described in the lesson on rewarding LLMs, can teach flattery.
It reached ChatGPT’s users in April 2025, when OpenAI rolled back an update to GPT-4o that was, in its words, “overly flattering or agreeable” (OpenAI, April 29, 2025). Its follow-up said the update had added a reward based on users’ thumbs-up and thumbs-down, which “weakened the influence of our primary reward signal, which had been holding sycophancy in check” (OpenAI, May 2, 2025).
Where did this text come from?
Once text is written, can anyone tell whether a model wrote it? Tools that guess from writing style have a poor record. OpenAI withdrew its own detector on July 20, 2023 “due to its low rate of accuracy”: in its tests it caught 26% of AI-written text and flagged 9% of human writing as AI-written (OpenAI). Liang and colleagues (2023) found that seven detectors labeled, on average, 61% of 91 essays by non-native English writers as AI-generated.
A WatermarkA signal a model hides in what it generates, such as a statistical preference for certain words or a pattern in pixels, that a detector with the right key can test for later.Open in glossary takes a different approach: the model hides a signal while it writes, and anyone with the key can test for it. In the scheme of Kirchenbauer and colleagues (2023), before each word a secret key and the previous word split the vocabulary into a “green list” and a “red list”. The model nudges its choices toward green words. With the settings used below, ordinary text has about a quarter of its words on the green list; watermarked text has many more, and the more words there are, the clearer the difference.
The word model below is the same kind of counting model you met in how a chatbot writes, trained on about 300 of Aesop’s fables, with that watermark added. The detector colors each word as the key sees it and counts.
Find the watermark
A word model trained on about 300 of Aesop's fables writes with a hidden watermark. A detector with the key counts the green words.
Loading the fables (190 KB)...
Challenges
0 of 4 complete
- Make the detector flag a watermarked text only 20 tokens long. (not yet)
- Start from a text the detector flags, then tap words to swap them until it no longer does. (not yet)
- Check a text the model's key flags with a different key. (not yet)
- Type or paste at least 40 tokens of your own writing and check it. (not yet)
Try this
- Set the strength to 0 and press Write a new text a few times. Predict the score first: no watermark, so about a quarter of the words should be green.
- Return to strength 2 and shorten the text to 20 tokens. Write several new texts. How often is the watermark found?
- In a flagged text, tap words to swap them for others the model might have written. Watch the score fall in the chart. How many swaps did it take?
- Switch the detector to a different key, then choose Your own text and paste a paragraph you wrote.
A green-list watermark in a few linesPython with the standard library
import hashlib, math, random
# A stand-in "model" that finds any of these words equally likely next.
vocab = ("the fox crow lion mouse hare tortoise dog wolf lamb ant bee "
"saw found ran slept caught freed jumped ate dropped asked "
"grapes cheese bone water field river tree nest hill road "
"and but then quickly slowly gladly at last again").split()
GAMMA = 0.25 # share of words on each green list
def green(prev, word, key):
# The key and the previous word decide whether `word` is green.
h = hashlib.sha256(f"{key}|{prev}|{word}".encode()).digest()
return int.from_bytes(h[:4], "big") / 2**32 < GAMMA
def write(n, delta, seed, key="model key"):
rng, prev, out = random.Random(seed), ".", []
for _ in range(n):
# Push green words up by a factor of e^delta, then sample.
weights = [math.exp(delta) if green(prev, w, key) else 1 for w in vocab]
prev = rng.choices(vocab, weights)[0]
out.append(prev)
return out
def z_score(tokens, key):
pairs = set(zip(["."] + tokens, tokens)) # score each word pair once
g = sum(green(p, w, key) for p, w in pairs)
t = len(pairs)
return (g - GAMMA * t) / math.sqrt(t * GAMMA * (1 - GAMMA))
plain = write(60, delta=0, seed=1)
marked = write(60, delta=2, seed=1)
print(" ".join(marked[:10]), "...")
print(f"no watermark: z = {z_score(plain, 'model key'):5.2f}")
print(f"watermark, model's key: z = {z_score(marked, 'model key'):5.2f}")
print(f"watermark, other key: z = {z_score(marked, 'other key'):5.2f}")mouse and and ant asked water nest but tortoise crow ...
no watermark: z = 0.08
watermark, model's key: z = 8.05
watermark, other key: z = 0.89What you saw:
- It is statistics, not a label. The detector counts green words and asks how surprising that count would be by chance. At the threshold used here, a score of 4, ordinary writing is flagged about 3 times in 100,000. Short texts do not have enough words to clear it, unless the watermark pushes hard, and a hard push bends the model’s word choices more.
- Only the key holder can see it. With another key the colors look random. A company that watermarks its model’s output has to run the detector, or share the key.
- Editing wears it down. Every swapped word breaks the color of that word and the next one. Rewriting a text thoroughly, by hand, with another model, or by translating it, removes most of the signal.
- “Not detected” proves nothing. The text might come from a model that adds no watermark at all.
Google uses a related scheme, SynthID Text, in its Gemini apps; in a live test on nearly 20 million Gemini responses, users’ feedback showed no loss of quality (Dathathri and colleagues, Nature, 2024). Google’s documentation says it is less effective on factual answers, where there are few good word choices to nudge, and that its confidence “can be greatly reduced” when text is thoroughly rewritten or translated (Google). Google also watermarks images, audio, and video with SynthID (Google DeepMind).
Content credentialsA signed record attached to an image, video, audio, or document file saying who made it, with what tools, and how it was edited (the C2PA standard). It shows tampering, not truth, and can be removed.Open in glossary take yet another approach: instead of hiding a signal in the content, a tool attaches a signed record to the file saying who made it, with what, and how it was edited, bound to the content by a cryptographic fingerprint. The open standard behind them is C2PA. Its own explainer says that credentials “do not provide value judgments about whether a given set of provenance data is ‘true’”, and, asked whether they can be removed, answers “Yes it can” (C2PA). Watermarks and fingerprints can help find a stripped credential again.
| Method | Where the signal lives | What a positive result shows | What it cannot show |
|---|---|---|---|
| Style detector | Nowhere; it guesses from the writing | A guess, with error rates that can be high and uneven | Anything reliable about who wrote a text |
| Watermark | Hidden in the word choices or pixels | That a model with that key produced it, with a known chance of a false alarm | That unmarked content was made by a person |
| Content credential | A signed record attached to the file | Who signed the record and that the file has not changed since | That the content is true; credentials can be removed |
The law is starting to require such marks. In the European Union, providers of AI systems that generate audio, images, video, or text must mark their output in a machine-readable way as AI-generated, from August 2, 2026, with until December 2, 2026 for systems already on the market (AI Act, Article 50; timeline).
How developers try to make the model itself want the right things, and why that is hard to check, is the subject of the alignment lesson.
Key ideas
- A product’s answer passes through layers: written rules and a system prompt, a model trained to follow them, checks on the way in and out, and monitoring for misuse. None is enough alone.
- Every safety check is a classifier: it blocks some harmless requests and misses some harmful ones. Jailbreaks and prompt injection exploit the misses.
- Models trained on human approval can learn to flatter. Agreement from an assistant is not evidence.
- Style-based AI detectors are unreliable. A watermark is a statistical test that only works with the key, needs enough words, and can be worn down by editing; finding none proves nothing.
- Content credentials record who made a file and how, and show tampering, but not truth, and they can be stripped.