Singapore PDPA & MAS TRM AI Schema Linter
Audit your JSON API payloads, SQL database schemas, and AI prompts for statutory Singapore PDPA violations, unmasked NRIC/FIN numbers, and cross-border transfer risks. Get drop-in remediation code in seconds.
Paste Schema, API Payload, or SQL DDL
● STATUTORY PARSER ACTIVEEvaluates payload against Singapore PDPA Section 24 (Protection), Section 26 (Cross-Border Transfer), and MAS TRM § 8.
Singapore Statutory Audit Results
Automated mathematical checksum validation and regulatory risk classification.
Trigger: Identifier "S9212345J" (NRIC Pattern)
Remediation: Replace with SHA-256 + secret salt hash or use Singpass National Digital Identity (NDI) OIDC tokenization. Never transmit or store raw NRIC.
Trigger: Mobile string "+65 9123 4567"
Remediation: Mask middle 4 digits (+65 9*** *123) for display or encrypt at rest using AES-GCM.
Trigger: Data destination endpoint routes to non-Singapore domiciled cloud without Standard Contractual Clauses (SCC).
Remediation: Route telemetry and LLM payloads exclusively through Singapore-domiciled sovereign gateways or bind overseas processors to comparable PDPA standards.
Statutory Remediation Code Generator
● DROP-IN REPLACEMENTCopy-pasteable sanitizers and database triggers to support PDPA technical hygiene.
# ==============================================================================
# GDI Solutions — Singapore Statutory PDPA & MAS TRM Sanitization Middleware
# Compliance: PDPA Sections 24 & 26 (Protection & Transfer Limitation)
# Target Framework: FastAPI / Pydantic v2
# ==============================================================================
import re
import hashlib
import hmac
import os
from typing import Optional
from pydantic import BaseModel, Field, field_validator
NRIC_PEPPER = os.getenv("NRIC_PEPPER_SECRET", "gdi-default-secure-pepper-2026").encode()
NRIC_REGEX = re.compile(r"^[STFGM]\d{7}[A-Z]$", re.IGNORECASE)
SG_MOBILE_REGEX = re.compile(r"^(?:\+65|65)?[89]\d{7}$")
def hash_nric_statutory(nric: str) -> str:
"""Hashes Singapore NRIC/FIN with HMAC-SHA256 for PDPA statutory compliance."""
clean = nric.strip().upper()
return hmac.new(NRIC_PEPPER, clean.encode(), hashlib.sha256).hexdigest()
def mask_sg_mobile(mobile: str) -> str:
"""Masks Singapore mobile numbers to comply with PDPA Protection Obligation."""
digits = re.sub(r"\D", "", mobile)
if digits.startswith("65"):
digits = digits[2:]
if len(digits) == 8:
return f"+65 {digits[0]}*** *{digits[-3:]}"
return "+65 **** ****"
class CompliantCustomerPayload(BaseModel):
# Tokenized or anonymized internal ID
customer_token: str = Field(..., description="Opaque UUID or capability token")
# Raw NRIC is intercepted and converted to deterministic hash
nric_hash: str = Field(..., description="HMAC-SHA256 hashed NRIC/FIN")
# Display-safe masked mobile
masked_mobile: str = Field(..., description="Masked phone number")
# Statutory PDPA Consent Audit
pdpa_consent_granted: bool = Field(True, description="Explicit opt-in")
consent_timestamp: str = Field(..., description="ISO 8601 UTC timestamp")
data_residency_jurisdiction: str = Field("SG", description="Singapore ap-southeast-1")
@field_validator("nric_hash", mode="before")
@classmethod
def sanitize_nric(cls, v: str) -> str:
if NRIC_REGEX.match(v):
return hash_nric_statutory(v)
return v
Request Full Codebase PDPA & MAS TRM Review
GDI conducts comprehensive source-code, database, and infrastructure security & privacy configuration reviews for Singapore enterprises.
This linter executes 100% locally in your browser. No code, schemas, or personal data are uploaded or logged to any server. This tool provides engineering compliance analysis, not legal advice.
About this tool
Singapore PDPA & Enterprise AI Compliance FAQ
What are the statutory rules for collecting NRIC / FIN numbers in Singapore?
Under the Personal Data Protection Commission (PDPC) Advisory Guidelines on Key Concepts, organizations are prohibited from collecting, using, or disclosing NRIC numbers unless required by law or necessary to accurately establish identity to a high degree of fidelity. In almost all software applications, businesses must use Singpass OIDC, tokenized capability IDs, or salted SHA-256 hashes instead.
What is the PDPA Section 26 Transfer Limitation Obligation?
Section 26 prohibits transferring personal data out of Singapore unless the recipient organization is bound by legally enforceable obligations (such as Standard Contractual Clauses) providing a standard of protection comparable to the PDPA. Passing unmasked customer data or proprietary documents into US-domiciled LLM cloud endpoints without explicit data protection agreements creates immediate statutory liability.
What financial penalties apply for PDPA data breaches in Singapore?
For organizations with annual local turnover exceeding S$10 million, financial penalties can reach up to 10% of annual turnover in Singapore, or up to S$1 million, whichever is higher, in addition to mandatory public breach notifications under the Data Breach Notification (DBN) obligation.
How does GDI solve compliance for private enterprise AI?
GDI designs and deploys sovereign on-premises or private-cloud AI clusters (open-weights models on local GPU hardware) equipped with automated FastAPI NRIC/FIN redaction proxies. so prompts and identifiers can stay in Singapore, which reduces cross-border transfer exposure under PDPA Section 26 and MAS TRM cloud hygiene mandates by design.
Need an audit of your entire production codebase?
Or WhatsApp +65 8714 1149 · or
A written reply, usually within one business day.
