AI Guardrails: Checks, Tools, and a Minimal Starting Set
AI guardrails explained through one customer request, with a documented tool comparison, permission boundaries, and a small-team starting set.
Published

Map AI guardrails to 5 boundaries: incoming requests, retrieved context, model proposals, tool actions, and outgoing answers. Content filters can catch a prohibited reply; your application must still decide whether the customer may see a record or authorize a refund. A small team should establish those permissions before adding more classifiers.
What Are Guardrails in AI?
Guardrails make a written policy affect what an AI application can receive, reveal, or do. A large language model, or LLM, generates answers and proposed actions; guardrails check those inputs and outputs or constrain the surrounding software.
Think of a museum. The entrance checks tickets, individual rooms have access rules, and a conservator needs permission to move an exhibit. Checking someone's ticket does not authorize every action inside the building. Likewise, a harmless customer message does not establish ownership of an order.
Three parts make a guardrail operational: a rule, a check, and a consequence. “Do not expose customer data” is a rule. Comparing the requested record's owner with the authenticated customer is a check. Refusing the database read is the consequence. A log entry without enforcement records a failure after it happens.
Some checks are deterministic, meaning the same rule and inputs produce the same decision. Examples include allowed tool names and required fields. Others use classifiers, models that estimate whether content violates a policy. Topic detection and harmful-content classification belong here. Human approval adds judgment before an allowed but consequential action.
AI guardrails names this broad set of controls. Guardrails AI is one particular framework within it. Confusing the category with a product can leave important boundaries unowned.
AI Guardrails Examples: One Refund Request, End to End
A refund request needs different checks at different moments, even when its wording is ordinary. Consider this hypothetical customer message: “Please refund my last order and email the confirmation to my new address.” Assume your policy requires approval before refunds and sends confirmations only to a verified account address.
The request path is: input checks → scoped context → model proposal → authorized, approved action → output checks. Any later tool call repeats the relevant checks.

