Skip to main content
AI Gateway · Guardrails

LLM guardrails

Inspect what goes into a model, what comes out and what tools return, with one guardrail policy applied to every key that runs under it.

Definition

Guardrails at the gateway

LLM guardrails are checks that inspect text on its way to or from a model and decide whether the request may proceed. Run in each application, they drift apart and are easy to skip; run at the gateway, one policy covers every key and every model, and the verdicts are recorded in one place.

Inferbase inspects text at three check stages, the prompt, the response and tool results, with two checks: unsafe content against fourteen hazard categories, and prompt injection. Each check at each stage is set to Off, Log only or Block, so a policy can watch before it enforces.

Checks

What is inspected

Unsafe content

Classified against fourteen hazard categories, including violent crimes, hate, self-harm, privacy and specialized advice; you choose which categories act.

Prompt injection

Text written to hijack the model, in a prompt or in a tool result, detected by a classifier with a threshold you set. Free.

Three stages

Prompts before any model sees them, responses before they are returned, and tool results before the model reads them.

Conversation history

Earlier user messages and tool results in a request are checked once and their verdicts kept, so long conversations do not cost more per turn.

Enforcement

From watching to blocking

Off, Log only, Block

Start with Log only to see what would have been blocked, then switch to Block. A blocked request gets a 403 naming the categories.

Request conditions

Apply a policy to every request, or only to requests with tools, tool results, structured output or a given task.

Enforced from the top

An organization configuration can enforce a guardrail policy so no project or key can turn it off.

On the record

Every inspected request records which checks ran, at which stage, the verdicts and whether anything acted.

FAQ

FAQ: LLM guardrails

Put intelligence in the middle.

Start on the free plan with 5,000 requests a month, no card required.