She was appointed president of the Board of Supreme Attorneys [es] by the National Board of Justice on 18 December 2013.[2] During the 2014 election for a new attorney general for the 2015–2018 term, Ávalos voted for Carlos Ramos Heredia, cousin of then first lady Nadine Heredia.[3] He had come under scrutiny for reported mismanagement as head of the Organ of Internal Control of the Attorney General's Office, as well as obstruction of justice.[4] Ávalos defended her decision, stating, "I feel that I am being sentenced for voting for Ramos Heredia, but in a state of law I have the right to choose."[5] On 28 April 2014, two attorneys filed a complaint in which they alleged that the National Board of Justice, under the influence of Heredia, had acted in a biased manner to favor Ávalos and another attorney, Nora Miraval Gambini, with their appointments to the Board of Supreme Attorneys, despite having failed written exams required to belong to said body. In exchange, they contended, Heredia received the votes of the new board members to be elected as attorney general.[6]
On 2 August 2018, prosecutor José Domingo Pérez [es] and former attorney general Pablo Sánchez Velarde [es] both argued that Ávalos should take over as the new attorney general.[7] On 8 August, the IDL-Reporteros journalist Gustavo Gorriti described Ávalos as "the best qualified person to assume the office of Attorney General," given the judicial conflict that had started with the CNM Audios scandal, which implicated incumbent attorney general Pedro Chávarry [es].[8] On 22 August 2018, she was appointed by Chávarry as the new head of the Supreme Attorney's Office of Internal Control, replacing Jorge Antonio Bernal Cavero.[9] On 6 January 2019, one day after Chávarry presented his letter of resignation due to media pressure, Sánchez reiterated his support for Ávalos assuming the office of attorney general.[10] Two days later, she was appointed interim attorney general, pending an election by the Board of Supreme Attorneys.[11] On 7 March 2019, she was ratified in office for a three-year term.[12]
During her tenure, she led investigations into alleged misconduct of presidents Martín Vizcarra and Pedro Castillo.[13] With the latter president, she faced criticism from the Congress of Peru for not taking investigations further, though Zoraida Ávalos would respond that she was attempting to respect Article 117 of the Constitution of Peru.[13] She was removed from being a Supreme Prosecutor of the Nation and barred from her position for five years on 21 June 2023 after the Congress of Peru reportedly attempted to gain control of key governmental institutions through Attorney General Patricia Benavides during the Peruvian political crisis.[13]