"Safety Pilot" is defined in
JAR-FCL 1 (on page 8 of the linked document):
JAR-FCL 1.035(e)
A safety pilot is a pilot who is qualified to act as PIC on the class/type of aeroplane and carried on board the aeroplane, which is fitted with dual controls, for the purpose of taking over control should the PIC holding this specific medical certificate restriction become incapacitated (see IEM FCL 1.035).
In addition to this meaning, it is also used to mean a pilot who sits alongside the PIC while the PIC is under simulated instrument conditions in VMC, in order to comply with the requirement to look out. I don't think there is any legal definition of this meaning of the phrase, though.
FFF
--------------