Uploaded October 2026 | Updated November 2026, 3 days ago
Prompt injection firewall for your AI app: fine-tune TII's Falcon-H1-Tiny 90M on a MacBook with MLX LM, a full fine-tune of every block (no LoRA), no NVIDIA GPU. The stock model blocks 100 % of normal prompts (a wall, not a firewall); after 7 min 33 s of training on the Mac's GPU it catches 96.9 % of attacks and blocks only 7.4 % of normal prompts (F1 0.739 → 0.959), about 6 ms per message, then runs in Ollama. Lesson 6 of the series Fine-tune LLMs on your Mac.
Full series playlist: youtube.com/playlist?list=PLbDRDyy1iJ_c
My full course, Fine Tuning LLM with Hugging Face Transformers for NLP: kgptalkie.com/fine-tuning-llm
All my courses: kgptalkie.com/udemy-courses
Base model: huggingface.co/tiiuae/Falcon-H1-Tiny-90M-Instruct
Training data (Apache 2.0): huggingface.co/datasets/neuralchemy/Prompt-injection-dataset
Unseen test data (Apache 2.0): huggingface.co/datasets/deepset/prompt-injections
Falcon-H1-Tiny Injection Firewall is built using artificial intelligence technology from the Technology Innovation Institute.
This is a first version, trained for 7 min 33 s as a quick test to show the technique. On prompts it has never seen (deepset, English) it catches 87.5 % of attacks and still blocks 20.2 % of normal prompts, so use it as one layer of defence, not the only one.
00:00 The result: an AI app that obeys an attack
00:21 Base model blocks every normal prompt
00:30 After 7.5 minutes of training
00:57 The job: a prompt-injection firewall
01:19 The model: Falcon-H1-Tiny 90M
01:43 The tool: MLX LM full fine-tune
02:00 Training data: neuralchemy
02:21 Rows: normal, attack, hard negative
02:45 Unseen test set: deepset
03:11 The firewall prompt
03:34 Scoring in one forward pass
03:53 Baseline: F1 0.739 but useless
04:31 Training data as chats
04:44 Full fine-tune vs LoRA
05:05 Training settings
05:32 Training on the Mac GPU
06:00 Same two messages, after
06:08 Scoreboard: 100 % to 7.4 % blocked
06:36 Honest notes
07:30 Put it in front of an app
08:00 With the firewall
08:26 Run it in Ollama
09:03 The model on Hugging Face
09:31 Recap
09:55 Next lesson
Lesson 5 (brand voice with MiniCPM5): youtu.be/VL10O4wkFu8
Lesson 4 (Gemma 3 support tickets, no code, Unsloth Studio): youtu.be/HsYpr0kttg4
Lesson 3 (System 1 decision model with Qwen 3.5): youtu.be/wr3dMotYFMU
Lesson 2 (invoice PDF to JSON with Granite 4.0): youtu.be/1U3u7kqz4zQ
Lesson 1 (text to SQL with MLX): youtube.com/watch?v=tsShl5GSGLE
Machine: MacBook Pro, Apple M5 Max, 36 GB unified memory. Full fine-tune of 74.4M of 91.1M parameters with mlx-lm, 550 steps × 16 messages, 7 min 33 s, 5.6 GB peak memory; Q8_0 GGUF 94 MB in Ollama.
Prompt injection firewall for your AI app: fine-tune TII's Falcon-H1-Tiny 90M on a MacBook with MLX LM, a full fine-tune of every block (no LoRA), no NVIDIA GPU. The stock model blocks 100 % of normal prompts (a wall, not a firewall); after 7 min 33 s of training on the Mac's GPU it catches 96.9 % of attacks and blocks only 7.4 % of normal prompts (F1 0.739 → 0.959), about 6 ms per message, then runs in Ollama. Lesson 6 of the series Fine-tune LLMs on your Mac.
Full series playlist: youtube.com/playlist?list=PLbDRDyy1iJ_c
My full course, Fine Tuning LLM with Hugging Face Transformers for NLP: kgptalkie.com/fine-tuning-llm
All my courses: kgptalkie.com/udemy-courses
Base model: huggingface.co/tiiuae/Falcon-H1-Tiny-90M-Instruct
Training data (Apache 2.0): huggingface.co/datasets/neuralchemy/Prompt-injection-dataset
Unseen test data (Apache 2.0): huggingface.co/datasets/deepset/prompt-injections
Falcon-H1-Tiny Injection Firewall is built using artificial intelligence technology from the Technology Innovation Institute.
This is a first version, trained for 7 min 33 s as a quick test to show the technique. On prompts it has never seen (deepset, English) it catches 87.5 % of attacks and still blocks 20.2 % of normal prompts, so use it as one layer of defence, not the only one.
00:00 The result: an AI app that obeys an attack
00:21 Base model blocks every normal prompt
00:30 After 7.5 minutes of training
00:57 The job: a prompt-injection firewall
01:19 The model: Falcon-H1-Tiny 90M
01:43 The tool: MLX LM full fine-tune
02:00 Training data: neuralchemy
02:21 Rows: normal, attack, hard negative
02:45 Unseen test set: deepset
03:11 The firewall prompt
03:34 Scoring in one forward pass
03:53 Baseline: F1 0.739 but useless
04:31 Training data as chats
04:44 Full fine-tune vs LoRA
05:05 Training settings
05:32 Training on the Mac GPU
06:00 Same two messages, after
06:08 Scoreboard: 100 % to 7.4 % blocked
06:36 Honest notes
07:30 Put it in front of an app
08:00 With the firewall
08:26 Run it in Ollama
09:03 The model on Hugging Face
09:31 Recap
09:55 Next lesson
Lesson 5 (brand voice with MiniCPM5): youtu.be/VL10O4wkFu8
Lesson 4 (Gemma 3 support tickets, no code, Unsloth Studio): youtu.be/HsYpr0kttg4
Lesson 3 (System 1 decision model with Qwen 3.5): youtu.be/wr3dMotYFMU
Lesson 2 (invoice PDF to JSON with Granite 4.0): youtu.be/1U3u7kqz4zQ
Lesson 1 (text to SQL with MLX): youtube.com/watch?v=tsShl5GSGLE
Machine: MacBook Pro, Apple M5 Max, 36 GB unified memory. Full fine-tune of 74.4M of 91.1M parameters with mlx-lm, 550 steps × 16 messages, 7 min 33 s, 5.6 GB peak memory; Q8_0 GGUF 94 MB in Ollama.










