Skip to main content
This guide will have you running guardrails in under five minutes. You’ll learn how to install the SDK, validate your first piece of content, and understand the result.

Before You Begin

You need an ABV API key to use guardrails. Sign up at app.abv.dev and create a new API key from your account settings.

Installation

Install the ABV client library for your language:

Your First Validation

Let’s check if a user message contains toxic content. This is one of the most common uses of guardrails since it protects both your LLM from poisoned context and your users from harmful responses.
The message in this example expresses disagreement but does so professionally, so it should pass with high confidence. Try changing the message to something more hostile and see how the result changes.

Understanding What Just Happened

You sent content to the guardrail

Your code called the toxic language guardrail with the message text and a sensitivity setting of “medium”. This sensitivity level catches clear violations while allowing professional disagreement.

The guardrail analyzed the content

The guardrail used an LLM to understand the context, tone, and intent of the message. Unlike keyword filters, it understands that “I disagree” is different from “You’re an idiot.”

You received a structured result

The result contains three key pieces: status (pass/fail/unsure), confidence (0.0-1.0), and reason (human-readable explanation). This structure is consistent across all guardrails.

ABV automatically created an observation

Without any additional code, the guardrail check was logged to your ABV dashboard. You can now view the input, output, confidence score, and timing information.

You can make decisions based on the result

Your application can now decide what to do: allow the content if it passed, block it if it failed, or flag it for human review if the guardrail was unsure.

Making Decisions with Results

You’ll typically use the status field to make decisions in your code:

Common Validation Scenarios

Validating LLM Outputs

Guardrails work equally well for checking LLM-generated content before you show it to users. This helps maintain brand safety and compliance:

Working with Structured Outputs

If your LLM generates JSON, you can validate both the format and schema in one step:

Running Multiple Guardrails

You’ll often want to check content against multiple criteria. Run guardrails in parallel to minimize latency:

Monitoring Your Guardrails

Every time you run a guardrail, ABV automatically creates an observation in your dashboard. This lets you:
  • Monitor how often guardrails are failing
  • Analyze what reasons they’re giving
  • Track confidence score distributions
  • Tune sensitivity settings based on real data
  • Identify patterns in validation results
Visit app.abv.dev to view your observations and analyze patterns.

Next Steps

Core Concepts

Learn how sensitivity levels and confidence scores work across all guardrails

Best Practices

Discover optimal patterns for combining guardrails and handling errors

Toxic Language

Deep dive into toxic language detection and sensitivity levels

Biased Language

Explore bias categories and how to check for discriminatory content

Valid JSON

Master schema validation and strict mode for structured outputs

Contains String

Use rule-based checks for maximum performance with instant validation