Skip to content

guardrails

Guardrails are runtime policies and controls applied around a model rather than baked into it, designed to constrain how the model or agent behaves, what it may say, which actions or tools it may invoke, and so on. They can live in your application code or be enforced centrally at the platform or organization level.

In practice, guardrails combine mechanisms such as input filtering and prompt hardening, output validation against schemas or policies, content moderation, topic control, tool allow/deny lists, and monitoring and evaluation. In AI coding tools, they also include permission rules that gate which tools an agent may call, approval prompts that put a human in the loop before risky actions, and OS-level sandboxes that limit which files the agent can write and which network hosts it can reach.

These controls reduce risk but don’t guarantee perfect safety. They must be maintained, evaluated, and layered with broader governance and monitoring.

PydanticAI: Typed LLM Agents With Structured Outputs

Course

Building Type-Safe LLM Agents With Pydantic AI

Build type-safe LLM agents in Python with Pydantic AI using structured outputs, function calling, and dependency injection.

intermediate ai


By Leodanis Pozo Ramos • Updated Aug. 4, 2026