West Palm Beach, Florida (CNN) The Chinese national Yujing Zhang's hearing in a Florida federal courthouse Monday afternoon highlighted missteps by the Secret Service at virtually the same time news broke that the Secret Service director was being fired.

In all, it amounted to a bumpy afternoon for the agency that protects the President.

As word spread Monday that Secret Service director Randolph "Tex" Alles was leaving, a Secret Service agent took the stand to testify about the woman who had allegedly gained unauthorized access to President Donald Trump's Mar-a-Lago club on March 30 and could be engaged in a spying operation.

Zhang faces two criminal charges, for lying and for entering the restricted grounds while Trump was there. She has not entered a plea and is being held in a Florida jail.

The hour of court testimony Monday from agent Samuel Ivanovich, guided by Zhang's defense attorney Robert Adler, revealed just how serious the security breach around the President that day had been.

Adler, through his questioning, prompted Ivanovich to admit the following details about the Secret Service's process with Zhang and at the private club.

Malware began downloading automatically

The Secret Service had confiscated a thumb drive (and several other electronics) from Zhang that she had carried into Mar-a-Lago. When an agent went to run an analysis on the drive, inserting it into a computer, it immediately began downloading a file. The Secret Service had called it "malicious malware."

It was "very out of the ordinary" -- an authorized download they had never seen before, Ivanovich testified. The agent looking at the drive immediately stopped analyzing it and shut down his computer when he realized what was happening.

In a statement, a law enforcement official speaking on background said that anytime the agency does a forensic analysis on an electronic device, it is done in a controlled environment and on a stand-alone computer, not a Secret Service network computer. Those protocols were followed in this case, the official said.

No video surveillance at Secret Service entry checkpoint

Audio and video surveillance at Mar-a-Lago didn't catch Zhang's entrance to the club -- because those surveillance devices weren't used by the Secret Service at the entry checkpoint. They did check two passports she carried, though. Even 7-Eleven convenience stores have video cameras, the defense attorney pointed out.

Did not record audio during interview

When the Secret Service questioned Zhang at the agency's office after removing her from Mar-a-Lago, the agency videotaped her interview. But unbeknown to the agent who led the questioning, the office didn't record audio of the interview. The room where she was interviewed didn't have that capability. Audio recording capability, the agent had thought, was a standard practice in Secret Service offices.

Mar-a-Lago staff determines who gets in

The Secret Service appeared to rely on Mar-a-Lago staff to determine whether people should be admitted through the security perimeter into the club when the President was there, allowing for the issue of whether Zhang was related to a club member to arise, according to Ivanovich's testimony. It's up to a "host committee" to decide who accesses a site that's under Secret Service restrictions, the agent said.

The President was not on the club grounds during the time Zhang allegedly attempted to enter.

No protocol for flagging multiple phones

The agency also didn't have a protocol to flag the amount or types of electronics Zhang carried with her -- even though one had malware that even an agent performing an analysis on the device found to be unusual. "We don't deny someone for having so many cell phones. That's not a direct violation of our restricted access," Ivanovich told the judge.

Zhang had four phones and other devices -- plus she left several more, including a radio signal detector, in her hotel room nearby.

Language barrier

Zhang was clearly a Chinese national, with two Chinese passports, her first language Mandarin. But Ivanovich and others in the Secret Service took hours to bring in an available agent who spoke Mandarin and could help translate during her interview.

The Secret Service spoke with her -- and she answered them -- in English during more than four hours of questions, Ivanovich said. Her facility with reading English and responses led them to believe she had no trouble with the language. But language, the Secret Service had said, had led to the confusion over her relation to a Mar-a-Lago member.

Once the Mandarin-speaking agent was involved, he would speak with her to give her "further understanding" in the interview, Ivanovich said. Zhang used a translator in court on Monday to listen to the proceedings, but answered questions from the judge in English.

The breach has led Democrats in Congress to ask for more information about security at Mar-a-Lago. The criminal complaint filed by prosecutors and the Secret Service against Zhang last week highlighted how a Mar-a-Lago beach club manager erroneously thought Zhang was related to a member. The President, whose family business owns the club, has called Zhang's entrance onto the property a fluke and said he wasn't concerned.