WEST PALM BEACH, FLORIDA - APRIL 03: President Donald Trump's Mar-a-Lago resort is seen on April 03, 2019 in West Palm Beach, Florida. Reports indicate that at over the past weekend a woman from China was arrested and found to be carrying four cellphones and a thumb drive infected with malware after she made her way into the resort during President Trump's visit.(Photo by Joe Raedle/Getty Images)
Joe Raedle/Getty Images North America/Getty Images
WEST PALM BEACH, FLORIDA - APRIL 03: President Donald Trump's Mar-a-Lago resort is seen on April 03, 2019 in West Palm Beach, Florida. Reports indicate that at over the past weekend a woman from China was arrested and found to be carrying four cellphones and a thumb drive infected with malware after she made her way into the resort during President Trump's visit.(Photo by Joe Raedle/Getty Images)
Now playing
02:13
New audio released of woman in Mar-a-Lago security breach
ST. PAUL, MN - NOVEMBER 6:  Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before.  (Photo by Mark Erickson/Getty Images)
Mark Erickson/Getty Images
ST. PAUL, MN - NOVEMBER 6: Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before. (Photo by Mark Erickson/Getty Images)
Now playing
03:00
Walter Mondale dies at 93
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
Now playing
01:25
Bush calls on Congress to tone down 'harsh rhetoric' on immigration
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC.  Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Tasos Katopodis/Getty Images
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC. Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Now playing
03:18
Berman on Cruz's latest tweet: 'The pot calling the kettle violent'
Now playing
01:57
Chuck Hagel criticizes Trump's statement on Afghanistan
gun laws shootings Comer pamela brown nr vpx _00015627.png
CNN
gun laws shootings Comer pamela brown nr vpx _00015627.png
Now playing
02:23
'I can't answer that': Kentucky lawmaker responds to CNN on gun policy
Now playing
02:39
National security adviser: Russia will face consequences if Navalny dies in prison
Rep. Marjorie Taylor Greene (R-GA) speaks during a press conference outside the U.S. Capitol on February 5, 2021 in Washington, DC. The House voted 230 to 199 on Friday evening to remove Rep. Marjorie Taylor Greene (R-GA) from committee assignments over her remarks about QAnon and other conspiracy theories.
Drew Angerer/Getty Images
Rep. Marjorie Taylor Greene (R-GA) speaks during a press conference outside the U.S. Capitol on February 5, 2021 in Washington, DC. The House voted 230 to 199 on Friday evening to remove Rep. Marjorie Taylor Greene (R-GA) from committee assignments over her remarks about QAnon and other conspiracy theories.
Now playing
03:20
Marjorie Taylor Greene lashes out at media after backlash over controversial caucus
AP
Now playing
03:16
Maxine Waters: Jim Jordan is a bully and I shut him down
US Representative Marjorie Taylor Greene, Republican of Georgia, leaves her office on Capitol Hill on February 4, 2021 in Washington, DC.
NICHOLAS KAMM/AFP/Getty Images
US Representative Marjorie Taylor Greene, Republican of Georgia, leaves her office on Capitol Hill on February 4, 2021 in Washington, DC.
Now playing
03:51
Marjorie Taylor Greene launching 'America First' caucus
US President Joe Biden delivers remarks on Russia at the White House in Washington, DC on April 15, 2021. - The United States announced sanctions and the expulsion of 10 Russian diplomats Thursday in retaliation for what Washington says is the Kremlin's US election interference, a massive cyberattack and other hostile activity.
JIM WATSON/AFP/Getty Images
US President Joe Biden delivers remarks on Russia at the White House in Washington, DC on April 15, 2021. - The United States announced sanctions and the expulsion of 10 Russian diplomats Thursday in retaliation for what Washington says is the Kremlin's US election interference, a massive cyberattack and other hostile activity.
Now playing
02:22
White House backtracks on refugees decision after criticism
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Andrew Harnik/Pool/Getty Images
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Now playing
02:44
'National embarrassment': Biden reacts to mass shootings
MOSCOW, RUSSIA - APRIL 15:  Russian President Vladimir Putin (L) talks to talks to Foreign Minister Sergey Lavrov during a meeting with Uzbekistan President Islam Karimov in the Kremlin on April 15, 2013 in in Moscow, Russia. Karimov is on a state visit to Russia. (Photo by Sasha Mordovets/Getty Images)
Sasha Mordovets/Getty Images
MOSCOW, RUSSIA - APRIL 15: Russian President Vladimir Putin (L) talks to talks to Foreign Minister Sergey Lavrov during a meeting with Uzbekistan President Islam Karimov in the Kremlin on April 15, 2013 in in Moscow, Russia. Karimov is on a state visit to Russia. (Photo by Sasha Mordovets/Getty Images)
Now playing
02:07
Russia to expel 10 US diplomats in 'tit-for-tat response' to Biden sanctions
Now playing
03:10
Avlon: Here's what we know 100 days since the Capitol riot
A Russian flag flies next to the US embassy building in Moscow on October 22, 2018. - US national security advisor John Bolton is in Moscow holding meetings with senior Russian officials following Washington's weekend announcement of withdrawal from the Cold War-era Intermediate-Range Nuclear Forces Treaty, known as the INF. (Photo by Mladen ANTONOV / AFP)        (Photo credit should read MLADEN ANTONOV/AFP via Getty Images)
Mladen Antonov/AFP/Getty Images
A Russian flag flies next to the US embassy building in Moscow on October 22, 2018. - US national security advisor John Bolton is in Moscow holding meetings with senior Russian officials following Washington's weekend announcement of withdrawal from the Cold War-era Intermediate-Range Nuclear Forces Treaty, known as the INF. (Photo by Mladen ANTONOV / AFP) (Photo credit should read MLADEN ANTONOV/AFP via Getty Images)
Now playing
02:17
Political scientist: US-Russia relations are in the toilet
WASHINGTON, DC - JUNE 13: Rep. Michelle Lujan Grisham (D-NM) speaks during a news conference on immigration to condemn the Trump Administration's "zero tolerance" immigration policy, outside the US Capitol on June 13, 2018 in Washington, DC. (Photo by Toya Sarno Jordan/Getty Images)
Toya Sarno Jordan/Getty Images
WASHINGTON, DC - JUNE 13: Rep. Michelle Lujan Grisham (D-NM) speaks during a news conference on immigration to condemn the Trump Administration's "zero tolerance" immigration policy, outside the US Capitol on June 13, 2018 in Washington, DC. (Photo by Toya Sarno Jordan/Getty Images)
Now playing
02:39
Governor settles with former campaign staffer who accused her of sexual mistreatment
(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.

CNN’s Mary Kay Mallonee contributed to this report.