The invention relates to a safety device (S) for a drug delivery device (1), comprising: - a support body (2) adapted to receive and hold the drug delivery device (1), - a needle shield (8) slidably arranged relative to the support body (2), - an inner locking mechanism (12) arranged inside the needle shield (8) between a front end of the needle shield (8) and a front end of the support body (2) and adapted to lock and unlock the needle shield (8).