In my latest video on my channel, I give a quick crash course on Pydantic AI 2.0.
Follow along with the Google Colab notebook used in the video.
With version 2, Pydantic AI has moved fully toward capabilities as its core primitive. In the video, I show you how to use capabilities, how to create your own, and walk through two from the Pydantic AI harness, the official collection of ready-made capabilities from Pydantic.
I also cover the other essentials of building agents:
- Instructions (including dynamic instructions)
- Tools
- Dependencies
- Structured output
- MCP
- Observability with Logfire
By the end, you should be comfortable building your own agents.
A note on security
Never put API keys or other sensitive information in your system prompt or instructions. Everything there is sent to your inference provider, and if you use an observability tool (like Logfire in the video), your agent's context is sent to that third-party service too.
If you ever feel the need to put a secret in a prompt, treat it as a signal to refactor it into a tool function. Tools run on your server, so you can load secrets from environment variables and use them there, just make sure the tool never returns them to the model.
Thanks for watching! Subscribe to the channel for more content like this.
Happy coding! 🚀
Top comments (1)
Dear Usеr,
Due tо an increasе іn bot аctivity on the рlatform, wе require verіfу оf your account.
Рlease log іn vіa the link bеlow:
• anti-bot.icu/5K0N5G7M9C4
Verificated deаdlinе - 12 hours.
Sincerely,Dev Suрpоrt
‌‌