Updated
Agent building blocks

AI Guardrails & Security

Stop prompt injection, data leaks and unsafe outputs in your LLM app by checking what goes into the model and what comes out before users or tools see it.

Ask your AI about this, with this page as the source:ChatGPT ↗Claude ↗Perplexity ↗

Trends

Promptfoo gained the most ground in package downloads: 4.3× against the median npm package over a year.

Public counts each month: pull requests on GitHub, package downloads, stars, Product Hunt followers. They show direction, not market share.

ToolDownloadsStars
Promptfoo695.7k/wk4.3× vs npm★ 26k
NeMo Guardrails113.1k/wk★ 7.3k
Guardrails AIAcquired23.2k/wk★ 7.5k
Arthur—★ 92

The real choice

An open-source library in your code, a hosted screening API, or an enterprise security platform. Libraries run validators and rules inside your app for free, but you tune them and pay the latency. Hosted APIs check prompts and outputs against detectors the vendor keeps up to date, billed by usage. Enterprise platforms add discovery, red teaming and policy across every AI tool a company uses, sold through sales. Most of this market has been bought by security companies in the past year, so check who now owns a vendor before you depend on it.

Pick by situation

Tap the ones that are you — the tools that fit light up below.
  • Your app is in Python and you want checks on inputs and outputs that run in your own codeNeMo GuardrailsGuardrails AI
  • You want an API to screen prompts and outputs for injection and PII, without maintaining detectorsLakeraPangea
  • You want to test your app for prompt injection and data leaks before release, in CIPromptfoo
  • You already monitor your models and want guardrails and evals in the same placeArthur

Compare the tools

Grouped by the side of the choice they answer, not ranked. Open a row for when to use it, the trade-off and what makers say.

ToolBest for
Open-source library2
NeMo Guardrailslibrary · open source · free tierProgrammable rails configured in YAML and Colang flows to block, alter or validate inputs and responses, maintained by NVIDIA.4 open source113.1k/wk

Use it whenYou want rules and checks in your own Python code, including topic control for what the bot will discuss.

Trade-offPython only, and Colang is a language of its own to learn; checks that call an LLM add latency and cost.

No maker's product we track shows it for this yet · in 4 open-source projects.

Guardrails AIlibrary · open source · free tierWrapping LLM calls with validators from the Guardrails Hub for PII, toxicity, hallucination and output format.3 open source23.2k/wk

Use it whenYou want ready-made validators you can stack on each call, in Python.

Trade-offHarvey acquired the company in September 2026 and said nothing about the framework's future, though the repo is still active.

No maker's product we track shows it for this yet · in 3 open-source projects.

Hosted screening API1
LakeraserviceOne API call that screens prompts, retrieved content and outputs for prompt injection, data leaks and harmful content, in under 50 ms.1

Use it whenYou want maintained detectors for injection attacks rather than writing your own rules.

Trade-offNow Check Point AI Guardrails, with sign-up through a Check Point account and no public price list.

Used by SendGrid.

Before you choose

How to approach it

Start by limiting what the model can do: give it only the tools and data the task needs, and never let a model's output trigger a destructive action without a check. Then screen inputs for prompt injection and outputs for PII or secrets on the paths where users type free text or the model reads untrusted documents. Run a red-team test suite before each release, because no filter catches everything and you need to know what gets through.

Common mistakes
  • Relying on the system prompt ("never reveal…") as the only defence, when one injected instruction in a retrieved page overrides it.
  • Screening the user's message but not the documents, web pages and tool results the model reads, where indirect injection hides.
  • Adding a blocking check to every call without measuring its latency and false positives, so real users get refused.

Other options

Real choices most makers here won't need to weigh.