{"repo":"rb81/prompt-hacking-classifier","free":true,"listed":false,"github":"https://github.com/rb81/prompt-hacking-classifier","clone":"git clone https://github.com/rb81/prompt-hacking-classifier.git","description":"A simple prompt-based approach to detecting prompt injection and jailbreaking attempts using small, self-hosted language models.","language":"Python","stars":19,"topics":["chatgpt","jailbreak-prompt","llm","open-models","openai","prompt","prompt-engineering","prompt-hacking"],"license":"MIT","category":"ai-agents","readme_excerpt":"Prompt Hacking Classifier A simple prompt-based approach to detecting prompt injection and jailbreaking attempts using small, self-hosted language models. Note: This is a complete overhaul of the previous version. The full classifier prompt remains the same, but this update introduces a new lightweight prompt variant, a rethought testing methodology that accommodates thinking models (expanded token output from 1 to 512), a three-way comparison (full prompt vs lite prompt vs no prompt), and uses gpt-oss:20b as a judge model to assess natural model resistance to attacks. What This Is Frontier models like GPT-4 and Claude already have robust built-in safety measures and are very good at detecting malicious user input. However, using a frontier model as a dedicated safety guard for every request is expensive. This project explores whether smaller, self-hosted models can serve as cheap, fast, portable safety guards when given the right prompt. The idea is simple: divert user input to a guard model running our classifier prompt, get back a true / false response indicating whether the input looks malicious, and act accordingly. We tested this across 35 models and found that yes, a well-crafted prompt makes a massive difference — without it, models uniformly fail to resist attacks (0% resistance across all models tested). With our prompts, top models achieve F1 scores above 0.97. The Prompts - classifier.prompt — Full version (88 lines). Detailed instructions, evaluation criteria, ex","default_branch":null,"files":null,"tree":[],"storefront":"/r/rb81","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rb81/prompt-hacking-classifier/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}