Guardrails & Safety
8 toolsStops the bad input before it, and the bad output after.
- NeMo Guardrailslibrary
Programmable rails that constrain conversational flow.
- Guardrails AIlibrary
Validators that check model output against a defined schema.
- Llama Guardlibrary
Safety classifier for prompt and response moderation.
- Microsoft Presidiolibrary
PII detection and anonymization for text and images.
- Lakera Guardservice
Prompt injection and jailbreak detection at the gateway.
- garaklibrary
Scanner that probes models for known vulnerability classes.
- PyRITlibrary
Microsoft's red-team tool for generating and scoring attack prompts.
- Invariant Guardrailsplatform
Guardrails as code, enforced inline in the call path.
By Kunj ShahLayer boundaries and entries verifiedmethod
Also relevant here
These tools are indexed in another layer, but they also do guardrails & safety's job. Each carries its home layer's colour.
- PortkeyRoutingIts guardrails run inline in the request path, which is where safety checks belong rather than after the response.
- TrueFoundryRoutingIts guardrails enforce in the call path alongside the gateway rather than as a separate service.
- OpenAI Agents SDKAgentsGuardrails are a first-party primitive on the runner rather than a proxy in front of it.
Rules of thumb
- A guardrail without an eval is a guess about which failures matter. Write the eval that found the failure, then the guardrail that blocks it.
- PII is a data-flow problem. Detect and redact before the model ever sees it, not after it answers.
- Every guardrail in the request path adds latency to every call. Run checks offline first and move them inline only when production forces it.
Quick answers
- What do LLM guardrails actually catch?
- Input checks catch prompt injection, PII and off-topic requests; output checks catch policy violations, leaked data and malformed structure. None of them replace scoped tool permissions.
- Can a guardrail stop prompt injection?
- It reduces it, it does not eliminate it. The reliable defence is limiting what a hijacked model can do: least-privilege tools, human approval for irreversible actions, and no secrets in the context.
- Where should guardrails run?
- Offline first, against logged traffic, to learn which failures are real. Inline only for the few checks that must block a response, because each one costs latency on every call.
Ask an AI about this page
Opens the assistant with this page’s link and a question already filled in.