Mexico’s President Enrique Peña Nieto enacted long-discussed constitutional reforms this week, instituting a new anti-corruption regime and heralding it as a “genuine paradigm shift.” Corruption remains one of Mexico’s biggest challenges along with its long-standing security problem, and the reforms aim to boost accountability for both public officials and private entities.

But the system also leaves the president’s immunity from prosecution intact, rankling critics, particularly after Peña Nieto and his wife found themselves at the center of corruption allegations late last year.

Peña Nieto publicly announced the reforms in a ceremony Wednesday, touting them as a historic step for the country. “Building a nation of stronger institutions, more honest authorities and more participatory citizens is a shared responsibility. Mexico is for everyone, and together, with bravery and determination, we take on this challenge,” he said in a speech.

Independent analysts and observers are also cautiously optimistic about the new system. “It’s really a major step,” said Christopher Wilson, deputy director of the Mexico Institute at the Woodrow Wilson International Center for Scholars. “It’s a new approach to anti-corruption – instead of just focusing on one anti-corruption czar or body, this actually strengthens a number of pieces of a broader system, and that’s definitely the right way to be thinking about this and moving forward.”

The reforms to 14 constitutional articles include the creation of an anti-corruption prosecutor tasked specifically with investigating public officials, a framework for penalties on private businesses involved in bribery schemes with officials, and new requirements for public servants to disclose financial assets and potential conflicts of interest, among other changes.

But the president and other elected officials retain their immunity against investigations and prosecution, which sparked heated debate among lawmakers during the approval process. Legislators from Peña Nieto’s ruling Institutional Revolutionary Party argued that under existing law, the president could still be removed from office if he was charged with treason or a felony, including corruption. But critics in the legislature said failing to amend the immunity laws left a gaping hole in the fight against corruption.

“The president will not be subject to the laws of administrative responsibility or the anti-corruption system,” said Roberto Gil, a senator from the opposition National Action party, shortly before the senate approved the laws last month, according to SDP Noticias.

Another opposition lawmaker, Manuel Bartlett of the Workers’ Party, said the reforms left the president immune “in the middle of the worst scandals,” referring to corruption allegations that roiled the presidency last fall.

Those accusations revolved around a $7 million mansion, dubbed the “Casa Blanca” (“White House”). Peña Nieto’s wife, Angelica Rivera, was issuing monthly payments on the house. But a months-long investigation by an independent Mexican news outlet, Aristegui Noticias, found that it was owned by an employee of a construction company that won several lucrative government contracts in the past, raising questions about favoritism and the president’s ties to government contractors. The fact that the company was part of a Chinese-led consortium that won a $3.7 billion contract to build a high-speed rail line inflamed public suspicion even more.

The scandal took its toll: The administration canceled the high-speed rail contract amid the furor, and Rivera opted to sell the mansion, even though she insisted there was nothing unethical in her contract to buy the house. It also contributed to the further decline of Peña Nieto’s approval ratings, which were already sinking in the wake of mass protests over insecurity and crime.

Changing the immunity laws could potentially open up a political can of worms, Wilson noted. “If a ruling party had the power to investigate and seek to prosecute sitting officials from opposition parties in Congress, that’s risky,” he said. “[Changing immunity laws] could be used as a way to establish the rule of law and further the strength of Mexican democracy. But it could, unfortunately, be used to undermine the very checks and balances that make it work.”

Others are waiting to see how the laws will be implemented, the next major test of the anti-corruption agenda. “Corruption is a major problem in Mexico,” Ernesto Gomez Magana, executive director of the Citizen Participation of Citizen Oversight for Accountability, told Mexican news website Sin Embargo. “Given that it has kept pace with impunity, there is little confidence in the government’s actions. The major challenge now is the implementation of the new law.”

Legislators still need to approve secondary laws to follow the constitutional reforms, which will more concretely define what acts constitute corruption and what the corresponding penalties will be. That process means it will likely be several more months before officials can fully roll out the new measures.

Meanwhile, Wilson said the landmark constitutional reforms – and the long, public push to get the changes approved in the legislature – were worth heralding. “This reform only happened because of civil society in Mexico,” he said, noting that NGOs, academics and activists were instrumental in pushing for change. “That is unprecedented in Mexico as well. And that, more than the law itself, makes me very optimistic about the future of fighting corruption in Mexico.”