Skip to main content

PIPL Data Localization

Compliance & Security

PIPL Data Localization

The Personal Information Protection Law (PIPL) of the People’s Republic of China took effect on November 1, 2021, and is the foundational law for personal information protection in China. Together with the Cybersecurity Law and the Data Security Law, PIPL forms China’s data governance legal framework. Violators can be fined up to RMB 50 million or 5% of the prior year’s turnover, and may have their business license revoked.

For the power and energy industry, as the power grid is critical information infrastructure, the electricity consumption behavior data, user identity information, and device location information collected by grid operators are all subject to PIPL. EnerOS supports grid operators in meeting PIPL requirements through regionalized deployment, data residency strategies, and personal information protection impact assessment capabilities.

PIPL consists of eight chapters and 74 articles. Key points include:

ChapterTopicKey Requirements
Chapter 1General ProvisionsScope of application, basic principles
Chapter 2Personal Information Processing RulesProcessing basis, notice and consent
Chapter 3Automated ProcessingAutomated decision-making rules
Chapter 4Cross-border Provision of Personal InformationSecurity assessment, certification, standard contracts
Chapter 5Obligations of Personal Information ProcessorsSecurity protection, risk assessment
Chapter 6Supervision and AdministrationRegulatory authorities, investigation powers
Chapter 7Legal LiabilityAdministrative penalties, civil compensation
Chapter 8Supplementary ProvisionsDefinitions, effective date

Personal Information Definition

PIPL classifies personal information into two categories:

CategoryDefinitionPower Scenario Example
Personal informationVarious information related to identified or identifiable natural persons recorded electronically or otherwiseUser name, meter ID, address, electricity consumption
Sensitive personal informationPersonal information that, once leaked or illegally used, may harm the dignity or personal/property safety of a natural personBiometrics, medical health, financial accounts, information of children under 14

Note: Household-level electricity consumption behavior data may be classified as sensitive personal information (as it can infer family routines, whether at home, etc.), and separate consent must be obtained when processing.

Core Requirements and Implementation

PIPL ArticleRequirementEnerOS Implementation
Article 13Lawful basis for processingLawful basis field annotation
Article 14Consent must be voluntary and explicitSeparate consent flow + consent records
Article 17Notification obligationNotification API + multilingual templates
Article 22Entrusted processingProcessor agreement records + permission delegation
Article 23Provision to third partiesThird-party sharing logs + separate consent
Article 24Automated decision-makingDecision explanation + right to refuse automation
Article 25Public disclosurePublic disclosure approval + separate consent
Article 26Image collection in public placesProminent signage + data minimization
Articles 28-32Sensitive information processingSeparate consent + encryption + assessment
Article 38Cross-border transfer requires security assessmentregion tag + cross-region policy denial
Article 39Separate consent for cross-borderCross-border consent records + explicit notice
Article 40Critical information infrastructure localizationRegion-independent cluster + local CA
Articles 44-50Personal rightsDSR API (localized)
Article 51Security protection measuresEncryption + WORM + access control
Article 52Personal information protection officerOfficer appointment records
Article 54Compliance auditAnnual compliance audit tool
Article 55Personal information protection impact assessmentPIA template export
Article 56Processing record retentionProcessing records 3-year retention

Personal Information Processing Rules

Lawful Basis

Article 13 of PIPL stipulates seven lawful bases, each of which must be explicitly declared in EnerOS:

[data_flow.legal_basis]
allowed_values = [
    "consent",                  # Obtain individual consent
    "contract-performance",     # Necessary for concluding or performing a contract
    "legal-duty",              # Perform statutory duties or obligations
    "public-health-emergency", # Respond to public health emergencies
    "news-reporting",          # News reporting
    "public-interest",         # Public interest as stipulated by law
    "other-law"                # Other circumstances stipulated by law
]
use eneros_privacy::consent::{ConsentRequest, ConsentScope};

