GDPR PII Access Architecture
When a letting agent needs to check a tenant identity document — like a passport — RAIA (Real estate Artificial Intelligence Agent) does not show it by default. You have to say why you need to see it, we log that reason, then show you the docum
When a letting agent needs to check a tenant identity document — like a passport — RAIA (Real estate Artificial Intelligence Agent) does not show it by default. You have to say why you need to see it, we log that reason, then show you the docum
GDPR PII Access Architecture
When a letting agent needs to check a tenant identity document, RAIA (Real estate Artificial Intelligence Agent) does not show it by default. You must state your reason, we log it, then show the document for 15 minutes before it auto-disappears — protecting privacy and maintaining an audit trail.
When a letting agent needs to check a tenant identity document — like a passport — RAIA (Real estate Artificial Intelligence Agent) does not show it by default. You have to say why you need to see it, we log that reason, then show you the document for 15 minutes before it disappears. This protects tenant privacy and means we always have a record of who looked at what and why.
GDPR PII Access Architecture
Justified access on demand, session-scoped PII retrieval, append-only access audit log, legacy GCS migration path, Sumsub integration, and modular jurisdiction retention design.
TL;DR. Legacy CRMs expose passport scans to every credentialed user with no logging. RAIA's architecture shows only compliance status in the default UI. Identity documents live in a private GCS bucket. Access requires a justified purpose, creates an immutable log entry, and grants a 15-minute scoped signed URL — never a download. Every access is auditable for DSAR responses and ICO enquiries.
Chapter 1 Why — The GDPR Reality
What Legacy CRMs Do (and Why It's Wrong)
Research conducted June 2026 across five major proptech platforms — Goodlord, RentProfile, HomeLet, Canopy, and Arthur Online — reveals a systematic GDPR compliance gap:
- All platforms store passport scans & referencing reports accessible to any credentialed user in the default portal UI
- None implement per-record PII access logging publicly
- Arthur Online: all users with account access can see all documents — zero RBAC on document sensitivity
- Canopy explicitly acknowledges biometric data (Article 9 special category) — only platform to do so; none act on it
- None implement "access on request only" gating
- No specific ICO enforcement yet against proptech — but trajectory is clear
- Advanced Computer Software — £1.48M fine (2024) for inadequate access controls
- CNIL €120K fine for no defined retention periods
- ICO DSAR enforcement focus intensifying 2024–2026
- When enforcement arrives in proptech, unprepared platforms will pay significant fines
ICO Position on Right to Rent Documents
- Minimum retention: 1 year post-tenancy end (not start) — per Home Office + ICO combined guidance
- Biometric selfies from IDVT liveness checks = Article 9 special category data — hold only for duration of check, then retain outcome only
- Storage limitation principle: Automated deletion triggers are legally required, not optional
- Data minimisation: The compliance status (pass/fail + date) is all that needs to be visible in the default UI — not the document itself
The key insight. You don't need to show a passport scan to prove a check passed. The outcome is the operationally relevant fact. The document is only needed in two scenarios: (1) a compliance audit, (2) identity verification at a physical touchpoint (viewing, video call). Both are rare, both are justifiable, neither requires the document to be visible in the normal workflow.
Red Team: Should We Hold Documents Ourselves?
The question was put to the red team: should RAIA (Real estate Artificial Intelligence Agent) hold documents in its own GCS with systematic GDPR enforcement rather than relying on on-demand retrieval from Sumsub/RentProfile?
Answer: YES. Hold documents in RAIA's own GCS private bucket. Apply systematic access controls. The "on-demand from 3rd party" pattern is elegant but fragile. Here's the reasoning:
- Screenshot risk is manageable at the policy/audit layer. Any screen can be photographed. The legal protection is the audit log proving authorised access, the recorded purpose, and the user's contractual obligation. A GDPR regulator asks "did you have appropriate technical and organisational measures?" — a justified access system answers yes.
- ICO requires accountability, not perfect containment. The ICO does not require you to make data inaccessible to authorised staff — it requires appropriate access controls and accountability. GCS with RLS + access logging + justified access = appropriate controls.
- Third-party storage creates liability exposure. Sumsub or RentProfile's breach is your problem as data controller. Their closure, API changes, or rate limits could destroy your ability to fulfil legal retention obligations.
- Practical retention risk. If a 3rd party becomes unavailable, you lose access to data you have a legal obligation to retain for 1 year post-tenancy.
On the Screenshot Argument
The screenshot risk does not invalidate the access control system. GDPR compliance is about demonstrating accountability and appropriate technical/organisational measures — not achieving perfect information containment (which is impossible). The justified access system:
- Creates legal record of who accessed what, when, and why
- Deters casual browsing of sensitive data (friction has real value)
- Enables precise DSAR responses — you can tell a tenant exactly who accessed their data
- Creates disciplinary and contractual enforcement basis when misuse occurs
- Satisfies ICO Article 30 Records of Processing Activity requirement
System-Level Enforcement vs. Training
Training relies on memory, consistency, and individual discretion. It cannot guarantee compliance at the moment of access. It produces no audit trail. It cannot scale across multiple agent accounts and agencies.
The access request modal enforces justified access at the exact moment of need — no training required, no memory required, no individual discretion. This is "privacy by design" under UK GDPR Article 25 — a legal obligation, not a nice-to-have. RAIA (Real estate Artificial Intelligence Agent) should do this precisely because it differentiates from legacy systems and protects the business.
Chapter 2 How — The Architecture
Diagram 1: Three-Tier Document Access Model
Compliance Status
Always visible in default UI. Zero PII.
identity_verifiedtrue/falser2r_passedtrue/false + dateid_document_type(passport/dl/brp — metadata only)referencing_outcomepass/fail/referred
Stored in: tbl_persons + compliance_json. No access log required.
Face Portrait
Visible to ops users in normal workflow.
- Cropped face image only — no document, no number, no DOB
- Purpose: identity confirmation on viewings and video calls
- No access log required (face already known at viewing)
Stored in: gs://rcf_public/avatar/{person_id}.jpg. Accessible via avatar_url.
Identity Documents
Justified access only. Full audit trail.
- Passport scan, driving licence, BRP, visa
- Right to Rent certificate PDF
- Referencing report PDF
- 15-minute signed URL — no download permitted
Stored in: gs://raia-gb-private/id/{person_id}/{doc_type}/{document_id}.pdf
Diagram 2: Justified Access Request Flow
Access Request Flow — Step by Step
-
1User clicks "View Identity Document" in portal
Available only to users with the correct RBAC role. Button is not rendered for roles without document access permission.
-
2Modal: select purpose from controlled vocabulary
No free-text browsing. One of 6 defined purposes must be selected. "Other" requires a written explanation — empty "other" is rejected at the API layer.
-
3System logs: user_id, person_id, document_type, purpose, timestamp, IP → tbl_pii_access_log
Append-only. Row INSERT is the only permitted DML. No UPDATE, no DELETE. Log entry is created before the signed URL is generated.
-
4Generate GCS signed URL — 15-minute expiry, scoped to single document
URL is generated via service account with minimal IAM permissions. Scoped to specific object path only — not a broad bucket grant.
-
5Document served in sandboxed iframe — no download, watermark overlay
CSP header blocks file save. Watermark SVG renders user name + timestamp + purpose over the document view. No right-click save.
-
6After 15 minutes: signed URL expires automatically, session token invalidated
GCS signed URL expiry is enforced server-side. No client-side timer required. Access is automatically closed.
-
7Second access to same document requires a new request (new log entry)
There is no "keep open" state. Each access creates a fresh audit trail entry. Frequency of access is therefore fully auditable.
Access Purpose Controlled Vocabulary
The tbl_pii_access_log Schema
CREATE TABLE tbl_pii_access_log ( log_id UUID PRIMARY KEY DEFAULT gen_random_uuid(), organisation_id UUID NOT NULL, requested_by UUID NOT NULL REFERENCES auth.users(id), person_id UUID NOT NULL, document_id UUID REFERENCES tbl_documents(document_id), document_type TEXT NOT NULL, access_purpose TEXT NOT NULL CHECK (access_purpose IN ( 'viewing_verification', 'video_call_verification', 'arrears_enforcement', 'compliance_audit', 'right_to_rent_recheck', 'other' )), access_purpose_detail TEXT, -- required when purpose = 'other' ip_address INET, user_agent TEXT, signed_url_expires_at TIMESTAMPTZ NOT NULL, accessed_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); -- RLS policies: -- INSERT: allowed for authenticated org members (creates access record) -- UPDATE: DENIED — no modification of access records permitted -- DELETE: DENIED — deleting access log = GDPR audit trail breach -- SELECT: scoped to organisation_id = requesting user's org -- DSAR support: SELECT * WHERE person_id = $tenant_id -- returns complete access history for any data subject access request -- CHECK constraint: 'other' requires access_purpose_detail IS NOT NULL -- (enforced at API layer — empty 'other' defeats the audit trail)
Diagram 3: Document Lifecycle
Document Storage Path Convention
- Legacy (existing ~189 docs):
gs://raia-gb-private/{original_path}— grandfathered in, no migration needed immediately - New standard path:
gs://raia-gb-private/id/{person_id}/{document_type}/{document_id}.{ext} - Sumsub documents: Fetched live via Sumsub API using
applicant_id— never stored in RAIA (Real estate Artificial Intelligence Agent) GCS during onboarding - RentProfile reports: Download to standard path on first access (lazy migration)
Legacy GCS Migration Strategy — Lazy Migration
No bulk refile operation is required for the existing ~189 documents. Migration is on-demand:
-
1First access via justified access system
Document is accessed via signed URL from its existing legacy path. No disruption to existing records.
-
2Background job: rename to standard path convention
Rename to
{person_id}/{doc_type}/{doc_iRepository Code
The live codebase implementation for this specification sits within the following repository folder:
Single column update — no cascade required.
After confirming tbl_documents row points to new path. Old path is no longer referenced.
Modular Jurisdiction Retention Policy
Document retention periods are jurisdiction-specific. RAIA (Real estate Artificial Intelligence Agent) implements a tbl_pii_retention_policy table to define per-jurisdiction rules:
Diagram 4: Sumsub vs Legacy Document Source
- Documents already in
gs://raia-gb-private/ - Served via signed URL from RAIA's own store
- Lazy migration to standard path on first access
- Automated deletion at retention period end
- Identity verification outcome stored in
tbl_persons sumsub_applicant_idstored for later retrieval- Documents fetched live from Sumsub API on justified access request
- At tenancy end: download verification report to RAIA (Real estate Artificial Intelligence Agent) GCS for retention period, then delete at expiry
Chapter 3 What — Implementation Plan
- Migration: create
tbl_pii_access_log— schema as defined above. RLS: INSERT for org members, no UPDATE/DELETE, SELECT scoped to org. - Migration: create
tbl_pii_retention_policy— columns:jurisdiction_code,document_type,retention_days_after_tenancy_end,legal_basis,notes. Seed with GB values. - Migration: add
is_test_recordBOOLEAN DEFAULT FALSE +test_record_noteTEXT totbl_personsandtbl_tenancies. DONE 2026-06-03 - RLS on
tbl_pii_access_log: INSERT allowed for authenticated org members. No UPDATE policy. No DELETE policy. - All compliance reports: add
WHERE is_test_record = FALSEfilter to every query touchingtbl_personsandtbl_tenancies.
- GCS signed URL generator — Next.js API route
/api/pii/request-access(POST). Validates purpose, writes log entry, generates signed URL, returns to client. - Access request modal component —
PurposeSelector→ confirm → fetch signed URL → render sandboxed viewer. Blocks proceed until purpose selected. "Other" requires text field > 20 chars. - Watermark overlay component (React) — renders user name + timestamp + purpose as SVG over the document iframe. Cannot be removed by user.
tbl_pii_access_logwrite on every access — write occurs server-side, before URL generation. Client cannot bypass.- Admin view: access log per person — data table showing all access events for a given person_id. DSAR-ready export to CSV.
- Nightly cron — find documents where
tenancy_end + retention_days < today→ delete from GCS → soft-deletetbl_documentsrow → log deletion event intbl_pii_access_log(purpose:compliance_audit, detail: "automated_retention_delete"). - Sumsub end-of-tenancy download job — triggered on tenancy status change to "ended". Downloads verification report from Sumsub API to
gs://raia-gb-private/id/{person_id}/sumsub_report/{applicant_id}.pdf. - Jurisdiction policy editor in admin UI — allows non-technical ops to configure retention periods per jurisdiction once legal review is complete for TH, MY, VN.
Chapter 4 Test Record Management — Red Team Design
The problem with test records in production systems. Every system that handles real data eventually acquires synthetic test records — demos, protocol tests, sandbox tenancies. Without a systematic tagging and exclusion pattern: test records appear in compliance reports inflating gaps, test persons receive operational outreach, test records contaminate financial reporting, and scrubbing before data export becomes manual and error-prone.
The RAIA (Real estate Artificial Intelligence Agent) Test Record Pattern
is_test_record BOOLEAN DEFAULT FALSEontbl_personsANDtbl_tenanciestest_record_note TEXT— who created it, when, why, expected deletion date- Partial index:
CREATE INDEX WHERE is_test_record = TRUE(tiny, fast, doesn't slow production queries) - Scrub:
DELETE FROM tbl_persons WHERE is_test_record = TRUE— hard delete, safe, these are synthetic
- All operational reports:
WHERE is_test_record = FALSE - All compliance pages: exclude
is_test_record = TRUE - RBAC audits: exclude guarantors on test tenancies (they are also test entities)
- Convention:
source = 'a2a_test' | 'sandbox_demo' | 'load_test' | 'manual_test' - Never soft-delete test records — hard delete is appropriate for synthetic data
Current Tagged Test Records (as of 2026-06-03)
- Alice (A2A Tenant) Sovereign Agent —
person_id: 8f7f0bbe-… - Tenancies:
T-A2A-2026130257andT-A2A-2026164025 - Both
tbl_personsandtbl_tenanciesrows taggedis_test_record = TRUE
Future Test Record Creation SOP
-
1Use T-TEST-, T-A2A-, or T-DEMO- tenancy_ref prefix
Never use the real
TN-prefix. This allows grep-based identification independently of the boolean flag. -
2Set is_test_record = TRUE and test_record_note at creation time
Never tag retroactively — by the time someone notices, the record may have already appeared in reports.
-
3Use @test.raia.internal email domain and synthetic phone numbers
Never use real contact details.
test.raia.internalis non-routable — emails cannot be accidentally delivered. -
4Document in test_record_note: creator, date, purpose, expected deletion date
Enables safe scrubbing without needing to investigate each record individually.
Pitfalls
Sumsub documents must only be downloaded to RAIA (Real estate Artificial Intelligence Agent) GCS at tenancy end for ICO retention compliance. Storing them during onboarding creates redundant copies, increases liability surface, and violates data minimisation principle. Store the outcome only; fetch the document on demand.
A deleted access log entry is a GDPR audit trail breach. The RLS policy must explicitly deny DELETE for all roles including admin. If ICO investigates an incident and access log entries are missing, this is considered evidence of attempted concealment. The append-only nature of the log is its legal value.
Never generate a broad bucket read grant. Each signed URL must be scoped to the specific object_name of the requested document. Where possible, bind to requester IP address. A URL leaked from an authorised session must not be usable from another IP.
Empty other entries defeat the audit trail entirely. Enforce at the API layer: if access_purpose = 'other' and access_purpose_detail is NULL or blank, reject the request with HTTP 422. A minimum character count (e.g. 20 chars) prevents trivial bypass.
Guarantors on test tenancies are also test entities. The WHERE is_test_record = FALSE filter must be applied to all role membership queries, not just the top-level tenancy query. Join traversal can bring test entities into production reports if the filter is only applied at the tenancy level.
Tier 1 avatar is a cropped face JPEG already stored in gs://rcf_public — publicly accessible, no access log required. The passport scan is a Tier 2 identity document in gs://raia-gb-private — requires justified access. Do not confuse these in UI copy, permissions, or documentation. Conflating them either over-protects (blocking legitimate face display) or under-protects (exposing passport data without access controls).
End date = vacated_date OR end_date, whichever is later. A tenancy that was supposed to end on the contractual end date but the tenant stayed on requires using the actual vacated date. Using tenancy start date as the baseline produces systematically short retention periods and ICO non-compliance.
Biometric data from IDVT liveness checks = Article 9 special category data. Requires: (a) explicit consent as legal basis, (b) higher security obligations than standard identity data, (c) shorter retention than standard identity documents — retain outcome only, delete biometric input after check completion. Canopy is currently the only proptech platform to acknowledge this publicly. RAIA (Real estate Artificial Intelligence Agent) must handle this correctly from the start.
File References
03_technology/11_frontend/Related Documentation
Architecture Details
Compliance architecture implements a rule-based enforcement engine with automated audit trails, document generation, and evidence collection. The system tracks regulatory requirements across multiple jurisdictions (UK, Thailand) and automates compliance checks throughout the tenancy lifecycle.
- Core Component: Compliance engine and audit trail system
- Data Flow: Event → Rule Evaluation → Compliance Check → Document Generation → Evidence Storage → Audit Log
- Integration Points: Document templates, jurisdiction rules, evidence store, audit log
Configuration Reference
Key configuration parameters for this system:
| Parameter | Type | Default | Description |
|---|---|---|---|
| jurisdiction | string | uk-england | Applicable jurisdiction for compliance rules |
| auto_evidence | boolean | true | Enable automatic evidence collection |
| retention_years | integer | 6 | Compliance record retention period |
Figure 2: Compliance architecture — component interaction and data flow.
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| Rule mismatch by jurisdiction | Incorrect jurisdiction configuration | Verify jurisdiction code matches the tenant's location |
| Missing evidence artifact | Automated collection not triggered | Check auto_evidence setting and retry collection |
This component is part of the RAIA (Real estate Artificial Intelligence Agent) platform mono-repo. Implementation details, API contracts, and integration tests are available in the repository.