A customer-service chatbot may treat a customer’s instruction as authority and make an offer it was never meant to make. A guardrail reduces this risk by screening or constraining inputs, outputs, or actions. It can catch obvious violations, but it is a filter that can be bypassed, not an enforced boundary between instructions and untrusted content. section 4.5 section 4.0
Input guardrails use classifiers or pattern matching to screen prompts before they reach the model. They can miss attacks that are rephrased, encoded, spread across multiple interactions, or embedded in retrieved content such as a PDF or image. Continuous red teaming, updated filters, and controls that limit the consequences of a bypass are necessary. section 4.5
Output guardrails route model responses through a separate moderation layer before users see them. Classifiers can be combined with keyword lists or regular expressions for known hazards. Customize the rules to the domain and validate model-based judges against real examples from the deployment; vendor safeguards can also fail under adversarial pressure. section 6.5.1
A chatbot manipulated into an offer
A customer instructed a dealership chatbot to agree with customers and call each response a legally binding offer. It then confirmed a vehicle sale for one dollar. The dealership did not honor the offer and shut down the chatbot, illustrating how an instruction in customer input can override the intended interaction. section 4.5
Place guardrails within a broader operational workflow:
- Log inputs and outputs to support moderation, audit, and improvement; route outputs through at least one moderation classifier before release. section 6.5.1
- In a self-hosted pipeline, screen inputs and apply rate controls before the model call; filter and redact outputs afterward. section 2.4.1
- For retrieval-augmented generation, enforce document-level access separately from output filtering, then test and monitor retrieval behavior. section 5.4.3
- Require human review when a use case cannot tolerate fabricated statements about individuals or involves sensitive, high-impact outputs. section 5.4.3
Deployment changes who controls the safeguards. SaaS users largely depend on vendor moderation and post-processing; API integrators can add their own checks; model hosters control the pipeline but still face the same limits of filtering and factuality checks. section 5.4.3






















