# How I build: five rules in every system I ship

> Numbers come from code, every quote is checked, people approve side effects, isolation by default, and it runs where the data lives: the five rules behind Spead AI, AgentBuff, the Wijaya Karya systems and my open-source tools.

Over the past year I have built AI systems for very different readers: the tender and contract team of a state-owned contractor, small business owners who talk to an AI employee in WhatsApp, and developers who install one of my open-source tools. The products look nothing alike. The same five rules keep showing up in all of them, so I wrote them down on my GitHub profile. This is the longer version, with the product decisions behind each rule.

**The five rules**
- Numbers come from code: The model may propose; tested code computes every figure a user sees.
- Every quote is checked: A citation is compared with the source before a person reads it.
- People approve side effects: Agents can read and draft; a person approves anything that changes data.
- Isolation by default: Each user, owner or division is fenced off in the infrastructure and the data layer.
- It runs where the data lives: Private cloud or on premise when the data cannot leave.

## 1. Numbers come from code

A language model is good with language and unreliable with arithmetic it cannot show. In products that deal with money or prices, a figure that changes when you ask twice is worse than no figure. So the model may propose assumptions and words, and deterministic code decides every number.

- **AgentBuff Co-Founder** (open source, MIT): every financial figure, from HPP and break-even to NPV and IRR, and the 0 to 100 validation score are computed by code with unit tests. Coverage on the financial and research engines is gated at 100%, and 331 tests pass.
- **Buff Your Money**: there is no language model inside the app at all. The user's own agent does the language work, the app parses the sentence deterministically, and money is stored in minor units and calculated with a decimal library, never with floats.
- **Kasir POS**: analytics run in a deterministic engine with no language model, so the owner sees the same numbers every time.
- **Q-NEXUS**: known Excel headings in a vendor offer are mapped by code, values are compared cell by cell, and the vendor recommendation is a fixed formula of 60% price and 40% technical score.

## 2. Every quote is checked

In a tender review, a quote that is almost right is the dangerous kind: it reads well, and the clause it points to says something else. A reviewer cannot reread a whole contract to check every line, so the system has to do the first check.

- **Spead AI Pro** checks every quote the AI cites against the source text and gives it one of six statuses before a person sees it: whole, proven, scattered, too short, partial or not found.
- **Q-NEXUS** accepts a number from a PDF or Word offer only if it can be found in the document text.
- **Buffy**, the assistant in HC Platform, cites the page of the policy document it used.

*The Spead AI Pro quote checker on six hand-typed test quotes against a synthetic package, one for each status.*

## 3. People approve side effects

An agent that reads the wrong thing wastes a minute. An agent that writes the wrong thing can void a sale, move money or send a letter to a vendor. So agents in my products may read freely within their scope and draft whatever they like, and anything that changes data waits for a person.

- **Kasir POS**: agent tools are draft-only, and create, void, refund and checkout sit on a forbidden list enforced in code. The owner approves each draft in the app, and every change lands in an append-only audit trail.
- **Buff Your Money**: every action by the agent is logged, and the user can undo recent ones.
- **Spead AI Pro**: connector actions that change data become approval requests.
- **Q-NEXUS** shows the source and the result side by side, and nothing is saved until someone presses Save. **Absentra** asks for confirmation before any change an agent makes. **HC Platform** Payroll Review lists findings but never writes to SAP: each one waits for a person's decision.

## 4. Isolation by default

When an AI agent can call tools, the question is no longer only who may log in, but what the agent can reach once it is inside. I answer it below the application, where a bug in one screen cannot widen the fence.

- **AgentBuff**: every user runs in a separate container with dropped capabilities, no traffic between containers and resource limits.
- **KostCloud**: every MCP tool resolves the owner from the bearer token, so an agent only ever sees the boarding house of the person who issued the token.
- **HC Platform**: Buffy reaches HC data only through tools that run the same access checks as the pages, access is checked at the edge, on every page and inside every server action, and row level security policies are ready to keep divisions apart in the database itself.
- **Spead AI Pro**: a single access filter decides what each person's assistant may read, so the AI sees only what that person may see. **Buff Your Money** uses row-level security and separate database roles for migration, app and worker.

## 5. It runs where the data lives

Government bodies, state-owned enterprises and regulated companies often cannot send their documents to someone else's cloud. Spead AI is built to deploy on private cloud or on premise for exactly those clients, and the internal systems I build for the EPCC Division of Wijaya Karya run as company systems behind the company's own sign-in, with accounts created by an admin. The model comes to the data, and the data stays where its owner already governs it.

## Using the rules on your own project

None of this needs a large team. Before an AI feature ships, I run it against five questions, one per rule.

**Before an AI feature ships**
- [ ] Which numbers on this screen did the model write, and can code compute them instead?
- [ ] If the model quotes a source, what checks that the quote is really there?
- [ ] Which actions change data, and who approves them before they happen?
- [ ] If this agent is compromised, what is the most it can reach?
- [ ] Does the data have to leave the client's environment for this to work?

**Building an AI system that has to be trusted?** I design and build AI products for enterprises, government and small businesses, with these five rules from the first day.

Source: https://nugrahalabib.com/writing/how-i-build-five-rules
Author: Nugraha Labib Mujaddid (https://nugrahalabib.com)
Published: 2026-11-27. Updated: 2026-11-27.
