Safety, privacy and running in production · mid
Guardrails and personal data in AI features
Guardrails are checks on inputs and outputs, built from code first, then small classifiers, then model checks. Personal data sent to a hosted model needs mapping, minimising and legal care, including India's DPDP Act.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- A jailbreak tries to make the model break its own safety rules. Prompt injection takes over your app's instructions, often through content the app reads.
- Input guardrails: topic and policy classifiers, PII detection, injection detection, size limits and per-user rate limits.
- Output guardrails: schema validation, PII and secret scanning, policy checks, grounding checks, allowlisted links, safe rendering and blocks on commitments the bot may not make.
- Order of tools: plain code first (regexes, schemas, allowlists, business rules in tools), then small fast classifiers, then model-based checks. Run input checks in parallel with retrieval to save time.
- Before sending chats to a hosted model, map the data: which fields leave, to which provider and region, and who sees the results.
- Check provider terms: training on API data, retention, zero-retention options, region, sub-processors and a data processing agreement. You remain responsible for the data.
- Minimise: send only what the task needs, mask identifiers such as phone, PAN, Aadhaar and UPI ids before sending, keep the mapping in-house, and block the highest-risk data.
- DPDP Act: clear notice and consent, purpose limitation, access, correction and erasure rights. Erasure must reach documents, chunks, embeddings and caches. Dates of duties are phased, so check the latest notifications.
The red pen
Common traps: mistake → fix
Mistake: A guardrail model catches everything
Fix: use layers, and keep business rules in code.
Mistake: A jailbreak and an injection are the same
Fix: one attacks the model's rules, the other attacks your app.
Mistake: The provider is responsible for our customers' data
Fix: you stay responsible for it.
Easy to hard
Questions interviewers ask, easy to hard
- What are guardrails and where do you place them?
- Jailbreak or prompt injection: what is the difference?
- Legal asks what personal data leaves our systems when we use a hosted model. What do you check?
- What does the DPDP Act mean for an AI feature?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.