liveBook · Manning

Input guard

As explained in Machine Learning Platform Engineering

An input guard is a pre-processing protection component that screens or transforms user input before model processing.

An input guard screens and sanitizes user queries before they reach an LLM, reducing exposure to malicious prompts, PII, competitor mentions, and policy violations. section 13.3.1

Guardrails AI validation

Configure Guardrails AI, combine CompetitorCheck and GuardrailsPII validators with distinct on-fail actions, then call input_guard.validate(user_input) before model processing.

Figure 13.6 Multilayered safety guardrails architecture diagram showing input guards, LLM processing, and output guards workflow
A diagram of a diagram

AI-generated content may be incorrect.

Use the architecture diagram to compare an unprotected prompt-to-LLM pipeline with multilayered input, processing, and output protection. section 13.3.1

How Machine Learning Platform Engineering covers it

How deep it goes
Explains layered protection and demonstrates validator configuration, failure actions, validation, and sanitized-output handling.
Examples
Uses competitor-name rejection, automatic email redaction, and Guardrails AI validator configuration.
What it assumes
Assumes an LLM application and teaches Guardrails AI setup, validator selection, and API-key configuration.
What you can do after
Operate/configure Guardrails AI validators that reject or repair unsafe input before model processing.
How it connects
Connects input sanitization, PII detection, processing controls, output guards, content safety, and business logic validators.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.