Any time I use a torch for plumbing near combustables, I have a full quart-size trigger spray bottle of water within reach and a fire extinguisher with me as a backup. Having a phone readily available is easy these days.
Wetting bare wood with water spray greatly reduces the chance of ignition IMO, and readily cools any scorched spots.
The use of heat shields made from small sections of (clean) roofing flashing is easy protection from excess heat, and protecting finished surfaces.
One should plan the work so there are few if any distractions, and their time, so there is no need to leave as soon as the work is completed.