Skip to main content

AI Engineering / Field notes

Architecting DPDP Compliant AI Systems for Indian Businesses

As Indian businesses rapidly adopt AI, navigating the Digital Personal Data Protection Act 2023 is critical for legal and ethical operations. This guide details how to engineer AI systems, from RAG to agents, that are inherently compliant with India's stringent data privacy regulations, ensuring trust and avoiding penalties.

India's digital economy is booming, with AI adoption accelerating across start-ups, D2C brands, and enterprises. Yet, this rapid innovation comes with a critical responsibility: safeguarding personal data. The Digital Personal Data Protection Act, 2023 (DPDP Act) fundamentally reshapes how Indian organisations must design, deploy, and manage AI systems that handle personal data. Ignoring these regulations isn't an option; it risks substantial penalties and erodes customer trust.

TL;DR: Building AI systems that comply with India's DPDP Act requires deliberate architectural choices, especially for RAG and AI agents. Focus on data minimisation, explicit consent, strong access controls, and robust audit trails to protect personal data, avoid regulatory fines, and foster trust with Indian users and businesses.

Key takeaways

Scrabble letter tiles spelling 'application' on a wooden surface.
Photo by Pixabay on Pexels
  • The DPDP Act mandates specific principles like consent, data minimisation, and purpose limitation for all AI systems processing personal data in India.
  • RAG architectures must incorporate PII masking, consent-based data ingestion, and mechanisms for data principals to exercise their rights (e.g., erasure) within vector stores.
  • AI agents require granular access controls, auditable tool use, and human-in-the-loop mechanisms when interacting with personal data or external APIs like India Stack.
  • Organisations must implement robust evaluation, monitoring, and incident response frameworks tailored to DPDP compliance, including CERT-In reporting obligations.
  • Compliance is an ongoing engineering effort, impacting costs and requiring careful vendor selection, but it's essential for sustainable AI adoption in India.

Understanding DPDP 2023 for AI Developers

A clean and organized office desk setup featuring a laptop, clipboard with application form, and pen.
Photo by Markus Winkler on Pexels

The DPDP Act, as of 2026, establishes a comprehensive framework for processing digital personal data in India. For AI developers, this isn't merely a legal formality; it's a set of technical constraints and requirements that must be baked into the system design from day one. At its core, the Act revolves around the relationship between the Data Fiduciary (the entity determining the purpose and means of processing personal data) and the Data Principal (the individual to whom the personal data relates).

Key Definitions & Their AI Implications:

  • Personal Data: Any data that can identify an individual. In AI, this means everything from names and contact details to unique identifiers, biometric data, or even behavioural patterns if they can be linked back to a person.
  • Consent: Explicit, informed, and unambiguous consent from the Data Principal is paramount. For AI, this means clearly communicating what data will be used, for what purpose, and how long.
  • Purpose Limitation: Personal data can only be used for the specific purpose for which consent was obtained. AI systems must be designed to prevent data drift or repurposing without fresh consent.
  • Data Minimisation: Collect and process only the minimum personal data necessary for the stated purpose. This directly impacts data ingestion strategies for RAG and training datasets.
  • Significant Data Fiduciary (SDF): Certain Data Fiduciaries, based on volume and sensitivity of data, are designated as SDFs, incurring additional obligations like Data Protection Impact Assessments (DPIAs) and appointing a Data Protection Officer. Many AI-driven enterprises in India will fall under this category.

When NOT to use this approach: If your AI system exclusively processes anonymised, aggregated, or non-personal data, or if it's a purely internal tool handling generic operational data without any link to identifiable individuals, the full rigour of DPDP compliance might not apply. However, most AI applications interacting with users, customers, or employees will inevitably process personal data, making these considerations mandatory.

Architectural Principles for DPDP Compliance

Building a DPDP compliant AI architecture requires integrating privacy-by-design principles into every layer. This goes beyond simply adding a privacy policy; it's about engineering controls.

  1. Consent Management & Withdrawal: Your AI application must have a robust mechanism to obtain, record, and manage user consent. This includes clear opt-in flows, granular consent for different data uses, and an easy way for Data Principals to withdraw consent at any time. This often involves integrating with a dedicated consent management platform (CMP) or building one in-house.
  2. Data Minimisation & Purpose Limitation: Design your data pipelines to ingest only necessary personal data. For RAG systems, this means careful curation of documents. For AI agents, it means restricting access to sensitive databases or APIs only when absolutely required for the task at hand.
  3. Data Principal Rights: The DPDP Act grants Data Principals several rights that your AI architecture must support.
