Skip to main content

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 a DPDPConsentRecord:

Purpose Object

ConsentNotice Object

  1. 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.
  2. Active: The agent operates with the granted scopes. All actions are logged in the audit trail linked to this consent.
  3. 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.
  4. Expired: The retention period lapses. Grantex auto-expires the consent and revokes the grant. Processing history is retained for audit purposes.

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’s scp 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:

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

Includes: consent records, consent notices, withdrawal log, grievance log, retention compliance status, cross-border transfer declarations.

GDPR Article 15 Export

Includes: processing purposes and legal basis, categories of data, recipients and third parties, retention periods, delegation chains, automated decision-making disclosure.

EU AI Act Conformance Report

Includes: risk management controls (Art. 9), transparency evidence (Art. 13), human oversight mechanisms (Art. 14), quality management documentation (Art. 17), deployer obligation checklist (Art. 26).

SDK Quick Start

1. Install and configure

3. Verify purpose adherence

4. Handle withdrawal

5. Export for audit

API Reference Summary

Configuration Options

Last modified on July 11, 2026