← Internal Index
Internal · Not for distribution

Defensibility & AI Strategy

How to stay uncopyable, ship twice a month, and run AI responsibly — what runs where, what never leaves Malaysia, and how we govern it.

Last updated: June 2026
On this page
Part 1

The Honest Truth About "Can't Be Copied"

A front-end HTML page can always be View-Source'd. There is no client-side trick — obfuscation, minification, license checks — that stops a determined developer from copying a static page. Anyone who promises otherwise is selling snake oil.

So we stop trying to protect the code and instead build a moat around the things that are genuinely hard to copy. This is how every durable software business actually defends itself.

The Four Real Moats

MoatWhy a copier can't lift itHow we build it
1. Data network effectA clone starts with zero rental history, zero tenant records, zero estate cases. Our value compounds with every month of data.Every payment logged, every disbursement, every resolved estate makes the product smarter and stickier. The dataset is the product.
2. Server-side logicPayment processing, document generation, notification dispatch, and the Faraid engine's edge cases run behind an authenticated API. The browser only sees the thin UI shell.Move all mutations server-side. The HTML is a dumb terminal; the brain is private.
3. Switching costOnce a family has 18 months of rental records, beneficiary statements, and tenancy agreements in Warisan, leaving means losing their entire estate history.Make the product the system of record. Export is allowed (trust), but nobody wants to re-enter years of data.
4. Trust & distributionEstate matters are intimate. Families recommend Warisan to relatives — who are often co-heirs to the same estate. A clone has no trust and no referral loop.Lean into the emotional, dignified brand. Build the referral loop into the disbursement flow.

What the client-side "gate" actually does

In warisan-property.html there is a WARISAN_LICENSE integrity check and an origin allowlist. Be clear about what this does and doesn't do:

The copier ends up with a pretty but dead shell. To make it work, they'd have to rebuild the entire backend — at which point they're not copying, they're competing, and they're 18 months behind on data.

Practical anti-lift hardening (defence in depth)

  1. Thin client, fat server. Never put business logic in the browser. Compute server-side, return only results.
  2. Authenticated API for every mutation. Reading the demo UI is free; doing anything requires a token tied to a paying account.
  3. Signed, short-lived tokens. License tokens expire hourly and are re-issued server-side.
  4. Rate limiting + anomaly detection. Bulk scraping patterns get flagged and throttled.
  5. Watermarked generated documents. Every PDF carries an invisible per-account fingerprint.
  6. Minify + bundle the shipped JS so casual "vibe coders" can't trivially read structure.

Bottom line: Speed and data win, not secrecy. Ship faster than anyone can copy, and make your accumulated data impossible to replicate.

Part 2

The Property & Rental Module

warisan-property.html is the front-end MVP of the rental management feature. It demonstrates a single-property free tier with a hard paywall to add a second property, an income vs cost chart, a rental ledger with paid/due/overdue status, cost and maintenance tracking, beneficiary disbursement, tenant management, quick actions, a payment link generator, and a paywall modal.

Monetisation in this module

PlanPricePropertiesKey unlocks
FreeRM 01Track income/cost, manual ledger, basic disbursement view
FamilyRM 19/moup to 5Auto reminders, beneficiary reports, agreement generator
GuidedRM 699 one-timeProfessional consult + document review
Part 3

The Twice-a-Month Feature Pipeline

Shipping velocity is the moat. Here is a concrete 6-month, 12-feature roadmap. Each is scoped to be shippable in ~2 weeks by a small team.

Month 1

Month 2

Month 3

Month 4

Month 5

Month 6

Pipeline discipline

Part 4

Why This Beats a Copier Every Time

A vibe-coder clones your page on a Friday. By the time they've reverse-engineered the backend, integrated a payment gateway, handled Faraid edge cases, set up notification infra, and earned a single user's trust — you've shipped 4 more features, accumulated thousands of rental records, and your users have 3 months of history they'd never abandon.

They're copying a photograph of a moving train.

Part 5

AI Deployment Pipeline

How Warisan uses AI: what runs where, what never leaves Malaysia, and how we govern it. This section is the authoritative reference for AI architecture decisions.

5.1 — The Core Principle: AI Explains, Code Calculates

The most important architectural decision in the entire AI stack is this: the Faraid engine is deterministic code. It is never an LLM.

Quran 4:11–12 and 4:176 specify fixed mathematical rules. A probabilistic model can hallucinate a share fraction. A rule engine cannot. So the calculation layer — Faraid shares, Asabah residuary, Hajb blocking, NDE computation, Warisan Score points — is pure JavaScript and Python. Zero AI involvement.

What AI does in Warisan is explain, narrate, and guide. It takes the output of deterministic calculations and helps families understand what those numbers mean in plain Bahasa Malaysia.

5.2 — Task Classification

Every AI task falls into one of three categories. The category determines which model handles it and whether data leaves Malaysia.

