Skip to content
Glossary · AI building blocks

Guardrails (AI)

Also called AI guardrails, safety filters.

Definition

Checks placed around an AI model that block, fix or flag unsafe, off-topic or incorrect inputs and outputs.

Last updated

What it is.

Guardrails sit before and after the model. Input checks catch prompt injection, personal data that should not be sent and requests outside the product's scope. Output checks validate format with structured output, check facts against sources, filter harmful content and enforce business rules such as refund limits.

Some guardrails are rules in code, some are classifiers, some are a second model call. The strongest ones are permissions: an agent that cannot reach a system cannot misuse it.

Why it matters

A model's behaviour can be steered but not guaranteed. Guardrails turn the rules the business cares about into checks that run every time, keep a record of what was blocked, and make the system's behaviour easier to explain to customers, auditors and regulators.

Watch out

Common mistakes.

  1. 01

    Relying on the system prompt as the only guardrail.

  2. 02

    Blocking so much that the product stops being useful. Measure false blocks too.

  3. 03

    Checking output text but not the actions an agent takes.

Tools

Work it out with a tool.

Related

Related terms.

Building something with this? Ask an engineer.

OceanLab designs and builds production software. Tell us what you are planning and we will reply with how we would approach it.

OceanLab

Enterprise Software Engineering - Human + AI

Languages

Locations

Global Headquarters

21 Merchant Road, 3rd Floor, Singapore 058267

Main corporate office and leadership operations

North America Office

548 Market Street, PMB 12472, San Francisco, CA 94104

Client operations and business development

India Office

402 Shivalik Shilp II, SG Highway, Ahmedabad 380015

Engineering and delivery center

© 2026 - Copyright. All Rights reserved OceanLab