If rests are allowed in certain areas, where you may have an encounter/ambush while trying to rest, is like there to be a mechanic added that shows a probability range. The accuracy of predicting that window could have factors into it based on skills like survival and other abilities. Perhaps even allowing to set up a watch, or other things to reduce the window.

Example area X
Pop up “resting here these is a 20-40% chance”
-use skill/ability/spell/watch/etc
Updated “there is a 15-20% chance”
Rest now?