Skip to main content
Qualifire provides a set of protection guardrails that can be used to enforce specific policies and standards in your content. These guardrails can be applied to your content, ensuring that it meets the required criteria.

Creating a Guardrail

To create a new guardrail, follow these steps:
1

Navigate to the Guardrails page in the Qualifire platform.

By clicking on the “Guardrails” tab in the Qualifire platform, you can access the Guardrails page where you can create, manage, and monitor your guardrails.
2

Click on the 'New Guardrail' button.

Once you are in the Guardrails page, click on the ‘Create New Guardrail’ button to create a new guardrail.
3

Configure the guardrail to your specific needs.

You can customize the guardrail to your specific needs by setting the conditions, actions, and other parameters.
4

Save the guardrail and start monitoring your content.

Once you have configured the guardrail, click on the ‘Save’ button to save the guardrail. You can now start monitoring your content to ensure it meets the required criteria.

Using Guardrails via SDK

import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: "https://proxy.qualifire.ai/api/providers/openai",
  defaultHeaders: {
    "X-Qualifire-Api-Key": process.env.QUALIFIRE_API_KEY,
  },
});

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello, how are you?" }],
});
Guardrails that fail will block the response from reaching your users. Make sure to test your guardrail configuration thoroughly before deploying to production.

Guardrail Categories

Protect against prompt injection attacks and prevent PII exposure. These guardrails run on input and output to catch threats at every stage.
Filter harmful content including dangerous material, harassment, hate speech, and sexually explicit content.
Ensure outputs are accurate and grounded. Includes hallucination detection, context grounding, and tool selection quality checks.
Enforce custom business rules using natural language assertions. Define any policy and have it consistently applied to every response.

Managing Guardrails

Once you have created a guardrail, you can manage it through the Guardrails page. You can edit, duplicate, or delete guardrails as needed.

Monitoring Guardrails

Qualifire provides a detailed view of the guardrail’s application to your content. You can see the results of the guardrail’s checks, the severity level, and any issues or failed checks that were identified. You can also access the raw data and explore a feature that suggests better prompts.