Data Principal Right (DPDP Act) AI System Implementation Architectural Consideration
Right to Access Information Provide APIs/interfaces for users to query what personal data the AI holds about them. Data inventory mapping, secure API endpoint, authentication (e.g., Aadhaar-linked OTP).
Right to Correction & Erasure Implement mechanisms to update or delete personal data from training data, vector stores, and logs. Data lifecycle management, GDPR-like "right to be forgotten" implementation, data sanitisation tools, re-indexing.
Right to Grievance Redressal Establish clear channels for Data Principals to raise concerns about AI's use of their data. Designated grievance officer contact, internal issue tracking system, clear escalation paths.
  1. Accountability & Audit Trails: Every interaction an AI system has with personal data must be auditable. This means comprehensive logging of data access, modifications, and processing steps. These logs are crucial for demonstrating compliance to regulators.

Implementing DPDP in RAG Systems for India

Retrieval-Augmented Generation (RAG) systems are popular for grounding LLMs with proprietary data. However, when that proprietary data contains personal information, DPDP compliance becomes complex.

Data Ingestion & Storage:

The first hurdle is ensuring that personal data entering your vector database (like pgvector, Pinecone, or Qdrant) is handled lawfully. This begins with consent-based data sourcing. If you're ingesting customer support tickets, ensure your terms and conditions (and explicit consent mechanisms) cover the use of that data for RAG. Our team, in a recent client engagement building a customer support RAG system for an Indian D2C brand, implemented a pre-ingestion PII masking layer using a custom Named Entity Recognition (NER) model, combined with a strict data retention policy for chat logs after 90 days, to comply with both internal policies and DPDP's data minimisation principle.

Anonymisation and Pseudonymisation are critical. Before chunking and embedding, identify and mask or remove PII from your documents. This reduces the risk of leakage and simplifies compliance. While full anonymisation is challenging, effective pseudonymisation can significantly mitigate risks. For instance, replacing Aadhaar numbers or mobile numbers with unique, non-identifiable tokens.


import re

def mask_pii_simple(text: str) -> str:
    # Example: Masking Aadhaar numbers (12 digits) and mobile numbers (10 digits)
    text = re.sub(r'\b\d{4}\s?\d{4}\s?\d{4}\b', '[AADHAAR_MASKED]', text) # Aadhaar
    text = re.sub(r'\b(?:(?:\+|0{0,2})91(\s*[\-]\s*)?|[0]?)?[6789]\d{9}\b', '[MOBILE_MASKED]', text) # Indian Mobile
    text = re.sub(r'\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b', '[EMAIL_MASKED]', text) # Email
    return text

# Example usage before chunking and embedding
sensitive_document = "My name is Priya Sharma, my Aadhaar is 1234 5678 9012, and my email is priya.s@example.com. Contact me on 9876543210."
masked_document = mask_pii_simple(sensitive_document)
# Output: "My name is Priya Sharma, my Aadhaar is [AADHAAR_MASKED], and my email is [EMAIL_MASKED]. Contact me on [MOBILE_MASKED]."