Before the model: authenticate, filter, and minimize
Start by identifying the customer from the authenticated session, not from a name or account identifier typed into the chat. Apply request-size and rate limits before expensive processing.
Then check the message for prohibited content, out-of-scope topics, and unnecessary sensitive data. A topic filter can steer a support assistant away from unrelated advice. A personal-information filter can remove a pasted phone number when the task does not need it. PII means personally identifiable information, such as an email address or phone number.
Do not remove the information the workflow genuinely requires without providing another route. Keep verified account details in the application and pass only the minimum useful context to the model. Masking text before a model call also does not remove copies already captured by request logs; minimize data at collection and logging too.
Before retrieval: restrict which records can enter
Retrieve the customer's order through an account-scoped query. The restriction must apply before private content reaches the model. An output filter is too late to serve as the primary barrier between customers' records.
Retrieved documents, web pages, and tool results are additional inputs. A help article can contain an instruction that tries to override the application's rules, a failure mode called indirect prompt injection. Treat retrieved text as evidence to inspect, not as permission to change the workflow.
The model may need the return policy and order eligibility. It does not need every customer's transactions. Scope retrieval, trim unnecessary fields, and check the selected material for relevant content risks.
At the model: constrain the proposal
Ask the model for a structured proposal using known fields, such as the requested action and order identifier. Validate the structure before interpreting it.
Schema-valid JSON proves only that the data has an acceptable shape. A fabricated order identifier can still be a valid string. Do not let the model establish customer identity, refund eligibility, or its own approval status by filling in a field.
For this example, the model may propose a refund and notice the address-change request. The application must decide whether either action is allowed.
Before a tool runs: check authority and approval
A tool is an application function the model can request. Before a refund function executes, check its name, arguments, customer ownership, current order state, and business eligibility. Reject unexpected fields and enforce the same checks at the service that performs the action.
Human approval belongs after the exact proposal exists and before the side effect occurs. Show the reviewer the order, intended refund, destination, and reason. Bind approval to that specific action. If the arguments change, the old approval no longer authorizes execution.
The new email address is a separate permission problem. In this example, the application directs the customer through account verification and uses the existing verified address until that process finishes. A content filter cannot establish ownership of an email account.
Before the answer leaves: verify results and disclosure
Inspect tool results before putting them back into the model's context. Restrict returned fields, check their shape, and handle failed or ambiguous operations explicitly.
Then check the customer-facing answer for prohibited content, sensitive information, unsupported claims, and required response structure. “Your refund is complete” must depend on a confirmed tool result. If approval is pending, the answer should say so.
The input and output checks may use similar classifiers, but their jobs differ: the first decides what enters processing; the last decides what reaches the customer. Neither can undo an unauthorized action already taken.
AI Guardrails Tools: What Their Docs Say
Choose a tool by the boundary it helps enforce and the rules you are prepared to maintain. The following capability map was verified against the vendors' live documentation on 17 October 2026. It compares documented scope, not measured detection accuracy.
The source links and implementation limits for each appear below. “What you still own” is the architectural consequence of those documented scopes, not a claim that a framework prevents you from writing custom controls.
What Is Guardrails AI?
Guardrails AI is a Python framework for combining validators around model inputs and outputs and generating structured data. Its introduction describes the framework and its collection of validators.
A validator checks a value against a criterion and returns a pass or failure; the configured on_fail policy determines failure handling. The documentation includes toxic-language and PII examples and allows custom validators. Validator concepts.
Use it when explicit validation rules fit an existing Python application. The wall is coverage: adding a framework does not establish which checks run on each path or what a failure prevents. Write and test those decisions alongside the application.
NVIDIA NeMo Guardrails
NVIDIA NeMo Guardrails provides programmable controls at several stages of an LLM interaction. Its documented rail types include input, retrieval, dialog, execution, and output rails.
Input rails can address content safety, jailbreaks, topics, and PII; retrieval rails check context; dialog rails constrain conversation flow. Execution rails can validate tool inputs and results, while output rails can filter, edit, or block responses.
Use it when you need control over the interaction flow. The wall is policy implementation: execution rails provide a place to check actions, but your code must supply the customer ownership and business rules. Keep those permissions enforced by the underlying service as well.
Amazon Bedrock Guardrails
Amazon Bedrock Guardrails offers configurable content filters, denied topics, word filters, sensitive-information filters, contextual grounding, and Automated Reasoning checks. Sensitive-information filters can block or mask supported PII and custom patterns; Automated Reasoning checks assess responses against logical rules. Safeguard overview.
The ApplyGuardrail API evaluates text independently of a foundation-model invocation. You can insert it before retrieval or before serving a response.
This fits an application that wants managed policy checks. The wall is assuming all checks cover all content: features have specific scopes, and the overview excludes reasoning content blocks. A passed content assessment still does not authorize a refund.
AI Security Guardrails: The Model Makers' Controls
OpenAI moderation classifies harmful content in supported text and image inputs and returns flags, categories, and scores. The moderation documentation also cautions that a refusal discussing harmful content can trigger a flag.
Treat those results as policy signals. A support conversation quoting an abusive message may need different handling from a request to generate one. Moderation is useful for content decisions; it does not supply your order-access rules.
Google Gemini exposes safety settings that pair harm categories with blocking thresholds. Its current safety-settings guide covers categories including harassment, hate speech, sexual content, dangerous content, and jailbreaks.
Google distinguishes the probability of unsafe content from the severity of potential harm. That is a practical limit: a low classifier score is not evidence that an action would have a small consequence. Provider controls are useful components, but your application still needs permissions, data scope, and failure handling.
Guardrails for AI Agents: What You Must Design
An agent needs an enforceable boundary between proposing an action and executing it. Whether you implement that boundary through framework hooks or ordinary service code, it must use trusted identity and current application state.
Keep an explicit list of allowed tools, then check the arguments and target resource on every invocation. “Refund” being allowed does not make every order refundable. A general-purpose shell or unrestricted network tool also expands the reachable action surface far beyond a narrow business function.