Category A — Never touch an LLM (deterministic code only)
Faraid share calculationFixed Quranic rules. LLM hallucination = religious and legal liability.
Warisan Score calculationFixed point rules. Computed server-side, never AI.
NDE computationPure arithmetic. Liquidity discount schedule is a lookup table.
Document form-fillingTemplate substitution. No inference needed.
Heir blocking (Hajb) rulesBoolean logic tree. Fully deterministic.
Category B — AI-assisted, non-sensitive inputs onlyInput to AIOutput
Faraid result explanationHeir categories + share fractions onlyPlain BM paragraph explaining why each heir received their share
Warisan Score improvement tipsScore band + missing itemsPersonalised next-step suggestions
Next-steps roadmap narrativeTrack + estate size band + heir categoriesPrioritised action list with authority routing
FAQ and general guidanceUser question text onlyAnswer in BM, EN, or AR
Category C — Sovereign model only (future)SensitivityStatus
Estate document parsing (land titles, IC, EPF)HighDeferred until sovereign model deployed
Wasiat draft generationHighDeferred — legal document, needs lawyer review workflow
Beneficiary identity verificationCriticalMyDigitalID JPN integration, no AI involvement

5.3 — The Migration Path

AI infrastructure scales in four stages triggered by user volume and cost thresholds, not by ambition.

Stage 1 — Preview (now, 0–100 users)
Provider: Groq free tier  ·  Model: qwen-qwq-32b
Tasks: Category B only  ·  Cost: RM 0
Trigger to move: Groq daily cap hit regularly, or first paying user
Stage 2 — Beta (100–500 users)
Provider: Anthropic API  ·  Model: Claude Sonnet 4.6
Cost: ~RM 15–50/month  ·  API key in Cloudflare Worker, never client-side
Trigger to move: Monthly bill exceeds RunPod GPU cost (~RM 180/month, ~5,000+ users)
Stage 3 — Production (500–5,000 users)
Provider: RunPod GPU cloud  ·  Model: Qwen3 8B, 4-bit via Ollama
Cost: ~RM 180–350/month (RTX 3090 24GB)  ·  Anthropic kept as hot fallback
Trigger to move: Signed institutional contract requiring Malaysian data residency
Stage 4 — Institutional (5,000+ users)
Provider: Malaysian data centre (TM ONE or AIMS colocation)
Tasks: Category B + C (document parsing begins)
Cost: RM 1,500–3,000/month or RM 8–10k hardware + colocation

5.4 — Data Boundary Enforcement

This is the single most important section for PDPA compliance and institutional trust. It must be implemented in code, not just policy. The sanitisation function runs in the Cloudflare Worker before any external API call:

function sanitiseForAI(rawPayload) { return { // ALLOWED — non-identifiable track: rawPayload.track, estateRange: bucketValue(rawPayload.estateValue), heirCategories: rawPayload.heirCategories, distributionResult: rawPayload.fractions, scoreRange: scoreToRange(rawPayload.score), missingScoreItems: rawPayload.missingItems, language: rawPayload.language, // STRIPPED — never sent to external AI // estateValue, icNumber, name, propertyAddress, // landTitleNumber, epfAccountNumber, exactScore }; }

The Cloudflare Worker enforces this before every outbound AI call. There is no code path that bypasses sanitisation. This ships from the first day AI is integrated.

5.5 — The System Prompt (Locked)

Version-controlled, reviewed before any change, never modified at runtime. Hard limits: never calculate share fractions, never give legal advice, never repeat or store personal data, never produce content that could be construed as a fatwa.

Version control rule: Any change requires a written rationale, a test run against 10 standard queries, and sign-off before deployment.

5.6 — Security Architecture

API keys live in Cloudflare Worker environment variables, never in client-side code. Per-session rate limiting: 20 AI calls per session per hour. Every call is signed with a short-lived HMAC token.

Logging: timestamp, hashed session ID, query category, model used, token counts, latency, prompt version, sanitisation pass — and nothing else. No user data, no query content, no output content is logged. Retained 30 days then deleted.

Fallback chain: self-hosted Qwen3 8B → on error, Anthropic Claude Sonnet 4.6 → on error, pre-written static response. The user never sees a failure.

5.7 — Governance and Oversight

ComponentWho can changeProcess
System promptFounder onlyWritten rationale + 10-query test + version log
Sanitisation functionFounder onlyCode review + PDPA impact check
Model (provider/version)Founder onlySecurity review + data boundary recheck
Fallback copyAnyoneReview for tone and accuracy
Rate limitsFounder onlyCost impact analysis first

PDPA 2010 compliance checklist — confirm before each stage migration:

Incident response timeline: Immediate — disable affected feature, return static fallback. Within 1 hour — identify failure, document. Within 24 hours — fix deployed and tested. Within 72 hours — PDPC breach notification prepared if applicable. Within 1 week — post-mortem written, prompt version incremented.

5.8 — What We Never Build with AI