Shreya Rajpal on Building Reliable AI – Architecture, Integration, Performance & Best Practices.
Subscribe: Apple • Spotify • Overcast • Pocket Casts • AntennaPod • Podcast Addict • Amazon • RSS.
Shreya Rajpal serves as CEO and co-founder of Guardrails AI , where she also co-created the popular open-source project Guardrails, a Python framework designed to help developers build reliable AI applications. This episode explores AI Guardrails – the critical validation and verification systems that ensure AI models operate safely and reliably within defined boundaries. We dive deep into their technical architecture, including the orchestration framework, Guardrails Hub, and server components, while examining various real-world applications across healthcare, chatbots, and content moderation. The discussion covers implementation challenges, performance considerations, and future developments in the field, providing practitioners with comprehensive insights into building safer AI applications.

Interview highlights – key sections from the video version:
-
- What Are AI Guardrails? Definitions and Applications
- Early Adoption and Industry Awareness of Guardrails
- Exploring Guardrails Architecture and Open Source Features
- Input and Output Validation with Guardrails
- Guardrails Hub: Signal-to-Noise and Benchmarking
- Addressing Challenges in Scaling and Customization
- Common Use Cases: Chatbots, Agents, and Summarization
- Surprising Applications: Toxicity and Domain-Specific Needs
- Hallucination Detection in RAG Systems
- Handling Multimodal Expansion and Future Capabilities
- Focus Areas for Next 6-12 Months: Benchmarks and UX
- Guardrails Taxonomy and Popularity Metrics
- Closing Thoughts on Adoption and Future Development
Related content:
- A video version of this conversation is available on our YouTube channel.
- What is an AI Alignment Platform?
- Guardrails Need to Be Integrated With AI Alignment Platforms
- AI Incident Response: Preparing for the Inevitable
- The Art of Forgetting: Demystifying Unlearning in AI Models
- Andrew Burt: From Preparation to Recovery: Mastering AI Incident Response
If you enjoyed this episode, please support our work by encouraging your friends and colleagues to subscribe to our newsletter:
Transcript.
Below is a heavily edited excerpt, in Question & Answer format.
What exactly are guardrails in the context of AI applications?
Guardrails are explicit validation or verification checks that occur around any AI or foundation model API call. They work on both the input side before a request goes to an AI model and on the output side after you receive a response. While the concept sounds philosophical, in practice guardrails are concrete validation mechanisms that verify your assumptions about how a model should behave for your specific use case.
The need for guardrails has become more critical with today’s generation of AI systems which are essentially “do everything, do anything” models with unbounded outputs. Because these models are so flexible, you need explicit verification to ensure they stay within the boundaries required for your application.
Which industries or types of companies are currently most engaged with AI guardrails?
The adoption pattern is interestingly bimodal. On one end, we see early-stage startups and AI-first vertical solutions that are at the cutting edge of AI application development. On the other end, we see large financial institutions and regulated industries that have a lot to gain from AI but also face significant reputational and regulatory risks.
Beyond these two groups, we’re starting to see much more cross-functional adoption across different industries. The common thread is that teams see guardrails not as a way to slow down innovation, but as an enabler that allows AI to be deployed in higher-stakes scenarios that would otherwise be too risky.
How does the Guardrails open source project architecture handle input and output validation?
The open source project has two main components. First, there’s an orchestration framework that allows you to put different guardrails together into what we call a “guard.” A guard is a collection of individual guardrails – for example, one guardrail might check for bias, another for PII, another for hallucinations.
Each individual guardrail is focused on a specific validity check. For instance, if you’re building a banking application, you might have a guardrail that specifically checks for and prevents financial advice being given to users.
The second component is the Guardrails Hub, which is a repository of pre-built guardrails that we and the community have created for various use cases. Users typically download guardrails from the hub that match their needs, potentially create some custom guardrails for their specific use cases, and then wrap them together into guards that run around their LLM applications.
What are the most common integration patterns for teams using Guardrails?
The most common pattern we’re seeing now, especially in larger organizations, is the creation of centralized GenAI infrastructure. These teams build centralized platforms that include components like model gateways, model routers, vector databases, and now guardrails as a core component.
The typical integration is through a “guardrails server” mode – essentially a service with a consistent API (compatible with OpenAI’s API) that lets you create guards and run them on the service. Application teams can then query OpenAI through this guardrails server instead of directly, which requires just a one-line code change but delivers protected AI outputs instead of raw outputs.
For latency, we try to keep individual guardrails to 50-200 milliseconds, with end-to-end validation running multiple guardrails together still under 250 milliseconds. This is important because while LLMs are the main bottleneck, you don’t want to add significant overhead.
What are your favorite use cases for Guardrails?
First, chatbots are our most widely adopted use case. Teams use guardrails to catch hallucinations, detect PII leakages, and identify jailbreaking attempts in real-time.
Second, we’re seeing interesting applications for agent workflows. Teams need to constrain different execution steps of an AI agent to only do what that specific step should do. This constraining is essential for building reliable, robust agent systems.
Third, in healthcare, text summarization is a major use case. Medical notes summarization has very stringent regulatory requirements – for example, you can’t abbreviate certain terms. Guardrails help ensure summaries remain factual and contain the proper terminology.
One surprising discovery was that toxicity detection is among our most downloaded guardrails – even more than hallucination or PII detection guardrails in some cases.
For teams just starting with guardrails, what’s the best way to begin?
Start with our Quick Start experience by setting up a guardrails server with some of the guardrails that address your most immediate concerns. The beauty is you can simply swap out your direct OpenAI or LLM call with a call to the guard, and it becomes almost invisible until a specific risk is detected.
Begin with something straightforward and visible – like PII detection – to see how it works. This gives you a sense of how guardrails fit into your existing AI development workflow without being overwhelming.
The developer experience remains virtually unchanged as we maintain compatibility with the OpenAI API, so you’ll only need to make minor code changes to your application.
What’s next for Guardrails open source in the coming 6-12 months?
We’re extremely excited about two major developments. First, we’re releasing benchmarks and leaderboards for guardrails, which will make it transparent and easy to understand the performance of different guardrails. These will include accuracy metrics, latency on different hardware (CPU/GPU), and for certain guardrails, cost information when applicable.
Second, we’re working toward a 1.0 release of Guardrails with a stable API. We’re currently still on 0.x versions with minor releases, but the major version will establish a stable foundation for developers.
We’re also improving the UX of the Guardrails Hub with better taxonomy and organization to help users discover the right guardrails for their needs. While we’ll continue to show popularity metrics since they can be a valuable signal, we’ll emphasize performance metrics to help users make the best technical choices.
