Skip to Main Content
Talk Intermediate AGPL v3

Developing safety guardrails for AI use cases in the Indian social sector

Proposal status is Rejected
Session Description

The problem statement 

Foundational models like Claude, GPT, and Gemini can read and write Indian languages fluently but fluency does not ensure safety. In real deployments serving health and education needs, these models miss the sociocultural norms, colloquial usage, and shared context that grassroots communities live in. This results in subtle, repeated harms that standard model evals never surface. This talk shares how we found those harms across 4 live NGO deployments and built Kaapi Guardrails — an open-source, configurable safety layer — to catch them.

How it looks in real scenarios

When AI tools go live in the social sector, the failures aren't hypothetical — they're specific and recurring:

  • A user shares a phone number, Aadhaar number, or a PDF medical report in-line, and it flows straight through to the model.

  • A health query gets a response carrying a caste/gender slur or an unfounded gender assumption ("Ask your doctor about these symptoms, he can guide you…").

  • A user describes symptoms to a maternal-health information bot, and instead of pointing them to a clinic, it confidently prescribes a specific medicine and dosage. Thereby, providing medical advice it was never built, qualified, or verified to give. 

These are the gaps between "the model speaks Hindi" and "the model is safe for this community.

The solution

We collaborated with 4 grassroots NGOs across health and edtech —  SNEHA, VigyanShaala, TAP, Inqui-Lab — to study their on-ground AI deployments, surface immediate safety risks, and build guardrails customisable across domains.

Primary research pointed us to 6 priority issues: PII removal, slur detection, topic relevance, toxicity detection, gender-assumption-bias removal, and answer relevance.

Our Evaluation Method

Manual annotation of input–output pairs sampled from pilot and live data, labelled with domain-specific labels and analysed for patterns of repeated error:

  • SNEHA (Healthcare): ~60,000 pairs → 1,000 annotated (~1.6%)

  • VigyanShaala (EdTech): ~20,000 pairs → 500 annotated (~2.5%)

Regular client consultations: The annotation exercise was supported by regular client consultations to understand how their end users interact with their AI tool, which included the following: 

  1. Gathering information on actual usage of their AI tool versus its intended purpose.

  2. Risks and harms they anticipated and were observing during pilot runs. 

  3. Providing recommendations for safety design based on the manual evaluations. 

  4. Discussing configuration needs for individual safety guardrails through multiple rounds of testing on live data.

Technical implementation of guardrails 

A standalone REST microservice that sits between your app and the LLM. You call it before sending a prompt to the model (input guardrail) and after receiving the reply (output guardrail); each call returns a safe/unsafe verdict and, optionally, a redacted or rephrased version of the text.

  • Stack: FastAPI + SQLModel + PostgreSQL, Dockerised; validation engine is the open-source guardrails-ai SDK (v0.10.0).

  • Configuration-driven, not code-driven: validator presets, banned-word sets, and topic-scope definitions are stored in the DB (scoped per organization_id) — NGOs tune safety to their domain without touching code or redeploying.

  • Multitenant + observable: every call writes a request_log, and each validator writes a validator_log (PASS/FAIL, input, output, error). User input is redacted from error logs by design, so observability never becomes a leakage vector.

The validator inventory (input → output)

Validator

What it does

How it's built

PII Remover (pii_remover)

Redacts 15 entity types incl. India-specific IDs — Aadhaar, PAN, Passport, Voter ID, Vehicle Reg.

Microsoft Presidio + spaCy en_core_web_lg; labelled placeholders e.g. [REDACTED_PERSON_1]

Lexical Slur (uli_slur_match)

Detects bilingual (Hindi/English) slurs; severity-filterable (low/med/high)

Crowdsourcd Slur list from Project Uli + text normalisation (emoji strip, NFKC, ftfy); redacts [REDACTED_SLUR]

Ban List (ban_list)

Blocks exact terms (e.g. sonography, gender check for PCPNDT compliance)

Guardrails Hub; word-sets stored in DB, resolved at request time

Topic Relevance (topic_relevance)

Keeps the bot in-domain; scores 1–3, ≤1 fails

LLM-as-judge (gpt-4o-mini via LiteLLM) wrapping Hub LLMCritic; versioned prompt templates

Profanity Free (profanity_free)

General profanity screen

Guardrails Hub

Gender Assumption Bias (gender_assumption_bias)

Replaces stereotyping words with neutral terms; domain categories (healthcare/education/all)

Custom CSV (word, neutral-term, type)

Toxicity / NSFW (nsfw_text)

ML toxicity classification

textdetox/xlmr-large-toxicity-classifier (XLM-RoBERTa)

LlamaGuard 7B (llamaguard_7b)

Policy-based safety (violence/hate, sexual, self-harm, etc.)

Meta's LlamaGuard, remote inference

Pick the right response per risk — three on-fail modes: fix (redact/correct silently), exception (block the message), or rephrase (signal the caller to ask the user to rephrase). Not every unsafe input should be handled the same way.

It works (before → after)

Input

Guarded output

Validator

कृपया मेरी रिपोर्ट इस +916163648503 पर भेज दें।

कृपया मेरी रिपोर्ट इस  <PHONE_NUMBER> पर भेज दें।

PII

That chappri staff never responds…

that [REDACTED_SLUR] staff…

LEXICAL_SLUR

what that spokeswoman said

what that spokesperson said

GENDER_ASSUMPTION_BIAS

Fig. 1. AI interaction with Guardrail 

Key Takeaways
  1. Manual evaluation is critical for surfacing nuanced multilingual/multicultural risks that emerge over time. Remember model fluency in a language is not the same as safety in its culture.

  2. Comprehensive manual evals include golden-dataset review, pilot + live annotation, and review of guardrail outputs.

  3. Manual + automated evals must run in tandem, iteratively, to reach a robust safety design for your specific use case and threshold.

  4. Make safety configuration-driven, not code-driven. Severity levels, banned-word sets, topic scopes, and bias categories belong in DB-backed config referenced by ID — so each NGO adapts guardrails to its domain without redeploying.

  5. Measure the precision/recall trade-off, and latency, before trusting a guardrail live. 

References

Session Categories

Introducing a FOSS project or a new version of a popular project
Talk License: AGPL v3

Which track are you applying for?

Main track

Speakers

Baarish Aggarwal
Baarish Aggarwal Research Development and Grants Specialist | Tattle Civic Tech

Dr. Baarish Aggarwal (they/them) is a Research Development and Grants Specialist at Tattle Civic Technologies, applying feminist and disability justice frameworks towards making online spaces and AI tools safe for users at the margins. Currently, they conduct rigorous manual evaluations of AI systems deployed in diverse grassroots contexts in
India, to mitigate bias and surface harms while centering the needs of marginalized communities. Community building, making friends with stray cats, and adopting new hobbies are
some ways that they sustain joy in this world.

Akhilesh Negi
Akhilesh Negi AI engineer | Project Tech4Dev

Akhilesh Negi is an AI Engineer at Tech4Dev with 7 years of engineering experience. He builds Kaapi — an API-first AI platform for non-profits — and leads its evaluation and safety-guardrails work. He focuses on making LLM applications safe and reliable for real-world social-sector
use.