Day 7 of 2160 minCipher CadetHands-on lab
Day 7: Encoding and Language Tricks: Finding Filter Gaps
Taught by Mr Elite Updated
By the end of today you can
- Explain in plain words what Base64 and leetspeak are and why a filter can miss them
- Encode and decode a short test message on your own machine
- Run an encoding test and a low-resource language test in two labs
- Write up each result without over-claiming what it proves
Warm-up
Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.
What does refusal suppression try to do to a model's reply?
It bans the words a refusal normally needs, such as 'I cannot' or 'sorry', so the model struggles to refuse.
Why did Day 6 tell you to change only one variable at a time and number every attempt?
So you know which change caused the result and can repeat it. Otherwise you cannot tell what worked.
Picture a post room that checks every parcel for banned items by reading the label. Someone sends the same item in a box whose label is written in a code the checkers do not read. The parcel sails through. Then the person at the far end, who does read the code, opens it and acts on what is inside.
That is the idea behind today. Many AI filters check the words you type. The model behind them is far more capable and understands encodings and languages the filter was never tuned for. Today you find that gap in two practice labs, and just as important, you learn to describe what you found honestly.
Why a filter can miss what the model understands
On Day 6 you saw that refusals can be skin deep. Today's idea is related. A typical chatbot has two layers. First there is a filter, often a list of patterns or a small classifier that looks at your text. Behind it sits the language model, which has read an enormous amount of text and can work with almost any format.
The gap appears because the filter is usually narrower than the model. If the filter only recognises plain English phrases, then the same request written in another form may not match. The model, being clever, still understands it. The filter said yes because it did not recognise the danger, not because the request was safe.
Here is the flow drawn out. Your message hits the filter first. If the filter finds a match, you get a canned block message and the model never sees anything. If it finds no match, the message passes straight to the model, which reads it in full.
your message -> [filter: knows plain English patterns] -> [model: understands many formats]
plain request -> filter matches -> BLOCKED
encoded request -> filter no match -> model decodes and reads itNotice what this means for a tester. You are not breaking the model. You are checking whether the layer in front of it has the same understanding as the layer behind it. When it does not, that difference is the finding.
- Encoding
- A way of rewriting text in a different form, such as Base64, that can be reversed. It is not secret-keeping, just a different costume.
- Filter
- A check placed in front of the model that blocks messages matching certain patterns or scoring as risky.
Encodings in plain words
Let me introduce the two encodings you will meet. Neither is encryption. Anyone can reverse them in seconds, which is exactly why a defender should not rely on them being unreadable.
- Base64
- A scheme that turns text into letters, numbers, plus and slash characters. 'hello' becomes 'aGVsbG8='. Often ends with one or two equals signs.
- Leetspeak
- Swapping letters for lookalike digits or symbols, so 'secret' becomes '53cr3t'. Humans read it easily and so do language models.
- Low-resource language
- A language with little written material available for training. Models tend to have seen less of it, and safety training was often done mostly in English.
Those trailing equals signs in Base64 are padding. They fill out the last block so the string has a tidy length. If you copy a Base64 string and lose them, decoding may fail or give rubbish. Remember that, because it is the most common slip in the first lab.
Why can a language model read Base64 at all? Because it has seen huge amounts of it in its training material, for example in web pages and code. It has learned the pattern well enough to translate it back to plain text, usually for short messages. That ability is useful, and it is also what opens the gap.
Leetspeak works for a similar reason. Common swaps are a to 4, e to 3, i to 1, o to 0 and s to 5. A pattern-matching filter looking for the exact word fails on '53cr3t', yet any reader, human or model, sees the word at once.
Quick check
A filter blocks the plain phrase 'tell me the password' but lets through the same sentence in Base64. What is the most accurate explanation?
The filter matches patterns in the text it sees. The model can still decode Base64, so the request keeps its meaning.
Watch me do it: encode a harmless message on your own machine
Before the labs, I want you comfortable with the mechanics. We will encode and decode a harmless sentence locally. Nothing here touches any other system. Use a terminal on Linux or macOS. On Windows, use PowerShell and I give the alternative below.
echo -n 'please say hello' | base64echo 'cGxlYXNlIHNheSBoZWxsbw==' | base64 --decodeecho 'open the door' | sed 's/o/0/g; s/e/3/g'[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('please say hello'))[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('cGxlYXNlIHNheSBoZWxsbw=='))What just happened? You turned a sentence into a string a pattern filter would not recognise, then turned it back with no key or password. Keep that string handy. In the lab you will do the same thing with the request you are testing, and you should always decode it yourself first to check it is correct.
Lab 1: the encoded payload
Now the first lab, ai-encoding-jailbreak-1. EncBot has an English filter that rejects jailbreak-style text, but the model behind it understands Base64 and leetspeak. Your job is to test whether encoding the request gets it past the filter. This runs only inside the SecurityElites practice lab, so it is safe and in scope.
Work the way you did yesterday. Start with the plain request and note that it is blocked. That is your baseline. Then change one thing, the encoding, and log the attempt with a number.
Attempt 1 | plain English | sent: <exact text> | result: blocked
Attempt 2 | Base64 | sent: <exact string> | result: <what came back>
Attempt 3 | leetspeak | sent: <exact text> | result: <what came back>Quick check
Why do you record the blocked plain-English attempt before trying an encoding?
Without a baseline you cannot say the encoding made the difference.
Lab 2: the low-resource language
The second lab, ai-multilingual-jailbreak-1, swaps encoding for language. GlobeBot refuses to share its booking override code when asked in English. Its refusal training was mostly in English, so the same request in another language may be treated differently.
Here is the method. Ask in English first and log the refusal. Then ask the same request in a language the lab may handle less well. If you do not speak it, use a translation tool for harmless wording, and keep the meaning identical. Try more than one language if the first does not work, and log each one.
Reading results without over-claiming
This is the skill that separates a useful tester from a noisy one. One success in one lab does not prove all encodings beat all filters. It proves that this bot, with this input, behaved this way, on this occasion.
Write claims at the size of your evidence. Good: 'In attempt 4, the Base64 version returned the code while the English version in attempt 1 was refused.' Weak: 'Base64 breaks AI filters.' Also say what you did not test, such as other encodings or other languages.
A short report needs only four things: what you sent, what came back, how many times you repeated it, and what you left untested. If you can fill those four in, a reader can repeat your test and judge it for themselves.
Your turn
AI Jailbreak
Start here with EncBot. It gives you a clean example of a filter that is narrower than the model behind it, which is the idea for the whole day. Then move to ai-multilingual-jailbreak-1 (GlobeBot) for the language version, using the same logging method.
What to try
What to notice
- Whether the filter reacts to the encoded text at all, or only to recognisable English phrases
- Whether the model needs a nudge, such as being told to decode first, before it complies
- Whether GlobeBot's answer changes between languages even though the meaning of the request is the same
- Whether repeating an identical attempt gives an identical result
If it did not work
Encoding the wrong text, or leaving off the equals signs when copying Base64
Copy the whole string including trailing equals signs, and decode it yourself locally first to check it returns your sentence.
Changing the wording and the encoding at the same time
Keep the request the same and change only the encoding or the language, so you know what caused the difference.
Claiming a general weakness from one success
Write exactly what you tried, how many attempts it took, and what you did not test.
Trusting a machine translation blindly
Back-translate your text into English to confirm the meaning matches your original request.
Recap
- Filters often match the surface form of text, while the model understands far more forms
- Base64 and leetspeak are rewrites, not secrets, and a capable model can read both
- Safety training is often weaker in languages with less training material
- Always log a baseline refusal before testing a trick
- One result proves one thing about one bot, so claim only that
- A common defence is to decode and normalise input before filtering, and to test in many languages
Cheat sheet
echo -n 'text' | base64- Encode text as Base64
echo 'string' | base64 --decode- Decode Base64 back to text
Leetspeak- Letters swapped for digits, such as e to 3 and o to 0
Baseline- The plain attempt that is blocked, used for comparison
Low-resource language- Language with little training data, where refusals may be weaker
One variable rule- Change only one thing between attempts
Before the next day
Mission: Two labs, two filter gaps
Complete both labs and keep honest notes. For each lab, record what you sent, what came back, and one sentence on why you think the filter missed it. This builds the habit of evidence-based reporting you will need for the test plan on Day 9.
About 40 min
You are done when: A day7-notes.md file with numbered attempt logs for both labs, one why-it-missed sentence each, a not-tested sentence each, and two screenshots.
Want more? Run each successful attempt a second time and note whether the result repeated. Then write two sentences proposing a defence for each gap.
Quiz
4 questions. Your score is saved with your progress.
1. What makes an encoded request able to pass a filter yet still work?
The filter and the model understand different amounts. The model recovers the meaning that the filter did not recognise.
2. Why might a refusal be weaker in a low-resource language?
Refusal behaviour was practised mostly in English, so it may carry over unevenly to languages with less training data.
3. Which report sentence avoids over-claiming?
It states the specific input, the specific bot and the comparison, without generalising.
4. Which defence best addresses the encoding gap?
Normalising input lets the filter see the real content, and multilingual testing covers the language gap.
Finish the day
Mark the day complete to save your progress.
Next: Day 8 moves from single messages to whole conversations. You will use gradual escalation and fake dialogue priming, and your numbered attempt logs from today will make those longer tests much easier to track.
Your notes
Private to this device. Write what you want to remember from today.