An optical system for generating an optical beam, comprising: an optical system exit plane through which the optical beam exits the optical system; a laser that emits a laser beam; at least one optical element that is arranged at least partly between the laser and the optical system exit plane and that forms the optical beam from the laser beam, wherein the at least one optical element comprises an entrance surface for receiving the laser beam; an optical source that is arranged between the entrance surface of the at least one optical element and the optical system exit plane, wherein the optical source generates light within a predetermined wavelength range in response to being excited by at least a part of the laser beam; and a light detector that is coupled to the laser and adapted for receiving at least a portion of the light from the optical source, wherein the light detector has a predetermined wavelength sensitivity range that overlaps at least partly with the predetermined wavelength range and wherein the light detector controls the laser if the light detector fails to receive the at least a portion of the light from the optical source or detects that an intensity of the at least a portion of the light received from the optical source is outside a predetermined intensity range; and wherein the at least one optical element further comprises: at least one last optical element that is arranged further away from the laser than any other optical element of the at least one optical element and comprises an entrance surface and at least one first optical element that is arranged closer to the laser than any other optical element of the at least one optical element; characterized in that the system further comprises: an exit surface of the at least one last optical element for transmitting the optical beam, wherein the optical source is attached onto the exit surface of the at least one optical element, and arranged to have the light within the predetermined wavelength range dispersed inside the at least one last optical element, the optical source being attached onto the entrance surface of the at least one last optical element, or being located between the at least one optical element and the optical system exit plane; and wherein all optical elements of the at least one optical element are placed at least partly in the optical beam path between the optical source and the light detector. an optical system exit plane through which the optical beam exits the optical system; a laser that emits a laser beam; at least one optical element that is arranged at least partly between the laser and the optical system exit plane and that forms the optical beam from the laser beam, wherein the at least one optical element comprises an entrance surface for receiving the laser beam; an optical source that is arranged between the entrance surface of the at least one optical element and the optical system exit plane, wherein the optical source generates light within a predetermined wavelength range in response to being excited by at least a part of the laser beam; and a light detector that is coupled to the laser and adapted for receiving at least a portion of the light from the optical source, wherein the light detector has a predetermined wavelength sensitivity range that overlaps at least partly with the predetermined wavelength range and wherein the light detector controls the laser if the light detector fails to receive the at least a portion of the light from the optical source or detects that an intensity of the at least a portion of the light received from the optical source is outside a predetermined intensity range; and wherein the at least one optical element further comprises: at least one last optical element that is arranged further away from the laser than any other optical element of the at least one optical element and comprises an entrance surface and at least one first optical element that is arranged closer to the laser than any other optical element of the at least one optical element; characterized in that the system further comprises: an exit surface of the at least one last optical element for transmitting the optical beam, wherein the optical source is attached onto the exit surface of the at least one optical element, and arranged to have the light within the predetermined wavelength range dispersed inside the at least one last optical element, the optical source being attached onto the entrance surface of the at least one last optical element, or being located between the at least one optical element and the optical system exit plane; and wherein all optical elements of the at least one optical element are placed at least partly in the optical beam path between the optical source and the light detector.