Data retention policies must be integrated into your RAG data lifecycle. Personal data should only be stored for as long as necessary for the stated purpose. Implement automated deletion or anonymisation routines for stale data within your vector stores and source documents. While DPDP allows cross-border data transfers under certain conditions, for many Indian businesses, data localisation for sensitive personal data remains a prudent strategy, especially if other sectoral regulations (like RBI's payment data localisation rules) apply.

Retrieval & Generation:

Even with masked data, the retrieval and generation phases need attention. Implement post-retrieval filtering to catch any PII that might have slipped through or to filter results based on the user's consent profile. The LLM generation step itself must be guarded against hallucinating or leaking personal data. This often involves prompt engineering techniques and output parsing to ensure no PII is inadvertently exposed in the generated response.

DPDP-Compliant AI Agents and Workflows

AI agents, with their ability to use tools and interact with external systems, introduce additional layers of DPDP complexity. Each tool call, each API integration, is a potential point of data transfer or exposure.

Tool Use & External APIs:

When an AI agent uses tools that access or modify personal data – for instance, interacting with a CRM, an e-commerce platform like ONDC, or an India Stack service like Aadhaar eKYC – strict controls are necessary. You must conduct a thorough data flow mapping to understand exactly where personal data goes, what transformations occur, and who has access at each step. On a production rollout for an AI-driven loan application assistant, we shipped an agent workflow that required explicit consent capture via Aadhaar eKYC (using an official API provider) before sharing any financial personal data with upstream credit scoring APIs. Our audit logs tracked every data point accessed and shared, a critical component for DPDP accountability.

Implement granular access controls for your agents, ensuring they only have the minimum necessary permissions to perform their tasks. Each tool should enforce its own authentication and authorisation policies. For more complex business workflow automation, consider how your business workflow automation system interacts with personal data and ensure it aligns with DPDP principles.

Human-in-the-Loop & Auditability:

For sensitive operations involving personal data, a human-in-the-loop (HITL) mechanism is highly advisable. This ensures that critical decisions or data transfers are reviewed and approved by a human, adding a layer of oversight and accountability. All agent decisions, tool calls, and data interactions must be comprehensively logged, creating an immutable audit trail. This is not just good practice; it's a legal requirement under DPDP for demonstrating compliance.

Evaluation, Monitoring & Incident Response

Compliance isn't a one-time setup; it's an ongoing process. Your AI systems need continuous evaluation and monitoring for DPDP adherence.

DPDP-focused LLM Evaluation:

Beyond traditional accuracy metrics, your LLM evaluation harness should include tests specifically designed to detect PII leakage, ensure consent adherence, and verify purpose limitation. Red-teaming your AI system for privacy violations – intentionally trying to extract personal data or bypass consent mechanisms – is crucial. This proactive testing helps identify vulnerabilities before they become incidents.

Monitoring & Alerting:

Implement real-time monitoring for unusual data access patterns, unauthorised data transfers, or anomalies that could indicate a privacy breach. Automated alerts should be configured to notify relevant teams (security, legal, engineering) immediately. This proactive approach is vital for minimising the impact of any potential data incident.

Incident Response & CERT-In Reporting:

Despite best efforts, data breaches can occur. Have a clear, well-rehearsed incident response plan that specifically addresses DPDP requirements. This includes prompt notification to affected Data Principals and, where applicable, reporting to the Indian Computer Emergency Response Team (CERT-In) as per their directions. The DPDP Act also mandates reporting certain breaches to the Data Protection Board of India.

Cost and Implementation Considerations for Indian Businesses

Integrating DPDP compliance adds an overhead, but it's an investment in trust and legal security. The costs are primarily in engineering effort, legal consultation, and potentially specialised tools.

  • Engineering Effort: Implementing PII masking, consent flows, data principal rights APIs, and robust logging requires significant development time. For organisations building complex AI development services, this should be factored into project timelines and budgets from the outset.
  • Legal & Compliance Review: Regular consultation with legal experts familiar with the DPDP Act is non-negotiable to ensure your architectural decisions align with the latest interpretations and rules from MeitY.
  • Tools & Infrastructure: You might need to invest in privacy-enhancing technologies (PETs), secure data storage solutions, and advanced monitoring tools. While open-source options exist for PII masking (like spaCy or custom regex), enterprise-grade solutions offer greater accuracy and maintainability.
  • Opportunity Cost: The cost of non-compliance far outweighs the investment in compliance. Penalties under DPDP can range up to ₹250 crore for significant breaches, not to mention reputational damage.

For Indian start-ups and MSMEs with limited in-house resources, partnering with an experienced external team like Krapton can be a cost-effective way to ensure your AI systems are built with DPDP compliance embedded. This allows you to leverage expert knowledge without the steep learning curve or the need to hire a full-time, specialised compliance engineering team.

FAQ

What is the penalty for DPDP non-compliance in AI?

Penalties under the DPDP Act vary based on the nature and severity of the breach, ranging from fines up to ₹50 crore for failure to implement reasonable security safeguards, to ₹250 crore for significant breaches involving personal data. These fines are imposed by the Data Protection Board of India.

How does DPDP affect AI models trained on public data?

If the public data contains personal data, even if publicly available, consent is still generally required for processing. The DPDP Act does provide certain 'legitimate uses' where consent may not be needed (e.g., for specified legal purposes), but this is a narrow exception. Most AI models trained on public personal data for commercial use will require compliance.

Can I use open-source LLMs under DPDP?

Yes, you can use open-source LLMs. However, the choice of model doesn't negate your responsibilities as a Data Fiduciary. You must still ensure that any personal data processed by the LLM (e.g., in RAG inputs, prompts, or outputs) adheres to DPDP principles, including consent, data minimisation, and security measures. The data you feed it and how you manage its outputs are key.

Is consent always required for AI processing under DPDP?

While consent is the primary basis for processing personal data, the DPDP Act includes certain "legitimate uses" where processing is permitted without consent. These include processing for employment purposes, specified public interest, or for legal obligations. However, for most commercial AI applications, especially those directly interacting with consumers, explicit consent remains the safest and most common legal basis.

Build a Production-Ready, DPDP Compliant AI System with Krapton

Navigating the complexities of the DPDP Act while building innovative AI solutions can be challenging. Krapton Engineering specialises in architecting and deploying secure, compliant AI systems for Indian and international businesses. Whether you're developing a new RAG system, an AI agent, or integrating LLMs into existing applications, our team ensures your architecture is robust, efficient, and fully aligned with India's data protection regulations. Don't let compliance be an afterthought – share your project brief with Krapton and build an AI system you can trust.

About the author

Krapton Engineering brings over a decade of experience in building scalable web, mobile, and AI solutions for diverse Indian and global clients. Our team of principal-level software engineers and AI strategists has hands-on expertise in architecting production-grade LLM applications, RAG systems, and AI agents, with a deep understanding of data privacy regulations like India's DPDP Act.

  • ai development
  • llm apps
  • rag
  • ai agents
  • dpdp
  • data privacy
  • india
  • compliance
  • production ai
  • secure ai
  • data fiduciary
  • india stack

Your next step

Building something in India? Let’s talk.

Tell Krapton what you want to build and get a clearly scoped plan, team and starting point.

Send a project brief