DEV Community

Cover image for Handling personal data (PII) in LLM applications without it leaking where it shouldn't
PRANJUL RATHOUR
PRANJUL RATHOUR

Posted on Originally published at pranjulrathour.scult.in

Handling personal data (PII) in LLM applications without it leaking where it shouldn't

Personal data in an LLM application creates three distinct risks that need three distinct fixes: sending it to a third-party API, logging it insecurely, and it accidentally leaking into any training data.

Three separate problems, three fixes

  • Sending to a third-party API: check the provider's data-handling policy, and redact or mask PII before sending when the task doesn't genuinely require it.
  • Logging: never log full prompts or responses in plaintext if they contain PII; log hashes, redacted versions, or restrict access to logs strictly.
  • Training data: if you ever fine-tune on real user data, scrub PII from the dataset first — a model can memorise and later regurgitate specific training examples.

The habit that prevents most mistakes

Ask, for every piece of data flowing through the system, whether it actually needs to be there in that form. Most PII exposure in student projects comes from data flowing further than the task required, not from a deliberate decision to expose it.

See secrets management for student projects.

About Pranjul Rathour

Pranjul Rathour in a checked shirt inside a packed college auditorium
In a packed college auditorium

Pranjul Rathour in a suit and tie with a lanyard at a formal campus event
At a formal campus event

Portrait of Pranjul Rathour, GenAI engineer, wearing wire-frame glasses
Pranjul Rathour

Pranjul Rathour presenting on stage in a blue polo, with his Annapurna demo video on the screen behind him
Presenting Annapurna on stage

Pranjul Rathour giving a talk titled 'How and what I do', with demo videos of his products Vaidya and Annapurna on screen
Talking through the products he has shipped

Pranjul Rathour is a GenAI engineer from Kanpur, India, and CTO at SCULT INDIA, currently shipping production RAG,
fine-tuning and agentic AI systems, mentoring 200+ students through TechVerse Enclave, and judging and speaking at
student hackathons across India. Updated 2026-09-11.

Reach out if you want to talk GenAI, book a campus session, or invite him to judge:


Pranjul Rathour · GenAI engineer, 3x hackathon winner, campus mentor. Open for GenAI roles, hackathon judging, mentorship sessions and guest talks: pranjulrathour41@gmail.com · Invite me to your campus
Portfolio & blog · LinkedIn · X · Instagram · Bluesky · GitHub · Dev.to

Top comments (0)