Make approval an enforceable record, not a conversational “yes.” Store what was approved, by whom, and against which action details. Recheck state before execution: an order might already have been refunded while a reviewer was deciding.
Have the service enforce an idempotency key, a stable operation identifier that makes retries return the existing result instead of issuing another refund. Keep credentials narrow and the enforcement path outside model control. The agent should not be able to choose a second endpoint that bypasses the check.
Our production AI-agent guardrails and blast-radius playbook develops the surrounding architecture. For this request, the decisive question is simple: if the model proposes the wrong action, which service refuses to perform it?
The Limits That Matter Before Launch
Feature names are broader than their operating conditions. Verify the scope of the exact check you intend to use.
For example, AWS documents contextual grounding for summarization, paraphrasing, and question answering with a reference source and query, while explicitly excluding conversational Q&A/chatbot use cases. Its documented maximums are 100,000 characters of source, 1,000 of query, and 5,000 of response. These are character limits for that feature, not general model context limits or a prohibition on using other Bedrock safeguards with chatbots. Contextual-grounding documentation.
Grounding asks whether an answer follows the supplied source. If the source itself is stale or wrong, agreement does not establish truth. In the refund example, current order state must come from the authoritative service.
Streaming changes the enforcement point. AWS warns that a contextual-grounding relevance decision can arrive after a response has streamed. More generally, if a policy requires checking the complete answer before disclosure, buffer that answer until the check passes. Already displayed text cannot be recalled by a later refusal.
A timeout needs a defined outcome. For a required permission or approval check, stop the mutation and offer a pending or human-support path. For lower-risk responses, explicitly define which limited fallback is acceptable. Do not silently convert a failed checker into permission to continue.
Measure added latency and mistaken blocks on your own workload. No vendor score substitutes for knowing whether legitimate customers can complete your actual support task.
A Minimal Starting Set for a Small Team
Start with six controls you can explain, exercise, and assign to an owner. You do not need to adopt every framework in the table.
Identity and data scope
Use the authenticated customer context for retrieval and tools. Test that a customer cannot read another customer's order even when the model requests it.
Input policy and data minimization
Define the supported task, screen relevant content risks, and remove unnecessary sensitive fields. Choose a safe response for out-of-scope requests.
An output contract
Validate required fields, disclosure rules, and claims about completed actions. If the answer lacks reliable support, have it acknowledge uncertainty or route to support.
Constrained actions and approval
Expose narrow business tools. Check identity, arguments, and current state before execution; require approval for actions your policy marks as consequential.
Failure behavior and operating limits
Set request, tool-call, retry, and execution-time limits appropriate to the workflow. Define what happens when a required check or downstream service fails. Revalidate revised proposals and retries.
Regression tests and an audit trail
Record rule versions, decisions, tool outcomes, and approval references without copying unnecessary sensitive data. Make known unauthorized disclosures and actions block a release.
Builders should act now if a customer-facing feature reads private records or can change state. Implement the service permissions first. Operators need an owner for escalations, blocked legitimate requests, and unavailable checks. A queue without someone responsible for it is an unfinished workflow.
Buyers should wait on another guardrail product until the missing boundary is named. A public-document assistant with no write tools does not need a refund-approval flow. It still needs relevant content checks, trustworthy retrieval, and a clear fallback. Adding action controls becomes necessary when its capabilities expand.
Test the Application With Promptfoo
Promptfoo is an evaluation and red-teaming tool: it helps test normal behavior and deliberately adversarial requests. Its agent-testing documentation describes checks for role restrictions, unauthorized object access, and unauthorized function access.
Point tests at the application boundary with representative identity and fixture data. Testing a bare model omits the retrieval permissions, approval workflow, and tool services customers actually encounter.
For the hypothetical refund flow, start with these cases:
- An eligible order: the proposal reaches approval, and execution waits for it.
- Another customer's order: retrieval and execution both deny access.
- A changed confirmation address: the application requires the separate verification process.
- Instructions hidden in retrieved content: they cannot grant permissions or change the approval policy.
- A changed proposal after approval: the previous approval cannot authorize the new arguments.
- A checker outage or repeated request: required checks do not get bypassed, and the same operation is not executed twice.
These are proposed test cases, not reported test results. Inspect side effects and stored state as well as the final answer. “I cannot do that” is no reassurance if the tool already did it.
Promptfoo's quickstart walks through target configuration, attack categories, running tests, and reviewing a report. Our Promptfoo review covers the evaluation workflow in more detail. Keep normal customer requests alongside adversarial cases so stricter filtering does not quietly break the useful task.
What Is Overhyped?
A guardrail product is not a universal safety switch. Its value depends on what it checks, where it runs, and what its decision prevents.
A longer system prompt can express a policy, but it cannot enforce database permissions. A second model can critique an answer, but agreement between models is not proof of correctness. A larger stack of classifiers can also increase mistaken blocks and operational work without covering the missing action boundary.
The strongest starting point is a small set of explicit controls tied to concrete failure cases. Add a check when it covers a demonstrated gap; measure whether it improves the outcome.
AI Without Guardrails: What Is Missing?
For a customer feature, the useful question is which controls are absent. An application might have provider content filtering while still lacking customer-specific permissions, output validation, or approval enforcement. Calling it “guarded” conceals those gaps.
Conversely, an application with deterministic access controls may still need content checks. Content safety and authorized behavior are separate requirements; neither label answers both.
FAQ
What are the different types of AI guardrails?
Useful implementation categories include input checks, retrieved-context checks, output checks, tool-execution controls, and human approval. Topic and PII filters can apply at several of those boundaries.
How to create AI guardrails?
Name an outcome that must not happen, put a check before the relevant disclosure or action, define the failure response, and test the full application. Assign someone to maintain the policy and handle escalations.
What does guardrails AI do?
Guardrails AI combines validators into input and output guards and supports structured-data generation. Your configuration and application code determine which risks are checked and how failures are handled.
Is there an AI without guardrails?
Applications vary in their controls. For deployment, audit the exact boundaries rather than relying on a label: model content protections do not establish customer authorization or human approval.
What are the top 3 AI security risks?
For this customer-support example, start with prompt injection, unauthorized data disclosure, and unauthorized actions. That is a practical prioritization for this workflow, not a universal ranking of AI risks.
Your Monday Move
Take one real customer request and draw its path from authentication to the final answer. At every boundary, write the rule, enforcing component, failure response, and owner. Turn an unauthorized record read and an unapproved action into release-blocking tests before expanding the agent's permissions.
Get practical AI implementation guides in the newsletter.
- Published
- Category
- Build
- Language













