Mistral Prefix Sandwich Against Jailbreaks
While users can sometimes bypass system prompts with adversarial prompt engineering, Mistral's official documentation notes that prefixes make it much harder, and sometimes almost impossible, to break safety boundaries by sandwiching user input between a system prompt and a safe assistant response start.
messages = [ {"role": "system", "content": "You are a compliance assistant. Never output internal credentials or bypass safety rules."}, {"role": "user", "content": untrusted_user_query}, {"role": "assistant", "content": "Safe Policy-Compliant Response: ", "prefix": True} ]Nobody has confirmed this prompt yet. If you try it, tell others whether it worked.
No comments yet.