A work machine including a machine body, a front work implement disposed in the machine body, a plurality of hydraulic actuators configured to drive the front work implement, a posture sensor (8a-8c) configured to detect posture of the front work implement, a hydraulic pump, a pilot pump, a plurality of control valves configured to control a flow of hydraulic working fluid to be supplied from the hydraulic pump to the hydraulic actuators associated with the respective control valves, operation lever devices configured to generate hydraulic signals directing operations of the hydraulic actuators associated with the respective operation lever devices in response to a control operation, a plurality of pilot lines (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1) configured to connect the operation lever devices with hydraulic drive parts of the control valves associated with the respective operation lever devices, a proportional solenoid valve (61b, 62a, 62b, 63a, 63b) disposed in at least one of the pilot lines (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1), and a front control section configured to calculate a limit command value for restricting operations of the front work implement through control of the proportional solenoid valve (61b, 62a, 62b, 63a, 63b) using a detection signal of the posture sensor (8a-8c), characterized in that, the work machine comprises: a bypass line (81B, 82A, 82B, 83A, 83B) configured to connect a portion in the pilot line (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1) upstream of the proportional solenoid valve (61b, 62a, 62b, 63a, 63b) and a portion in the pilot line (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1) downstream of the proportional solenoid valve (61b, 62a, 62b, 63a, 63b); a bypass valve (81b, 82a, 82b, 83a, 83b) serving as an open/close valve disposed in the bypass line (81B, 82A, 82B, 83A, 83B); a switch configured to output a signal to turn on or off control by the front control section; an input section; an on/off determining part configured to determine whether a signal input from the switch via the input section is an on signal that brings the control by the front control section into an on state or an off signal that brings the control by the front control section into an off state; an open/close command part configured to generate an open command signal to open the bypass valve (81b, 82a, 82b, 83a, 83b) when the on/off determining part determines that the signal input from the switch is the off signal and generate a close command signal to close the bypass valve (81b, 82a, 82b, 83a, 83b) when the on/off determining part determines that the signal input from the switch is the on signal; and an output section configured to output to the bypass valve (81b, 82a, 82b, 83a, 83b) the open command signal or the close command signal generated by the open/close command part. a bypass line (81B, 82A, 82B, 83A, 83B) configured to connect a portion in the pilot line (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1) upstream of the proportional solenoid valve (61b, 62a, 62b, 63a, 63b) and a portion in the pilot line (51a1, 51a2, 51b1, 52a1, 52b1, 53a1, 53a2, 53b1, 53b2, 54a1, 54b1) downstream of the proportional solenoid valve (61b, 62a, 62b, 63a, 63b); a bypass valve (81b, 82a, 82b, 83a, 83b) serving as an open/close valve disposed in the bypass line (81B, 82A, 82B, 83A, 83B); a switch configured to output a signal to turn on or off control by the front control section; an input section; an on/off determining part configured to determine whether a signal input from the switch via the input section is an on signal that brings the control by the front control section into an on state or an off signal that brings the control by the front control section into an off state; an open/close command part configured to generate an open command signal to open the bypass valve (81b, 82a, 82b, 83a, 83b) when the on/off determining part determines that the signal input from the switch is the off signal and generate a close command signal to close the bypass valve (81b, 82a, 82b, 83a, 83b) when the on/off determining part determines that the signal input from the switch is the on signal; and an output section configured to output to the bypass valve (81b, 82a, 82b, 83a, 83b) the open command signal or the close command signal generated by the open/close command part.