The firmware
Each release image has a signature of the TFN OS release key. The board checks it before it starts the new image, and refuses an image for another board kind.
Each release has a security number. A board does not go back to an older number, so a person cannot put back an old image with a known fault.
A new image must pass its self-test. If it does not, the board goes back to the last good image.
The apps
Each app package has a signature of a store key. The board checks the signature, the board kind, the version of the system calls and the SHA-256 of each file.
The board trusts the key of the TFN OS store. You can add more keys, for example the key of your pool's own store, or your key as a developer.
An app is native code, so install only the apps of a store that you trust.
A finger on the glass
Some steps change who the board trusts: a new key, a JOIN of a pool, the developer mode. These steps need a tap of a real finger on the board.
A tap from the web page or from the network does not count. The USB cable counts, because a person with the cable can write any firmware to the board anyway.