The state's top judge on Wednesday said she was confident the "unintended consequences" of the new cash bail law will be changed by state lawmakers to allow judges the ability to keep people in jail deemed too dangerous for release.

“I believe that without compromising the purity of its purpose, the new legislation can be amended, and strengthened, to recognize a narrow exception allowing judges, after a full and fair adversarial hearing, to detain a defendant in those few and extraordinary cases where such a credible threat exists,” Chief Judge Janet DiFiore said.

Her comments came in the annual State of the Judiciary address, a speech that is generally reserved for the state's top judge at the Court of Appeals to lay out plans for streamlining the court system in New York or a focus on issues like access legal services.

DiFiore, a former district attorney from Westchester County, stopped short of an outright endorsement of changes to the law, but signaled a balance could -- and should -- be struck.

"As the public discourse on bail unfolds and our leaders and stakeholders come together to examine the impact of our efforts, I am confident that any identified unintended consequences of this sea change in criminal justice can, and will be, addressed,” she said.

The law ends cash bail requirements for misdemeanor and non-violent felony charges. The measure has sunk in popularity since last year, when it was included in the state budget.

Senate Democrats have proposed an amended version of the law that would abolish cash bail almost entirely, but allow judges to have the authority to remand people.

Senate Majority Leader Andrea Stewart-Cousins on Wednesday sought to assuage the concerns of criminal justice advocates who had sought the changes last year and are skeptical of judicial discretion.

She told reporters the move would include "guardrails" to precent discrimination against defendants of color.