A method for protecting an X-ray source comprising: a liquid jet generator (108, 208, 608) configured to form a liquid jet (110, 210, 310, 410) moving along a flow axis; an electron source configured to provide an electron beam (116, 416) interacting with the liquid jet to generate X-ray radiation (118, 418); a monitoring arrangement configured to monitor a quality measure indicating a performance of the liquid jet; wherein the quality measure comprises at least one of a shape of the liquid jet; a width of the liquid jet; a speed of the liquid jet along the flow axis; a pressure within the liquid jet generator; and a movement of the liquid jet perpendicular to the flow axis; a processing unit operatively connected to the liquid jet generator, the electron source, and the monitoring arrangement; wherein the method comprises, by means of the processing unit: generating the liquid jet; monitoring the quality measure; identifying a malperformance of the liquid jet if the quality measure exceeds a quality measure threshold; and if said malperformance is identified, causing the X-ray source to enter a safe mode for protecting the X-ray source; wherein causing the X-ray source to enter a safe mode comprises at least one of reducing a speed of the liquid jet along the flow axis; reducing a power output of the electron source; terminating generation of the liquid jet; shielding at least part of the X-ray source from contamination created by the malperformance of the liquid jet; and changing a filter (610 of the liquid jet generator. a liquid jet generator (108, 208, 608) configured to form a liquid jet (110, 210, 310, 410) moving along a flow axis; an electron source configured to provide an electron beam (116, 416) interacting with the liquid jet to generate X-ray radiation (118, 418); a monitoring arrangement configured to monitor a quality measure indicating a performance of the liquid jet; wherein the quality measure comprises at least one of a shape of the liquid jet; a width of the liquid jet; a speed of the liquid jet along the flow axis; a pressure within the liquid jet generator; and a movement of the liquid jet perpendicular to the flow axis; a shape of the liquid jet; a width of the liquid jet; a speed of the liquid jet along the flow axis; a pressure within the liquid jet generator; and a movement of the liquid jet perpendicular to the flow axis; a processing unit operatively connected to the liquid jet generator, the electron source, and the monitoring arrangement; wherein the method comprises, by means of the processing unit: generating the liquid jet; monitoring the quality measure; identifying a malperformance of the liquid jet if the quality measure exceeds a quality measure threshold; and if said malperformance is identified, causing the X-ray source to enter a safe mode for protecting the X-ray source; wherein causing the X-ray source to enter a safe mode comprises at least one of reducing a speed of the liquid jet along the flow axis; reducing a power output of the electron source; terminating generation of the liquid jet; shielding at least part of the X-ray source from contamination created by the malperformance of the liquid jet; and changing a filter (610 of the liquid jet generator. generating the liquid jet; monitoring the quality measure; identifying a malperformance of the liquid jet if the quality measure exceeds a quality measure threshold; and if said malperformance is identified, causing the X-ray source to enter a safe mode for protecting the X-ray source; wherein causing the X-ray source to enter a safe mode comprises at least one of reducing a speed of the liquid jet along the flow axis; reducing a power output of the electron source; terminating generation of the liquid jet; shielding at least part of the X-ray source from contamination created by the malperformance of the liquid jet; and changing a filter (610 of the liquid jet generator. reducing a speed of the liquid jet along the flow axis; reducing a power output of the electron source; terminating generation of the liquid jet; shielding at least part of the X-ray source from contamination created by the malperformance of the liquid jet; and changing a filter (610 of the liquid jet generator.