Safety protocols were present to prevent serious injury of the people inside a simulation. This meant that weapons fired within the simulation would not be able to kill or that the computer could prevent dangerous situations when testing a new ship design.
Safety protocols could be overruled if the person in question had the correct access codes. It was also possible for a holoprogram to disable the safety protocols if it was programmed to do so. (VOY: "Worst Case Scenario") A malfunction in the ship's main computer could render the safety protocols inoperative. (TNG: "A Fistful of Datas")
In 2364, when a Jaradan probe inadvertently caused a malfunction in the safety protocols Whalen was shot and seriously wounded by Cyrus Redblock's henchman Felix Leech who also struck Jean-Luc Picard with his Pistol busting his lip for striking him earlier. (TNG: "The Big Goodbye")
In 2369, Data attempts, but is unsuccessful, in overriding the holodeck safety protocols while recreating an unusual Borg attack on the Ohniaka III Research Station where Data became, seemingly spontaneously, angry. After attempting to increase the simulated Borg's strength by 30 percent, Data informs Geordi La Forge that the computer requires the voice authorization of two senior officers to disable the safety routine and asks for his help in overriding the it. La Forge refuses, but this is the only instance where two individuals were needed to disable the protocols. Data's rank was presumably insufficient to complete the procedure alone, even though Lieutenant commander was sufficient aboard other vessels like USS Voyager (VOY: "Extreme Risk"). It may have been a requirement unique to the USS Enterprise-D, or the requirement may have changed between this and other points in time. (TNG: "Descent")
In 2372, Julian Bashir and Elim Garak ran the holoprogram Julian Bashir, Secret Agent together. While fighting Falcon and his men, Bashir noticed that Garak was bleeding. Garak noted that the holosuite's safety protocols must have been turned off. (DS9: "Our Man Bashir")
While trying to evade the Borg on the USS Enterprise-E, Captain Jean-Luc Picard and Lily Sloane retreated into one of the ship's holodecks, where Picard ran a holoprogram of the Dixon Hill series. He was able to kill both of the Borg who were following him with a submachine gun after turning off the holodeck safety protocols. (Star Trek: First Contact)
In 2373, General Martok told Julian Bashir he had deactivated the safety protocols of a holosuite on Deep Space 9, leading to an injury, although he had in fact been injured by Worf. (DS9: "Soldiers of the Empire")
In 2375, after learning of the Maquis' destruction in the Alpha Quadrant, B'Elanna Torres began running dangerous holodeck programs on the USS Voyager with the safety protocols turned off. (VOY: "Extreme Risk")