-
Notifications
You must be signed in to change notification settings - Fork 1
Copy Paste Examples
Krishna Kishor Tirupati edited this page May 23, 2026
·
1 revision
These examples are small runnable folders designed for developers searching for practical PolicyAware integration patterns. Each example includes a README.md, runnable Python, YAML policy, and captured terminal output.
| Example | What It Shows | Link |
|---|---|---|
| FastAPI LLM Policy Middleware | Protect a FastAPI /chat endpoint with policy checks before model execution. |
https://github.com/ktirupati/policyaware/tree/main/examples/fastapi-llm-policy-middleware |
| LangChain Policy Guardrails | Wrap a chain-style LLM call with deny-by-default policy, PII redaction, and secret blocking. | https://github.com/ktirupati/policyaware/tree/main/examples/langchain-policy-guardrails |
| MCP Tool Permission Gateway | Govern connector-level and action-level tool permissions for agent workflows. | https://github.com/ktirupati/policyaware/tree/main/examples/mcp-tool-permission-gateway |
| Example | What It Shows | Link |
|---|---|---|
| PII Redaction Policy | Inspect and redact sensitive text before model execution. | https://github.com/ktirupati/policyaware/tree/main/examples/pii-redaction-policy |
| Regulated RAG Assistant | Require citations and stricter controls for healthcare-style RAG. | https://github.com/ktirupati/policyaware/tree/main/examples/regulated-rag-assistant |
| Provider Routing By Risk | Route public-safe requests to low-cost models and high-risk requests to approved models. | https://github.com/ktirupati/policyaware/tree/main/examples/provider-routing-by-risk |
| Audit Trace Viewer | Write audit traces and generate a local HTML trace viewer. | https://github.com/ktirupati/policyaware/tree/main/examples/audit-trace-viewer |
| Approval Workflow Hooks | Send high-risk requests to approval instead of calling a model. | https://github.com/ktirupati/policyaware/tree/main/examples/approval-workflow-hooks |
pip install policyaware
cd examples/pii-redaction-policy
python demo.pyExpected output:
contains_pii=True
categories=email, phone
redacted=Contact [REDACTED_EMAIL] or [REDACTED_PHONE] about claim ACME-42.
gateway_decision=conditional_allow
gateway_actions=redact
They show how PolicyAware fits into common developer searches:
- FastAPI LLM policy middleware
- LangChain policy guardrails
- MCP tool permission gateway
- PII redaction before LLM calls
- regulated RAG governance
- risk-based model routing
- audit trace viewer
- approval workflow hooks
- Home
- Capabilities
- Copy-Paste Examples
- Comparison
- SEO And Distribution
- Ready-To-Use YAML
- Data Protection
- Policy Enforcement
- Gateway Orchestration
- Risk Classification
- Model Routing and Providers
- Tool Governance
- Evaluation
- Audit and Observability
- ML-Assisted Signals
- Installation
- Quick Start
- Architecture
- CLI Reference
- ML Integrations
- Provider Adapter Examples
- YAML Policy Templates