The use of Artificial Intelligence mechanisms, more or less advanced, to manage the work is more and more frequent: to establish work shifts, production times, designate and design tasks for workers, hire, evaluate the performance and fire. Companies trust that technology collects all available information, processes it and makes the best management decisions - productive optimization - for the benefit of it. With this, the supervisors and middle managers are replaced, as well as the human resources experts, leaving the direction of the workers in the hands of automated processes managed by algorithms - or in their most advanced state, in Artificial Intelligence. In this work, the health hazards that new form of technological management can cause are exposed. Indeed, the constant monitoring through sensors, the intensification of work derived from the decisions taken by a machine without empathy or knowledge about human limits, the reduction of autonomy of the worker subjected to the decisions made by Artificial Intelligence, discriminations, under a blanket of algorithmic neutrality of these decisions, as well as possible operational errors, they can end up causing serious physical and psychological health problems for workers. These risks can be reduced if they are taken into account in programming. In this work, the need for a correct programming of the algorithm to assess the exposed occupational risks is defended. That is to say, in the same way that a supervisor must have training in risk prevention to be able to carry out his work, the algorithm must be programmed to weigh the occupational hazards at work - and in case of not having this programming, its use to direct workers should be banned. Specifically, the algorithm must be transparent, adapted to the real capabilities of the worker, must leave somemargin of autonomy for the worker and respect their privacy. In short, the algorithm must assess any element that poses a risk to the safety and health of workers. To do this, it is argued that the mandatory risk assessment, carried out by the technicians, should be done focused on programming the algorithm so that it respects it in decision making in the work direction.