John Karanja

The field guide · rule 02 of 16

Check everything that comes in

Treat anything from outside as possibly wrong, and check it the moment it arrives.

What it means

Anything that comes from outside the system might be wrong, or even hostile: what a user types, what a browser sends, what another service returns, even a settings file. Check it at the door. If the settings are wrong, the system should refuse to start, rather than fail halfway through a customer's request.

What goes wrong without it

A payout address with one wrong character sends money to the wrong place, and there is no way to get it back.

How I build it

From systems I build and run.

Ask your team

  1. Do you check what users and other services send before you use it?
  2. Does the system refuse to start with bad settings?
  3. Is every amount and address checked before money moves?

A "no" or "not sure" is worth a closer look.

How a review checks this

A review lists every place where outside data enters, and checks what happens when that data is wrong.

Request a reviewThe offer: Architecture reviewCheck your system in one minute

Related rules