The presence of the E Court system in online trials creates legal loopholes regarding violations of the defendant's rights in trials regarding Due Process Law. The court cannot ignore this fact. Therefore, it is necessary to carry out an in-depth study and analysis to ensure that the implementation of electronic trials does not violate important principles needed to maintain justice and the human rights of defendants during the trial process. Formulation of the Problem of this Thesis How to regulate the defendant's consent in the implementation of electronic criminal trials in Indonesia? and What is the electronic criminal trial mechanism that guarantees due process? The research method used by the author is Normative Juridical to study E-Court from the perspective of applicable laws and regulations and legal principles. The results of the research are that the regulation of the defendant's consent in carrying out criminal justice electronically in Indonesia based on Perma 4 of 2020 is an effort to protect the defendant's rights in the criminal justice process. The defendant's consent is necessary to ensure that the defendant understands his or her rights and is not forced to participate in the trial electronically. Perma Number 4 of 2020 regulates several ways to carry out electronic trials, such as defendants attending the trial from the place of detention with or without being accompanied by a Legal Advisor, or defendants who are not detained can attend the trial in the Court's court room or at the Prosecutor's office accompanied or without being accompanied by an Advisor. Law. This defendant consent mechanism must also pay attention to complete and timely notification to the defendant, the defendant's access to necessary technology, the defendant's right to be represented by a lawyer, preservation of trial recordings, and special consideration of personal rights and data security.