Skip to content
This page is not translated yet — showing the original. We never ship machine translation as a placeholder.
One commandApache-2.0 Tested

Guardrails AI

In one line:Guardrails AI 是一个给大模型的输入输出装护栏:校验格式、拦截违规、统一口径,能。

给大模型的输入输出装护栏:校验格式、拦截违规、统一口径。

Official source

We host and mirror nothing — the official page is the source of truth.

Official icon for Guardrails AI Guardrails AIhttps://github.com/guardrails-ai/guardrailsOpen official page
Official sourceYou are leaving AIWorksWell for Guardrails AI. That site is not under our control; its content, privacy and security are its own responsibility. Please judge for yourself.

Install prompt

Copy it, paste it into your AI (Claude Code, Codex, ChatGPT…), and it installs and verifies for you.

48 lines
我需要你帮我在我的机器上安装并运行一个软件。

【软件信息】
名称:Guardrails AI
用途:给大模型的输入输出装护栏:校验格式、拦截违规、统一口径。
官方来源:https://github.com/guardrails-ai/guardrails
许可:Apache-2.0
Scroll inside the box with your mouse wheel — copying still gives you the full prompt1583 chars

Copy → paste into your own AI → it installs for you

Contact the original author (Guardrails AI)

Bugs in the software itself go to the author's own official channel — that is where they actually receive them. We pass things on; we do not answer for the author.

Install failed?

Paste the raw error — once triaged and verified it is written back here, so the next person's AI avoids it. No login needed.

Official visuals

Guardrails Hub:给 AI 输出加校验规则
Guardrails Hub:给 AI 输出加校验规则 · 官方 README

Official images beyond the cover. Click a thumbnail or use the ← → keys to switch. Images are hotlinked from official sources; we never re-host them.

About this entry

它是什么

Guardrails AI 是一个开源(Apache-2.0)的大模型输出校验框架:在模型给出回答之后、进入业务流程之前,按你定义的规则检查一遍——格式对不对、字段全不全、有没有越界内容。它把"希望模型别乱说"变成了可编程、可测试的校验步骤,对金融与法律这类"说错话代价很高"的场景尤其有用。来源:https://github.com/guardrails-ai/guardrailshttps://github.com/guardrails-ai/guardrails

怎么用起来

主推「复制提示词」——让 AI 帮你装库、写第一条校验规则、跑通一个最小例子。人工兜底:pip install guardrails-ai → 用官方文档里的示例定义一个"输出必须是合法 JSON 且含指定字段"的校验器 → 包住一次模型调用验证。来源:https://github.com/guardrails-ai/guardrailshttps://github.com/guardrails-ai/guardrails

以上坑来自 https://github.com/guardrails-ai/guardrailshttps://github.com/guardrails-ai/guardrails 与官方文档。

来源与署名

Mentioned from:https://github.com/guardrails-ai/guardrailshttps://github.com/guardrails-ai/guardrails · 原作者 Guardrails AI(Apache-2.0)。

Summary for AI

Guardrails AI 是给大模型输入输出加校验的开源库(Apache-2.0),可校验格式、拦截违规内容并统一输出口径。

A self-contained answer paragraph — this is the part AI search quotes. · Page reviewed 2026-10-06

FAQ

它拦什么?

主要拦格式不合规与内容违规的输出,让结果更可控。

和提示词约束有什么不同?

它是在模型外做程序化校验,不依赖模型自觉遵守提示词。

Pitfalls / known issues

All recorded from real installs, and injected into the prompt above.

  • •校验规则写得太松等于没写,太严又会让正常输出被拦——建议先用真实样本反复调。
  • •护栏只约束"输出形态",不保证"内容正确",事实性错误仍需人工或外部数据核对。
  • •依赖版本与 hub 规则的版本要匹配,装规则报错时先对齐版本。

You might also like

We store, mirror and repackage nothing. Every install path points to the author’s own official page.

Nothing here has been reviewed by an app store. Judge the source and licence yourself; you install at your own risk.