AI & Machine Learning

AI guardrails

Also known as: LLM guardrails, AI safety guardrails, guardrails

AI guardrails are rules, filters, and checks placed around an AI system to keep it safe, on-topic, and within policy.

They can screen user inputs for attacks, check outputs for harmful or confidential content, keep a chatbot to approved subjects, and require human approval for risky actions. While guardrails reduce risk, no filter catches everything, and overly strict ones frustrate users with needless refusals.

AI guardrails, explained at three levels

At home

Think of guardrails as the bumpers in a bowling lane. The ball, the AI model, still does the rolling, but the bumpers stop it from going into the gutter. AI guardrails are separate checks placed before and after the model: one looks at what you type, another looks at the AI's reply, and either can block or reshape it if it breaks the rules.

At work

AI guardrails are rules and automated checks a company wraps around an AI model to keep it safe, on-topic, and within policy. They screen user inputs, review model outputs, and limit what actions the AI can take. Businesses need them because they own what their AI says; in 2024, Air Canada was held responsible for its chatbot's wrong advice.

Real-world examples

At home

Jerome asked a bank's chatbot for stock tips. A guardrail stepped in, and the bot explained it couldn't give investment advice and offered to connect him with an advisor.

At work

Lena is an IT manager at a Kelowna credit union. Her team added guardrails to their member chatbot that redact account numbers and block answers that aren't supported by approved policy documents.

How it compares

featureAI guardrailsAI alignment
Where it actsAround the model, before and afterInside the model, through training
Who controls itThe deploying companyMostly the model developer
Change speedQuick to updateRequires retraining
ExampleBlocking account numbers in repliesTraining a model to refuse harmful requests

Alignment shapes the model. Guardrails fence the application around it.

For analysts

I'd write guardrail requirements like any business rule: what must never happen, what needs human review, and what gets logged. Then test them with people actively trying to break them.

History & origin

Early chatbots showed what happens without guardrails: Microsoft's Tay, launched on Twitter in 2016, was pulled within a day after users taught it offensive content. As businesses deployed large language models in 2023, toolkits appeared to manage behaviour around the model, including NVIDIA's open-source NeMo Guardrails in April 2023, the Guardrails AI framework, and Meta's Llama Guard safety classifier in December 2023. Cloud providers added built-in content filters and safety settings. A February 2024 decision by British Columbia's Civil Resolution Tribunal held Air Canada responsible after its website chatbot gave a customer wrong information about bereavement fares, showing that companies own what their AI says. In my view, that case did more to make Canadian executives care about guardrails than any technical paper.