I've been thinking about the nature of security in biology. How do you keep enemies out when you are guarding something valuable like an oasis or your heart/brain?
Well, we can install layers of access control like cell membranes which apply access control. We can cordon off the nuclear power plants (like mitochondria) with a "dumb" API that produces energy in return for nutrients and avoids "smart contracts".
In the medieval sense, we can dig a moat and install a drawbridge. Bridges adds latency, but at least you can retract them during wartime. But the enemy is pretty clever, so they carry long ladders across the desert that can span the moat.
So you add a winding cave before the moat so the ladders don't fit. But then they wisen up and pay spies behind your lines to lower the bridge, which is analogous to hijacking your immune system, or they invent a folding ladder, and so on.
But none of this helps you if your enemy can consume you at a macro scale by swallowing you whole. So complex species tend to grow larger or add multiple layers of specialised topology (organs) with disposable individuals - not to mention growing their societies.
I suspect there exists a "Shannon Information Theory of Survival" that can guarantee a defensible strategy as long as you can inject sufficient variance into the environment (high pressure, low pressure, vacuum, hot, cold, acidic, etc.) so that it would be more costly for an attacker to usurp you than to forge an alliance.