Overview
The@grantex/dpdp package provides a compliance layer on top of the Grantex authorization protocol. It adds structured consent records, purpose enforcement, data principal rights management, grievance tracking, and audit-ready exports — mapping directly to India’s DPDP Act 2023, the EU’s GDPR, and the EU AI Act.
The key insight: authorization is compliance. Every Grantex grant already captures who authorized what agent to do what. The DPDP module adds the regulatory metadata — purpose descriptions, retention periods, consent notices, withdrawal mechanisms, and framework-specific export formats — that transforms authorization records into compliance evidence.
The DPDP compliance module works alongside your existing Grantex setup. It does not replace the core SDK — it extends it with compliance-specific features.
Installation
DPDPConsentRecord Schema
Every consent created through the DPDP module produces aDPDPConsentRecord:
Purpose Object
ConsentNotice Object
Consent Lifecycle
- Created:
dpdp.createConsentRecord()creates the consent record and the underlying Grantex grant. The consent notice is stored and the data principal receives the withdrawal URL. - Active: The agent operates with the granted scopes. All actions are logged in the audit trail linked to this consent.
- Withdrawn: Your authenticated application calls the withdrawal API or SDK method. The grant is revoked, delegated grants are cascade-revoked, and the withdrawal is logged. No separate DPDP end-user portal is included.
- Expired: The retention period lapses. Grantex auto-expires the consent and revokes the grant. Processing history is retained for audit purposes.
Creating Consent Records
TypeScript
Python
Purpose Enforcement
The DPDP module enforces purpose limitation at two levels:1. Grant Token Scopes
When a consent record is created, the underlying grant token’sscp claim contains only the scopes from the declared purposes. The agent cannot request or use scopes that were not declared in the consent.
2. Purpose Audit
Every token verification logs the scope that was checked. The compliance dashboard shows whether agents are staying within their declared purposes. If an agent attempts to access a scope not in its consent record, the access is denied and the attempt is logged as a potential violation.Data Principal Rights
Viewing Consents
Your application can retrieve a data principal’s active consents through the authenticated API or SDK and render its own end-user experience:Withdrawing Consent
Exporting Data
Filing Grievances
Grievance Mechanism
The DPDP module includes a full grievance tracking system:Export Types
The DPDP module supports three export frameworks:DPDP Audit Export
GDPR Article 15 Export
EU AI Act Conformance Report
SDK Quick Start
1. Install and configure
2. Create a consent record
3. Verify purpose adherence
4. Handle withdrawal
5. Export for audit
API Reference Summary
Configuration Options
Related Resources
- DPDP Act 2023 Compliance — detailed DPDP section mapping
- EU AI Act Compliance — EU AI Act article mapping
- Compliance Matrix — cross-framework compliance mapping
- Principal Sessions — authenticated links for the core agent-permission dashboard; not a DPDP rights portal
- Blog: DPDP Act and AI Agents — what engineering teams need to know