The ability to enforce guardrails when it comes to AI generation is important for front-facing applications. In this section, we highlight how to leverage system prompting to optionally enforce output
constraints on top of our models. Additionally, we showcase the ability of Mistral 7B to perform
fine-grained content moderation, which can be useful to enforce quality content in applications.
5.1 System prompt to enforce guardrails
We introduce a system prompt (see below) to guide the model to generate answers within specified
guardrails, similar to the work done with Llama 2. Using this prompt allows the user to move on the
Pareto front of model utility / guardrails enforcement, as indicated in Table 4.
Always assist with care, respect, and truth. Respond with utmost utility yet securely. Avoid harmful,
unethical, prejudiced, or negative content. Ensure replies promote fairness and positivity.
Guardrails MT Bench
No system prompt 6.84 ±0.07
Llama 2 system prompt 6.38 ±0.07
Mistral system prompt 6.58 ±0.05
Table 4: System prompts. Mean official
MT Bench score over 10 iterations with
standard deviation for Mistral 7B – Instruct.
For reference, Llama 2 13B – Chat reports
official results of 6.65.We use a set of 175 unsafe prompts for evaluating safety.
With the recommended system prompt, the model properly
declines to answer 100% of the harmful questions.