The present invention relates to agricultural machine (1) comprising a frame (2) which is configured to be attached to a vehicle in order to move the agricultural machine (1) in a normal direction of travel (A), a bearing arm construction (6, 7, 8) having at least one bearing arm (8), which bearing arm construction is pivotably connected to the frame (2) so as to be pivotable about one or more pivot axes, and a plurality of processing members (9) with processing elements (10) for working the land or processing a crop, wherein the processing members (9) are at least displaceable between an operating position and a transport position by pivoting of the least one bearing arm construction about the one or more pivot axes. The agricultural machine (1) comprises a movable shielding construction (11) to at least partially shield the processing members (9) in the transport position, wherein the movable shielding construction comprises two shielding beams (12) located at opposite sides of the agricultural machine, wherein the shielding beams are movable between a shielding position and a lower position. The invention is characterised in that a safety device prevents the processing members (9) moving between the operating position and the transport position when the movable shielding construction (11) is arranged in the shielding position, the safety device comprising a shut-off valve (28) arranged in a hydraulic drive circuit of the bearing arm construction and mechanically linked to the movable shielding construction (11) so that the shut-off valve is in a closed position when the shielding beams are in the shielding position, and the shut-off valve is arranged in an open position when the shielding beams are in the lower position.