The excessive use of pretrial detention has demonstrated the violation of rights that exists within Ecuador and its prison system in force in the legislation, because when a person has been prosecuted for a crime that does not exceed 5 years of imprisonment, alternative precautionary measures have been issued within the process, which can be ordered by the administrators of justice in our country, Judges of criminal guarantees, alternative precautionary measures have been dictated within the process, which can be ordered by the administrators of justice in our country, Judges of criminal guarantees, therefore, it should be analyzed that preventive detention becomes an anticipated penalty for the accused person and this precautionary measure should be applied as a measure of last resort; The purpose of this research work is to develop a legal basis to clearly identify the legal situation in Ecuador, specifically in the Azogues canton, with respect to this misused precautionary measure. Therefore, it is necessary to understand several definitions, generalities, historical background, analysis of rights, and to emphasize the essential principles that are violated in relation to pretrial detention, guarantees that persons deprived of their liberty have, making an analysis of what is mentioned in comparative law. Finally, it is worth mentioning the importance of jurisprudential precedents on pretrial detention, which will be analyzed through a legal, constitutional and legal basis found in the Constitution of the Republic of Ecuador, international human rights treaties and the Organic Integral Penal Code, Likewise, a bibliographic review will be carried out using scientific articles on the subject of the excessive use of pre-trial detention in crimes under five years, and surveys will be conducted with free practice lawyers and judges in the city of Azogues, with the purpose of proposing an alternative to help solve this problem.