The utility model discloses a safety lock for an electrical cabinet, and belongs to the technical field of safety locks, the safety lock comprises a lock body, a bolt and a key, the lock body comprises a body, a lock cylinder and a support marble, the lock cylinder is rotatably matched with the body, the support marble is matched with the body in a sliding mode in the length direction of the lock cylinder, the lock cylinder is provided with at least two support grooves, and the bolt is inserted into the support grooves. The body is provided with a support spring, and the support marble is inserted into one of the support grooves under the elastic action of the support spring. The key is matched with the lock cylinder in an inserted mode, and when the key is inserted into the lock cylinder, the support marbles are separated from the support grooves. The bolt is matched with the body in an inserted mode, the body is matched with a locking marble in a sliding mode, and when the support marble is separated from the support groove and the lock cylinder is rotated, the locking marble locks or unlocks the bolt. The cabinet door has the advantages that the cabinet door is not prone to being opened or closed by mistake after the key is inserted into the lock cylinder, and safety is improved.