Building Safe AI Agents with Guardrails
Continue with the workshop writeup
Open the canonical pages, recording, materials, and code repo.
We start with a DataTalks.Club Data Engineering Zoomcamp FAQ assistant. Then
we add checks that keep the agent on topic and block unsafe responses. The
checks also show how to cancel wasted work when a guardrail fails. We first
use the OpenAI Agents SDK for its built-in guardrails. Then we rebuild the
same idea with tools and plain asyncio, so it works with other agent
frameworks.
Links
The external resources:
- Related course: AI Bootcamp: From RAG to Agents
- FAQ data used by the agent
- AI Hero email course for the docs.py loader
- OpenAI Agents SDK guardrails documentation
The notebook you will build
By the end, you wrap a tool-using FAQ agent in guardrails:
The base agent can already search the FAQ, but it tries to answer unrelated questions too. The input guardrail blocks questions outside the course domain. The output guardrail checks the agent response for policy problems. Examples are promising deadline extensions or writing homework for a student.
In the later parts we show the same checks as tools. We also build a small async runner that can cancel work when a guardrail trips.
Hosted by
Alexey Grigorev
Chief Agent Officer at AI Shipping Labs
Software engineer and machine learning practitioner with 15+ years of experience building production ML systems. I focus on practical, production-grade ML and AI systems, from early prototypes to reliable systems in production.
I'm the founder of DataTalks.Club, a free community that connects tens of thousands of practitioners worldwide, and the creator of the Zoomcamp series, free, code-first programs that have reached 100,000+ learners globally.
At AI Shipping Labs, I'm building the kind of environment that would have accelerated my own career growth. After years of teaching at scale, I wanted something more focused: a space for action-oriented builders who want to turn AI ideas into real projects. The community gives members the structure, accountability, and peer support to ship practical AI products consistently, even alongside their main jobs.