Precautionary measures are measures taken by the court to reform and rehabilitate the offender and prevent him from reoffending, taking into account the dangerous state. Although these measures were initially established to prevent crime and as an alternative to punishment, today they are a type of lenient punishment that is adopted and applied by the justice and judicial system to dangerous criminals after the crime has been committed. Given its dual nature (preventive and intimidatory aspects), preventive measures have both similarities and advantages with other social reactions. The Afghan legislator has foreseen provisions related to preventive measures in several articles of the former Penal Code and the Penal Code, and has addressed both aspects of preventive measures, and has considered the purpose of its creation to be the education and reform of the accused or convicted person, his readaptation to social life, and the prevention of the occurrence and repetition of crimes, taking into account the dangerous state. The scope of security measures is broad and includes a wide range of measures, from measures depriving of liberty to measures restricting freedom, measures depriving of rights and economic measures. The present study, using a descriptive-analytical method, has examined the definition and nature of security measures, their objectives, implementation conditions and cases from the perspective of the Afghan Criminal Code.