SOP-09: Agentic Tenancy Onboarding & Localized Compliance
This standard defines how RAIA (Real estate Artificial Intelligence Agent) OS spawns localized micro-agents to enforce 100% correct tenancy compliance checklist steps in different regions (UK vs. Thailand) on lease commencement.
This standard defines how RAIA (Real estate Artificial Intelligence Agent) OS spawns localized micro-agents to enforce 100% correct tenancy compliance checklist steps in different regions (UK vs. Thailand) on lease commencement.
SOP-09: Agentic Tenancy Onboarding & Localized Compliance
This standard defines how RAIA (Real estate Artificial Intelligence Agent) OS spawns localized micro-agents to enforce 100% correct tenancy compliance checklist steps in different regions — UK vs. Thailand — on lease commencement.
SOP-09: Agentic Tenancy Onboarding & Localized Compliance
This document defines the strict, zero-hallucination architectural standard for spawning localized, single-purpose micro-agents at the commencement of every tenancy. It covers the 3-Tier Rental compliance invariants under the UK Renters' Rights Act (RRA) 2026 and the specialized requirements of the Thai civil property module.
1. Architectural Philosophy: Zero-Hallucination Micro-Agents
In passive property management systems, compliance is treated as a manual checklist. Under modern, highly punitive legislation—such as the UK Renters’ Rights Act (RRA) 2026, which introduces civil penalties of up to £7,000 for minor document delivery errors—human-driven compliance represents an unacceptable point of failure.
To solve this, the RAIA™ (Real estate Artificial Intelligence Agent) Protocol enforces the Micro-Agent Spawning Pattern (Sovereign Spawning). Instead of routing diverse localized operations through a single, general-purpose conversational LLM (which is highly prone to context-drift, regional law mixing, and parameter hallucinations), the RAIA™ (Real estate Artificial Intelligence Agent) OS spawns a **strictly isolated, single-purpose, localized micro-agent process** at the initialization of every new tenancy.
An active Tenancy Micro-Agent does NOT compose freeform prose, negotiate terms, or dynamically interpret laws. It is a strictly deterministic executor of static, version-locked skill files. It reads state, verifies invariants, calls authorized API endpoints, and escalates exceptions to the **Compliance Human-in-the-Loop (HITL)**.
2. Chronological Tenancy Onboarding Workflows
The onboarding phase must trace a flawless chronological sequence across all database tables. The following workflow maps illustrate the deterministic execution loops for both the UK and Thai modules.
2.1 UK Module (RRA 2026) Onboarding Flow
[START: Tenancy Creation] ──► Write record to tbl_tenancies (status = 'draft')
│
▼
[Spawns Micro-Agent] ────────► Instantiates "raia-agent-tenancy-uk" (with v2.1-RRA skills)
│
├──► Verification 1: Confirm Land Registry Owner matches tbl_asset_ownership (Tier 1)
├──► Verification 2: Check Tenancy Agreement / Written Statement has mandatory RRA statutory clauses
└──► Verification 3: Confirm Gas Safety, EPC, and EICR links exist on-file (Tier 2)
│
▼ [Check: Invariants Passed?]
├─── No ────────────► Write data-hole flag to tbl_tenancy_audits ──► Escalate to Compliance HITL
└─── Yes
│
▼
[Execute automated bank reconciliation gateway Hook] ────► Registers Rent ledger, direct-debit mandate, and virtual account
│
▼
[Draft Tenancy Agreement] ──► Compiles uneditable written statement contract with RRA statutory terms
│
▼
[Compliance HITL Gate] ─────► Staged for approval ──► Manual sign-off by Darrel Kwong / Eugin
│
▼ [Approved]
[Deliver Compliance Pack] ──► Emails uneditable PDF pack to tenant (Tenancy Agreement, Gas Safety, EPC)
│
▼
[DPS Deposit Registration] ─► Calls DPS/MyDeposits API ──► Writes Certificate to tbl_tenancy_documents
│
▼
[ACTIVE PERIODIC STATE] ────► Writes status = 'active' to tbl_tenancies ──► Dispatches background crons
2.2 Thai Module Onboarding Flow
[START: Tenancy Creation] ──► Write record to tbl_tenancies (status = 'draft')
│
▼
[Spawns Micro-Agent] ────────► Instantiates "raia-agent-tenancy-th" (with v1.4-TH skills)
│
├──► Verification 1: Verify Chanote (Land Title Deed) is linked to tbl_asset_ownership
├──► Verification 2: Verify Juristic Office Rules & Bangkok condo guidelines are loaded
└──► Verification 3: Validate Land and Building Tax classification (Residential vs Commercial)
│
▼ [Check: Invariants Passed?]
├─── No ────────────► Raise audit-exception ──► Escalate to Juristic/Owner HITL
└─── Yes
│
▼
[VietQR / PromptPay Link] ──► Generates dynamic Baht-denominated PrompPay QR code & automated bank reconciliation gateway-Thai counterpart
│
▼
[Bilingual Lease Comp] ─────► Generates bilingual Thai/English lease contract (under Thai CCC)
│
▼
[Juristic Office Filing] ───► Registers Tenant Profile & Access passes with building management/concierge
│
▼
[ACTIVE LEASE STATE] ───────► Writes status = 'active' to tbl_tenancies ──► Engages daily water/power cron
3. Red-Team Consensus Panel (5 Virtual Models)
To ensure absolute compliance safety and eliminate loophole vulnerabilities under the Renters’ Rights Act 2026, we convened a virtual red-team panel of 5 industry-standard models. Each model analyzed the onboarding lifecycle from its specialized forensic domain.
🕵️ Model 1: Claude 3.5 Sonnet (Temporal & Procedural Auditor)
COMPLIANCE RISKThe Critique: "The transition to rolling periodic-only tenancies under the RRA removes the buffer of 'fixed-term renewals'. Any delay in document serving has immediate retroactive consequences. For new tenancies starting on or after 1 May 2026, the statutory Written Statement of Terms (fully satisfied by the written lease itself) must be served on or before the start date. For pre-existing tenancies, the transitional RRA Information Sheet 2026 must have been served by the 31 May 2026 deadline. Any delay in serving these respective documents permanently freezes possession rights under Section 8."
The Mitigation: We enforce an exact Pre-Flight Blocking Invariant. The system differentiates tenancies based on start date: if the tenancy started before 1 May 2026, it requires `document_type = 'rra_information_sheet'` (verified served by 31 May 2026). For new tenancies starting on/after 1 May 2026, the system suppresses the transitional `rra_information_sheet` check and instead requires the `document_type = 'tenancy_agreement'` (which contains the RRA statutory terms and serves as the Written Statement of Terms) to be validated on-file before transitioning to active.
⚖️ Model 2: GPT-4o (Statutory & Eviction Defense Assessor)
LEGAL RISKThe Critique: "A major loophole in automated eviction pipelines is deposit registration mismatch. Under the RRA, if the Deposit Protection Certificate (`deposit_certificate`) is not served within 30 days of receipt, or if there is a 1-pence discrepancy between the deposit protected and the amount written on the certificate, any future Section 8 notice is legally dead in court. A general-purpose AI will easily overlook a £0.01 mismatch."
The Mitigation: We implement a strict **Decimal Match Guard**. Our database schema enforces a double-entry balance check:
tbl_tenancy_deposits.amount_protected === tbl_rents.deposit_amount_agreed. The micro-agent verifies this down to the single penny via a database constraint before dispatching the deposit registration API call.
🌪️ Model 3: Gemini 1.5 Pro (Context-Drift & Orchestration Auditor)
ORCHESTRATION RISKThe Critique: "With thousands of rolling periodic leases running parallel, uncoordinated cron-jobs can cause 'non-deterministic orchestration'. For example, if a rent review notice (SOP-12) is triggered by an AI agent while a separate arrears-recovery process is in-flight, they might send overlapping, contradictory communications, destroying consumer trust and violating Renters' Rights harassment regulations."
The Mitigation: We establish the **Global Process Mutex (Locking)**. A tenancy-level mutex is written to the database. Before any micro-agent is spawned to execute an operation (e.g. rent review, arrears notice), it must acquire the transactional lock: `SELECT pg_try_advisory_xact_lock(tenancy_id)`. If any other automated process is active on that tenancy, the execution is queued and held.
🧱 Model 4: LLaMA 3.1 405B (Hostile Defense & Eviction Stress-Tester)
EVICTION BLOCKSThe Critique: "Tenants defending evictions under the RRA will look for minor document delivery gaps (e.g. they received the Gas Safety certificate but the EPC link had expired, or the Landlord had failed to update their address details on the register). An AI that simply checks 'does file exist' can easily authorize an eviction pack that will be thrown out of court by a judge."
The Mitigation: The **Golden Chain Completeness Check**. The evictions micro-agent doesn't just check for file presence; it runs a recursive validator checking the validity ranges of all underlying components. The Gas Safety certificate must have been valid on the date of tenancy commencement, the EPC must have at least 1 year remaining, and the landlord's current address must match the registry perfectly. If any check fails, the eviction is blocked and escalated.
🔍 Model 5: DeepSeek-V3 (ETL & Financial Reconciliation Auditor)
FINANCIAL COMPLIANCEThe Critique: "In periodic tenancies, rent increases are restricted to once per 12 months, and must be served via a statutory Section 13 notice. If an automated system processes a rent increase in the database (e.g. updating the rent from £3,000 to £3,250) but the automated bank reconciliation gateway payment gateway is not synchronized on the exact same billing cycle, the tenant will pay the old rate, creating an immediate, unresolvable arrears discrepancy in the ledger."
The Mitigation: We enforce **Transactional automated bank reconciliation gateway Syncing**. Any change in `tbl_rents` or `tbl_tenancies.rent_amount` must be executed as a single, distributed transaction. The database update will fail and roll back unless the automated bank reconciliation gateway API confirms that the direct-debit mandate or payment reference has been successfully updated on their banking ledger for that exact billing date.
Repository Code
The live codebase implementation for this specification sits within the following repository folder:
4. Localized Micro-Agent Build Plan: UK vs. Thai Modules
Every new tenancy must instantiate a specialized, sandboxed micro-agent process. This prevents cross-contamination of regulatory logic and ensures that the AI only executes localized compliance scripts.
4.1 UK Tenancy Micro-Agent (`raia-agent-tenancy-uk`)
Goal: Ensure 100% legal compliance with the Renters' Rights Act 2026, deposit protections, and statutory safety standards.
Required Skill Files (Preloaded):
- `rra-compliance-checker.md`: Differentiates transitional vs. new tenancies. For transitional, validates RRA Info Sheet (served by 31 May 2026). For new, validates Tenancy Agreement containing mandatory RRA statutory terms (acting as the Written Statement of Terms), plus Gas Safety, EPC, and EICR.
- `dps-deposit-register.md`: Interacts with the DPS/MyDeposits API, handles verification, and downloads the PDF receipt.
- `lettspay-ledger-sync.md`: Coordinates with automated bank reconciliation gateway to register tenancy rent structures and dynamic mandates.
Permitted Tools (Sandboxed):
`['read_file', 'write_file', 'patch', 'mcp_execute_sql', 'lettspay_api', 'dps_api']` (No freeform SMTP, no general web search).
4.2 Thai Tenancy Micro-Agent (`raia-agent-tenancy-th`)
Goal: Manage bilingual Thai/English lease contracts under the Thai Civil and Commercial Code (CCC), calculate Land Tax, and coordinate with Bangkok Juristic Offices.
Required Skill Files (Preloaded):
- `thai-ccc-contract-builder.md`: Compiles bilingual lease agreements adhering to the Thai Civil and Commercial Code.
- `juristic-office-coordinator.md`: Automates registration of tenant identity, passport/ID, and vehicle plates with building juristic offices.
- `promptpay-qr-generator.md`: Dynamically generates Baht-denominated PromptPay QR codes for automated bank reconciliation gateway-Thai billing runs.
Permitted Tools (Sandboxed):
`['read_file', 'write_file', 'mcp_execute_sql', 'juristic_api', 'promptpay_generator']` (No RRA logic, no UK deposit API access).
5. 0-Hallucination Guardrails & SOP Execution
To guarantee that spawned micro-agents never hallucinate legal variables, tenancy terms, or payment figures, developers must enforce the following four architectural guardrails:
Rule 1: Hard-Coded Schema Gating (JSON Schema)
A micro-agent is prohibited from passing loose key-value pairs or text fragments to database adapters or email templates. Every payload must be validated against a strict JSON schema:
`schemas/onboarding-payload.json` must enforce: `rent_pcm_agreed` (decimal), `deposit_amount_agreed` (decimal), `rra_leaflet_served_at` (ISO timestamp, required only for pre-May 2026 transitional tenancies).
Rule 2: Uneditable Document Assembly (PDF Lock)
Micro-agents do not write contract bodies. They simply query raw, verified entity data and inject it into static, read-only HTML templates which are then compiled into locked PDF binaries. Under no circumstances can the AI modify contract clauses or standard legal paragraphs.
Rule 3: Deterministic Checklist Assertion
Before writing `status = 'active'` to any tenancy, the system runs a database function (`fn_assert_onboarding_completeness`). This function runs direct SQL checks verifying that all required certificates, documents, and mandates are recorded in `tbl_tenancy_documents`. It asserts requirements dynamically based on the tenancy start date: if the tenancy started before 1 May 2026, it asserts the presence of the transitional `rra_information_sheet`. If it started on/after 1 May 2026, it asserts the presence of the `tenancy_agreement` (acting as the Written Statement of Terms). If any required row is missing, the transaction is rejected, regardless of the AI's internal state.
Rule 4: Compliance HITL Gating
All onboarding results compiled by a micro-agent must be staged. The final release of the tenancy contract, registration of deposits, and payment outbox are completely frozen until approved by a human compliance officer (**Darrel Kwong** or **Eugin**) via the portal dashboard.
Repository Code
The live codebase implementation for this textbook logic sits within the following repository folder:
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.