Skip to main content

Introduction

This notebook demonstrates the integration of Enkrypt AI Guardrails with various model providers. It includes examples of how to set up and use OpenAI, Azure OpenAI, and AWS Bedrock in a Python environment. The notebook is structured to guide you through the process of importing necessary dependencies, toggling guardrails, setting environment variables, and executing API calls at both input and output of LLMs.

Importing dependencies

Python

Toggle Guardrails

Python

Set environment variables

Python

Initialize Guardrails function call

Python

OpenAI

Python
Output
Shell

Azure OpenAI

Python
Output
Shell

AWS Bedrock

In this example, we apply Guardrails to the output of the model even when the enable_guardrails is set to False. This is demonstrate that the ouput of a model can be potentially malicious and must be guarded against.
Python
Output
Shell