There is only one agent who was killed in the line of duty.
If an agent sacrifices their life for the president, they do it voluntarily. Actually, there was only one case in history when a Secret Service officer died: Leslie Coffelt was killed on November 1, 1950, while defending Harry Truman.