Yes, you can sleep while your boat is on autopilot. However, it is important to be aware of the dangers that come with this practice and take precautions accordingly.
For example, if the weather conditions are not ideal or if there are other boats in the vicinity, it is important to have someone awake and monitoring the situation. Additionally, it is always advisable to have a lifejacket handy in case of an emergency.