Back to .md Directory

Responsible AI (RAI)

Documents where AI is used, model choices, guardrails, cost controls, and risk mitigations for an LLM-based system.

May 2, 2026
0 downloads
0 views
ai llm rag prompt eval guardrails safety
View source

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

kimi-k2.5MiniLMphi3:miniPresidioPineconeRAG

Responsible AI (RAI)

Where AI is Used

  • Query classification
  • Response generation (LLM)
  • Safety classification
  • Semantic retrieval (embeddings)

Model Selection

ComponentModelReason
LLMkimi-k2.5High-quality responses
EmbeddingsMiniLMLightweight, efficient
Safetyphi3:miniFast, 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

RiskMitigation
HallucinationRAG grounding
Unsafe promptsSafety classifier
PII leakagePresidio anonymization
Model misuseInput 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.5 with your chosen LLM model
  • Replace MiniLM with your embedding model
  • Replace phi3:mini with your safety classifier model
  • Replace Pinecone with your vector database

Where it goes

Load as policy context for the agent, or keep beside the code enforcing the rules.

Related Documents