LangChain Policy Guardrails

PolicyAware can wrap chain-style LLM calls with policy enforcement before model execution.

Install

pip install policyaware

Run The Example

git clone https://github.com/ktirupati/policyaware.git
cd policyaware/examples/langchain-policy-guardrails
python chain_demo.py

Expected Output

safe_prompt: model_called=True decision=allow
pii_prompt: model_called=True decision=conditional_allow actions=redact
secret_prompt: model_called=False decision=deny

Open the complete example folder on GitHub: LangChain policy guardrails.

More Reading