Responsible AI (RAI)
Documents where AI is used, model choices, guardrails, cost controls, and risk mitigations for an LLM-based system.
What this file does
Documents where AI is used, model choices, guardrails, cost controls, and risk mitigations for an LLM-based system.
When to use it
- Starting a new AI project that needs documented safety and ethics decisions
- Auditing an existing system for responsible AI practices
- Onboarding team members to AI usage policies and trade-offs
- Preparing for a compliance review or client demo
Assumes this stack
Responsible AI (RAI)
Where AI is Used
- Query classification
- Response generation (LLM)
- Safety classification
- Semantic retrieval (embeddings)
Model Selection
| Component | Model | Reason |
|---|---|---|
| LLM | kimi-k2.5 | High-quality responses |
| Embeddings | MiniLM | Lightweight, efficient |
| Safety | phi3:mini | Fast, low-cost classifier |
Trade-offs
- Kimi chosen for quality over full local control
- MiniLM chosen for speed and cost efficiency
- Low temperature for deterministic responses
Guardrails
Input
- PII detection and anonymization
- Prompt injection detection
Output
- Context grounding via RAG
- Controlled generation
- Fallback responses
Cost Control
- Small embedding model (MiniLM)
- Limited context window (
context_k) - Token limits enforced
- Async execution reduces compute waste
Risk Mitigation
| Risk | Mitigation |
|---|---|
| Hallucination | RAG grounding |
| Unsafe prompts | Safety classifier |
| PII leakage | Presidio anonymization |
| Model misuse | Input filtering |
Evaluation
-
Manual testing with:
- Safe prompts
- Injection attempts
- PII-containing inputs
-
Observed:
- Safe rejection of malicious prompts
- Correct anonymization of sensitive data
- Grounded responses when context available
Limitations
- No automated evaluation metrics (PoC)
- Safety classifier depends on LLM behavior
- Partial reliance on external infrastructure (Pinecone)
Ethical Considerations
- System refuses unsafe or harmful requests
- Sensitive data is never passed raw to LLM
- Designed for enterprise-safe usage only
What's inside
8 sections: where AI is used, model selection, trade-offs, guardrails, cost control, risk mitigation, evaluation, limitations, ethical considerations.
Change this for your project
- Replace
kimi-k2.5with your chosen LLM model - Replace
MiniLMwith your embedding model - Replace
phi3:miniwith your safety classifier model - Replace
Pineconewith your vector database
Where it goes
Load as policy context for the agent, or keep beside the code enforcing the rules.
Related Documents
Guardrails, Safety & Content Filtering
Implements a layered guardrail system with input validation, output validation, and content filtering to protect LLM applications from prompt injection, jailbreaks, and data leaks.
DeepSeek R1: Case Study in Failed Extrinsic Alignment
Compiles public security research and independent findings to argue that extrinsic alignment methods are insufficient for AI safety, using DeepSeek R1 as a case study.
AI Safety & Guardrails for Voice Assistants
Defines a multi-layer safety architecture for voice assistants, covering input filtering, deterministic FAQ routing, RAG-grounded AI responses, and output guardrails.
Risk Assessment Matrix
Documents 12 risks with likelihood, impact, score, level, and mitigation for a child-facing AI app's data protection impact assessment.