Model card
View the full model card on Hugging Face
Run locally with Ollama
Download and run Granite Guardian with Ollama
Quick start guide
granite-guardian-3.3 - Identify potential risks in prompts and responses.
Detailed Guide without thinking
granite-guardian-3.3 - in-depth examples for a variety of criteria and
custom risks.
Detailed Guide with thinking
granite-guardian-3.3 - in-depth examples for a variety of criteria and
custom risks with reasoning traces.
All Granite Guardian resources
GitHub repository with all resources
Overview
The Granite Guardian models are a family of models and LoRA adapters designed to judge if its input and output meet specified criteria. The model comes pre-baked with certain criteria, but is not limited to: jailbreak attempts, profanity, and hallucinations related to tool calls and RAG (retrieval augmented generation) in agent-based systems. Additionally, the model enables users to bring their own criteria (BYOC) and tailor its judging behavior for their specified use case(s). The Granite Guardian LoRA adapters can be layered atop the Granite Guardian models to tackle more specific, downstream tasks. The latest version of the Granite Guardian model enables a thinking or non-thinking modes. In the thinking mode, the model produces detailed reasoning traces with<think>
and <score>
tags. In the non-thinking mode, the model only produces the judgement score through <score>
tags. Since its inception, Granite Guardian has remained in the top 3 on the LLM-Aggrefact Leaderboard (as of 10/2/2025).
The Granite Guardian are enterprise-grade, risk detection models that are applicable across a wide-range of enterprise applications:
- Detecting harm-related risks within prompt text, model responses, or conversations (as guardrails). These present fundamentally different use cases as the first assesses user supplied text, the second evaluates model generated text, and the third evaluates the last turn of a conversation.
- RAG (retrieval-augmented generation) use-case where the guardian model assesses three key issues: context relevance (whether the retrieved context is relevant to the query), groundedness (whether the response is accurate and faithful to the provided context), and answer relevance (whether the response directly addresses the user’s query).
- Function calling risk detection within agentic workflows, where Granite Guardian evaluates intermediate steps for syntactic and semantic hallucinations. This includes assessing the validity of function calls and detecting fabricated information, particularly during query translation.
Model cards
Granite Guardian 3.3 8B
View model on Hugging Face
Granite Guardian 3.2 5b LoRA Harm Categories
View model on Hugging Face
Granite Guardian 3.2 5b LoRA Harm Correction
View model on Hugging Face
Granite Guardian 3.2 3B A800m
View model on Hugging Face
Granite Guardian 3.2 5B
View model on Hugging Face
Granite Guardian 3.1 8B
View model on Hugging Face
Granite Guardian 3.1 2B
View model on Hugging Face
Granite Guardian HAP 125m
View model on Hugging Face
Granite Guardian HAP 38m
View model on Hugging Face
Run locally with Ollama
Learn more about Granite Guardian on Ollama.Granite Guardian 3.3 8B
Download for Ollama
Granite Guardian 3.2 5B
Download for Ollama
Granite Guardian 3.2 3B
Download for Ollama
Definitions for Pre-Baked Criteria
The model is specifically trained to judge if a text meets any of the criterion selected from the list below:- Harm: content considered generally harmful.
- Social Bias: prejudice based on identity or characteristics.
- Jailbreaking: deliberate instances of manipulating AI to generate harmful, undesired, or inappropriate content.
- Violence: content promoting physical, mental, or sexual harm.
- Profanity: use of offensive language or insults.
- Sexual Content: explicit or suggestive material of a sexual nature.
- Unethical Behavior: actions that violate moral or legal standards.
- Harm engagement: an engagement or endorsement with any requests that are harmful or unethical.
- Evasiveness: avoiding to engage without providing sufficient reason.
- Context Relevance: retrieved context is not pertinent to answering the user’s question or addressing their needs.
- Groundedness: assistant’s response includes claims or facts not supported by or contradicted by the provided context.
- Answer Relevance: assistant’s response fails to address or properly respond to the user’s input.
- Function Calling Hallucination: assistant’s response contains function calls that have syntax or semantic errors based on the user query and available tool.
Dataset
Granite Guardian is trained on a combination of human annotated and synthetic data. Samples from hh-rlhf dataset were used to obtain responses from Granite and Mixtral models. These prompt-response pairs were annotated for different risk dimensions by a socioeconomically diverse group of people at DataForce. DataForce prioritizes the well-being of its data contributors by ensuring they are paid fairly and receive livable wages for all projects. Additional synthetic data was used to supplement the training set to improve performance for RAG, jailbreak, conversational, and function calling hallucination related risks.Use Granite Guardian
Cookbooks offer an excellent starting point for working with the models, providing a variety of examples that demonstrate how they can be configured for scenarios.- Quick Start Guide provides steps to start using Granite Guardian for judging prompts (user message), responses (assistant message), RAG use cases, or agentic workflows.
- Detailed Guide think no_think explores different pre-baked criteria in depth and shows how to assess custom criteria with Granite Guardian.
Quick start example
The model is pre-baked with certain judging criteria (see the section titled Definitions for Pre-baked Criteria for the complete list). We will now see a few examples of how to use the pre-baked criteria as well as how users can specify their own criteria. We will also see how to activate thinking mode. Let us setup the imports, load the model and a utility function to parse the model outputs including reasoning traces or chain-of-thought.Example 1: Detect jailbreak attempts in prompts
Here we will set “criteria_id”: “jailbreak” in the guardian_config object that is passed to apply_chat_template method.Example 2: Tool-call hallucination in a model’s response
Here we will set “criteria_id”: “function_call” in the guardian_config object that is passed to apply_chat_template method.Example 3: Detect lack of groundedness of model’s response in RAG settings
Here you see how how to use the Granite Guardian in thinking mode by passing think=True in the apply_chat_template method.Example 4: Using custom judging criteria and scoring schema.
You can set up your own criteria for assessment using “custom_criteria” field of the guardian_config object.Scope of use
- Granite Guardian models must only be used strictly for the prescribed scoring mode, which generates yes/no outputs based on the specified template. Any deviation from this intended use may lead to unexpected, potentially unsafe, or harmful outputs. The model may also be prone to such behaviour via adversarial attacks.
- The model is targeted for risk definitions of general harm, social bias, profanity, violence, sexual content, unethical behavior,harm engagement, evasiveness, jailbreaking, or groundedness/relevance for retrieval-augmented generation, and function calling hallucinations for agentic workflows. It is also applicable for use with custom risk definitions, but these require testing.
- The model is only trained and tested on English data.
- Given their parameter size, the main Granite Guardian models are intended for use cases that require moderate cost, latency, and throughput such as model risk assessment, model observability and monitoring, and spot-checking inputs and outputs. Smaller models, like the Granite-Guardian-HAP-38M for recognizing hate, abuse and profanity can be used for guardrailing with stricter cost, latency, or throughput requirements.