I second life and death as the key idea. You asked for a rule of thumb. A rule of thumb I find useful is to play the loosest most outward-facing move that still kills your opponent. Some examples may help.
Exhibit 1 from the Master series games:
In this game, AlphaGo enclosed the corner with a second small knight. Without more, the double small knight ends in ko. But AG had extra stones nearby at R7 and K3 and K4 that caused the small knight to kill, too. AG played the looser defense because it worked. Reading is key.
Exhibit 2 from the Master series games:
Here, AG defended a small knight by just bending up at the distant D12. Again, nearby stones in the J17 and C12 areas made a difference, and Black couldn’t live inside. AG did not play C15. AG played a looser move because it still worked. Again, reading is key.
My suggestion is to learn common killing sequences for the small knight enclosure. Once you learn some killing sequences, you can better avoid overly conservative defenses.
EDIT for working links: