On-Prem AIGlossary

What Is AI Guardrails?

Also known as: LLM Guardrails, AI Safety Controls

Definition

AI guardrails are the technical and policy controls placed around an AI system that constrain what it may receive as input, what it may produce as output, and what actions it is permitted to take, independent of what the model itself decides.

AI Guardrails Explained

Guardrails operate at three points. Input guardrails inspect the incoming prompt and retrieved context for injection attempts, out-of-scope requests, or data the user is not cleared to see. Output guardrails inspect generated text before it reaches the user, checking for leaked secrets, unsupported claims, unsafe instructions, or format violations. Action guardrails sit between the model and any tool it can invoke, enforcing that a proposed write, transaction, or email is permitted before it executes.

The essential design principle is that guardrails must live outside the model. A system prompt instructing a model to behave is a preference, not a control, because a sufficiently clever input can override it. Real enforcement happens in deterministic code: an authorization check against the user's identity before a tool runs, a regular expression scan for credential patterns, a schema validator that rejects malformed output. Model-based classifiers can supplement these but should never be the only barrier.

Identity propagation is where enterprise deployments most often fall short. If the AI service connects to the ERP using a single privileged service account, then any user who can reach the assistant inherits that account's reach regardless of their own permissions. Correct design passes the end user's identity through to every data access, so retrieval and tool calls are evaluated against that person's actual entitlements. This is harder to build and is the difference between a demo and a system that survives security review.

Guardrails also carry an evidentiary function. Log every prompt, every retrieved document identifier, every tool invocation, every guardrail decision, and the final output, tied to a user and a timestamp. In a regulated environment that record is what lets you answer what the system was asked, what it saw, what it did, and why it refused. Without it, an incident investigation depends on reconstructing behavior from memory.

Why It Matters

  • Enforcement in deterministic code outside the model is the only control that a crafted prompt cannot argue its way past.
  • Propagating end user identity to every retrieval and tool call prevents an assistant from becoming a permission escalation path into the ERP.
  • Action-level approval gates keep an agent's mistakes reversible by requiring human confirmation before consequential writes execute.
  • Complete logging of prompts, sources, actions, and refusals provides the audit trail regulated environments require after an incident.

In Practice

A widespread architecture flaw: the assistant queries the ERP through one service account with broad read access. A shop-floor user asks about margins on a job and receives them, because the retrieval layer never evaluated that user's own entitlements. The model behaved correctly. The authorization design was wrong.

Frequently Asked Questions

Are system prompt instructions enough to control an AI system?

No. A system prompt shapes default behavior but is text the model weighs against everything else in context, so a determined or accidental input can override it. Treat the system prompt as guidance and place real enforcement in deterministic code: authorization checks, schema validation, output scanning, and approval gates that execute regardless of what the model produced.

What should AI guardrails log?

At minimum the authenticated user, the full prompt, identifiers of every retrieved document, every tool call with its arguments and result, every guardrail decision including refusals, the model and version used, and the final output. Retain according to your records policy. This record is what makes an incident investigation or audit response factual rather than reconstructed.

Working with AI Guardrails in a live environment? Our engineers do this every day - and our AI agents automate most of it.