Abstract : In this paper, we propose physically meaningful energy related safety indicators for robots sharing their workspace with humans. Based on these indicators, safety criteria are introduced as constraints in the control algorithm. The first constraint is placed on the kinetic energy of the robotic system to limit the amount of dissipated energy in case of collision. This constraint depends on the distance between the robot and the human operator. The distance is computed with a point cloud based algorithm acquired using a set of depth sensors (Kinects). The second constraint is on the amount of potential energy that is allowed to be generated within the human-robot system during physical contact. It is used to modulate the contact forces. The control algorithm is formulated as an optimization problem and computes every time step the actuation torques for a KUKA LWR4 manipulator given some task to be performed, the introduced constraints and the physical limitations of the system to respect. The overall framework allows a human operator to safely enter the robot's workspace and physically interact with it.