let request = ConsentRequest::builder()
    .subject_id("user-12345")
    .purpose("Electricity consumption behavior analysis and load forecasting")
    .scope(ConsentScope::Sensitive)
    .legal_basis("consent")
    .retention_days(365 * 7)
    .withdraw_url("/consent/withdraw/user-12345")
    .language("zh-CN")
    .notice_text("To provide load forecasting service, we need to collect your electricity consumption data...")
    .build()?;

// Record consent status
let consent = request.execute().await?;
assert!(consent.is_granted());
assert_eq!(consent.scope(), ConsentScope::Sensitive);

Cross-border Transfer

Articles 38-40 of PIPL impose strict requirements on cross-border transfer of personal information:

ScenarioRequirementEnerOS Implementation
Ordinary cross-border transferSecurity assessment / certification / standard contractCross-border approval workflow
Critical information infrastructureData in principle stored domesticallyRegion-independent cluster
Processing reaching 1 million peopleMust declare security assessment to CACCross-border volume statistics alerts
Sensitive information cross-borderSeparate consent + security assessmentDual approval process

Cross-border Policy Engine

use eneros_trust::region::{RegionPolicy, CrossBorderRequest};

let policy = RegionPolicy::new()
    .source_region("cn-east-1")
    .default_action("deny");

let request = CrossBorderRequest::builder()
    .source("cn-east-1")
    .destination("eu-west-1")
    .data_category("pii")
    .legal_basis("consent")
    .has_security_assessment(false)
    .build()?;

// Deny cross-border by default
let decision = policy.evaluate(&request).await?;
assert_eq!(decision.action, "deny");
assert_eq!(decision.reason, "Security assessment not passed");

EnerOS Compliance Implementation

1. Region-Independent Cluster Deployment

To meet the data localization requirements for critical information infrastructure operators, EnerOS recommends deploying independent clusters within China:

[deployment]
region = "cn-east-1"
country = "CN"
data_residency = "strict"            # Strict data residency
cross_border_policy = "deny-by-default"
sovereign_cloud = true               # Sovereign cloud mode

[deployment.localization]
database_in_region = true            # Database domestic
storage_in_region = true             # Object storage domestic
ca_in_region = true                  # CA domestic independent
key_in_region = true                 # Keys domestic escrow

[deployment.approvals]
cross_border_approver = "cip-officer@grid.cn"
security_assessment_required = true

2. Data Classification and Tagging

PIPL requires data processors to classify personal information. EnerOS implements this through field tagging:

[data.classification]
standard = "pipl"
enabled = true

[[data.fields]]
name = "customer_name"
pii = true
category = "general-identifier"      # General personal information
encryption = "AES-256-GCM"
retention_days = 2555

[[data.fields]]
name = "id_card_number"
pii = true
category = "sensitive"               # Sensitive personal information
encryption = "AES-256-GCM"
access_log = true                    # Access trail
separate_consent = true              # Separate consent

[[data.fields]]
name = "consumption_pattern"
pii = true
category = "sensitive"               # Electricity consumption may infer routines
encryption = "AES-256-GCM"
pseudonymization = true              # Pseudonymization

[[data.fields]]
name = "voltage_kv"
pii = false
category = "operational"
retention_days = 3650

3. Personal Information Protection Impact Assessment (PIA)

Articles 55-56 of PIPL require conducting personal information protection impact assessments in specific circumstances:

# Generate PIA assessment template
eneros-cli pia init --project "Smart Meter Data Collection Project" \
  --output pia-smart-meter-2026.md

# Auto-fill processing activity information
eneros-cli pia autofill --input pia-smart-meter-2026.md \
  --data-flow smart-meter-collection

# Submit for review
eneros-cli pia submit --input pia-smart-meter-2026.md \
  --reviewer cip-officer@grid.cn

# Export assessment report
eneros-cli pia export --id pia-2026-001 \
  --format pdf --output pia-2026-001.pdf

PIA assessments must be archived for at least 3 years (Article 56 requirement).

Data Classification

EnerOS classifies data into four levels per PIPL requirements:

