Safe task execution