Skip to content

Blog

How to build a company brain, part 7: the rules, and how to keep personal data out

By Saif Qureshi5 min read
  • Company brain
  • Privacy
  • AI agents

A brain that runs a company holds things that must not leak and must not be made up: bank details, ID numbers, salaries, customers' personal data, amounts, dates. I wouldn't let an agent work in one without the rules in this part. I'm an engineer, not a lawyer, so read the privacy section as how the system is built and not as legal advice.

Key takeaways

  • Five standing rules: never delete, never move originals, never invent, read the summary first, and agents draft while people send, pay and file.
  • Write in short plain sentences, keep measured facts apart from inferred ones, and write "unknown" when something isn't known.
  • Four layers keep personal data out: a never-enter list, a quarantined folder that is never indexed, redaction before results reach an agent, and a guard in front of each model.
  • Test the masking with fake data. The tests will turn up formats your patterns missed.

The five standing rules

Every agent and every person at Kranich follows these.

  • Never delete anything. If something looks redundant, report it and let a person decide.
  • Never move originals. Copy them, and note in the manifest where the copy came from.
  • Never invent a date, an amount or a document. Write "unknown" and say what would confirm it.
  • Read the folder's summary first. It tells you what's missing and what isn't to be trusted.
  • Agents draft. People send, pay and file. The brain can prepare INV-2026-041 and remind the founder it's due. Only the founder sends it.

The writing rules

Write short, plain sentences that a new teammate understands. No marketing voice and no filler. Anything a customer will read follows the copy guide and is never improvised.

A knowledge page describes how things are now, and the history goes to the decision log. Measured facts (seen, counted) stay apart from inferred ones (our reading of them). And when something isn't known, the page says "unknown" and names what would confirm it.

Four layers that keep personal data out

1. What never goes in. There's a written list: personal details of team members, HR matters, private finances, credentials, keys and tokens, customers' personal data, raw data dumps. A lint check scans new files for these patterns and stops the sync if it finds one.

2. Zones. One quarantined folder holds customer conversations. It's the only place customer personal data may live, and it is never indexed, so neither keyword search nor embedding search can return it. What leaves the folder is anonymised themes, such as "12 customers asked for a waitlist this month". When a customer asks for their data to be erased, their folder is deleted. That is the right GDPR Article 17 describes. The same article makes an exception for data you're legally obliged to keep, so records like invoices follow their own retention rules. Credentials are listed by file name only, and no agent opens them.

3. Redaction at the boundary. Before a search result reaches an agent, a redaction step runs. Bank account numbers keep only the country code, the check digits and the last four digits. Passport numbers, personal tax IDs, social security numbers and dates of birth become [redacted]. Company identifiers such as the register number and the VAT ID stay visible, because an agent writing an invoice needs them.

4. A guard in front of every model that isn't approved for personal data. The guard either blocks the request or swaps personal data for placeholders such as [E-Mail], [Phone], [IBAN] or [Name], then puts the real values back into the answer where they're needed. It flags too much on purpose. Sending a doubtful request to the approved model costs little. A leak costs a lot.

Four nested layers: 1 never-enter list, 2 zones (quarantined folder, never indexed), 3 redaction at the boundary, 4 guard before every model.
From what never goes in to what a model never gets to see.

Test it with fake data

Redaction is only as good as its patterns, and patterns have holes. In one of my brains, tests with fake documents found two: an ID number format the patterns didn't cover, and the machine-readable lines printed on a passport, whose format is set by ICAO Doc 9303. Both were fixed before any real document went through.

So write the tests first. Plant fake personal data, run a search and a model call, and check that none of it shows up in any request going out to a search provider or a model.

Prompt to add boundary redaction and its tests
prompt
Goal: add a redaction step to our brain search, with tests.

Inputs: the search code in this repository. Fake data only. Do not open any real document or anything in the credentials folder.

Do this: before search results go to an agent, mask IBANs to the country code, check digits and last four digits. Replace passport numbers (including the machine-readable lines), personal tax IDs, social security numbers and dates of birth with [redacted]. Keep company register numbers and VAT IDs visible.

Constraints: write the tests before the patterns. Invent every test value yourself. Do not send any test data to an outside service.

Definition of done: the tests run, and you show me which patterns fail before you fix them, then the passing run after.
Next in How to Build a Company Brain · Part 8How to build a company brain, part 8: research that can still be trusted a year later

Frequently asked questions

How do I stop AI agents inventing facts?

Make it a standing rule: never invent, write "unknown", say what would confirm it. Record whether each fact rests on proof or on someone's statement. And keep a person in charge of anything that gets sent, paid or filed.

How do I keep personal data away from AI models?

Keep it in a folder that is never indexed. Redact identifiers before results reach an agent. Put a guard in front of any model that isn't approved for personal data. Then test all of it with fake data.

Should company IDs be masked too?

Usually not. A register number or a VAT ID normally identifies the company, and agents need it for invoices and filings.

Sources

  1. GDPR Article 17: right to erasure gdpr-info.eu
  2. ICAO Doc 9303: Machine Readable Travel Documents icao.int

Talk to me

Building an AI product and need someone senior to own the technical side? Book a free 30-minute call.