Guardrails 0.0.0-dev.8

This is a prerelease version of Guardrails.
dotnet add package Guardrails --version 0.0.0-dev.8
                    
NuGet\Install-Package Guardrails -Version 0.0.0-dev.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Guardrails" Version="0.0.0-dev.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Guardrails" Version="0.0.0-dev.8" />
                    
Directory.Packages.props
<PackageReference Include="Guardrails" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Guardrails --version 0.0.0-dev.8
                    
#r "nuget: Guardrails, 0.0.0-dev.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Guardrails@0.0.0-dev.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Guardrails&version=0.0.0-dev.8&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Guardrails&version=0.0.0-dev.8&prerelease
                    
Install as a Cake Tool

Guardrails

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official Guardrails AI OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • MEAI AIFunction tools for use with any IChatClient

Usage

using Guardrails;

// Connect to a self-hosted Guardrails server (default: http://localhost:8000)
using var client = new GuardrailsClient(apiKey);

// Or specify a custom base URL
using var client = new GuardrailsClient(apiKey, baseUri: new Uri("https://my-guardrails-server.example.com"));

Validate LLM Output

var result = await client.Validate.ValidateAsync(
    guardName: "my-guard",
    llmOutput: "Some LLM output to validate");

Console.WriteLine($"Validation passed: {result.ValidationPassed}");

List Guards

var guards = await client.Guard.GetGuardsAsync();
foreach (var guard in guards)
{
    Console.WriteLine($"Guard: {guard.Name} ({guard.Id})");
}

MEAI Tools

using Microsoft.Extensions.AI;

// Use Guardrails as tools with any IChatClient
var tools = new[]
{
    client.AsValidateTool(),
    client.AsListGuardsTool(),
    client.AsGetGuardTool(),
};

var chatOptions = new ChatOptions { Tools = [..tools] };

Support

Priority place for bugs: https://github.com/tryAGI/Guardrails/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Guardrails/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.0-dev.8 27 3/29/2026
0.0.0-dev.7 32 3/29/2026
0.0.0-dev.3 51 3/28/2026
0.0.0-dev 55 3/28/2026