LevelCategoryExampleProtection MeasuresCross-border Policy
L1General personal informationName, phone, meter IDEncryption + access controlAllowed after security assessment
L2Sensitive personal informationID card number, biometrics, electricity consumption behaviorEncryption + separate consent + access trailIn principle domestic
L3Critical information infrastructure dataGrid dispatch data, device locationEncryption + WORM + domestic clusterIn principle domestic
L4National secret relatedElectricity consumption data of classified unitsEncryption + dedicated network isolation + physical protectionCross-border prohibited

Configuration Example

Complete PIPL Configuration in eneros.toml

[compliance]
standard = "pipl"
version = "2021"
enforce = true
protection_officer = "pip-officer@grid.cn"

[pipl]
enabled = true
data_residency = "strict"
cross_border_policy = "deny-by-default"
breach_notification_hours = 24        # Immediately report to CAC
default_retention_years = 7

# Personal information processor obligations
[pipl.obligations]
appoint_protection_officer = true     # Appoint data protection officer
conduct_annual_audit = true           # Annual compliance audit
security_protection_measures = true
training_required = true              # Employee training

# Consent management
[pipl.consent]
default_scope = "explicit"            # Explicit consent
separate_consent_for_sensitive = true # Separate consent for sensitive information
withdraw_mechanism = true             # Consent withdrawal mechanism
withdraw_url = "/consent/withdraw"

# Data subject rights
[pipl.rights]
response_days = 15                    # PIPL requires 15 business days
extension_days = 30
notice_language = "zh-CN"
channels = ["web", "mobile", "offline"]

# Cross-border transfer
[pipl.cross_border]
default_policy = "deny"
security_assessment_required = true
standard_contract_required = true
separate_consent_required = true
cac_notification_threshold = 1000000  # 1 million people threshold

# Data retention
[pipl.retention]
default_days = 2555                   # 7 years
sensitive_days = 1825                 # 5 years for sensitive information
auto_delete = true
notify_before_days = 30

# Processing records
[pipl.processing_records]
auto_generate = true
retain_years = 3                      # Article 56 requires at least 3 years
storage = "worm"

Rust Code: Compliance Check

use eneros_compliance::pipl::ComplianceChecker;

let checker = ComplianceChecker::new("eneros.toml")?;
let report = checker.check().await?;

for finding in &report.findings {
    match finding.severity {
        Severity::Critical => println!("Critical: {}", finding.description),
        Severity::High => println!("High: {}", finding.description),
        Severity::Medium => println!("Medium: {}", finding.description),
        Severity::Low => println!("Low: {}", finding.description),
    }
}

println!("Compliance score: {}/100", report.score);

Region Residency Configuration

[region]
id = "cn-east-1"
country = "CN"
data_residency = "strict"   # Reject any cross-border plaintext transmission
cross_border_policy = "deny-by-default"

[region.sovereign]
enabled = true
local_ca = "/etc/eneros/ca-cn.crt"
local_kms = "kms://cn-east-1"
local_dns = ".grid.cn"
// Cross-region access is denied by default by the policy engine
policy.deny(
    Subject::region("cn-east-1"),
    Action::Read,
    Resource::region("eu-west-1").data("pii")).await?;

Compliance Checklist

Confirm each item before deployment:

  • Deploy an independent cn-region cluster with database and object storage located domestically
  • Cross-border transfer policy denies by default, only allowed after explicit approval
  • Appoint a personal information protection officer with public contact information
  • Personal information processing purpose, method, and scope explicitly declared in eneros.toml
  • Separate consent flow for sensitive personal information (such as electricity consumption behavior)
  • Auto-delete data when retention period expires and record audit
  • Annual personal information protection impact assessment (PIA) archived
  • Immediately remediate and report to CAC when a leak occurs or may occur
  • Processing activity records auto-generated and retained for ≥ 3 years
  • Processing of information of minors under 14 requires guardian consent
  • Automated decision-making provides explanation and opt-out channel
  • Data subject requests responded to within 15 business days
  • Entrusted processing signs agreements and records
  • Separate consent obtained before providing to third parties
  • Data localization for critical information infrastructure operators
  • Cross-border transfer reaching 1 million people must be declared to CAC
  • Employee annual training records archived
  • Privacy policy clearly expressed in Chinese