WASHINGTON — Miles Taylor, who revealed on Wednesday that he was the anonymous author of a New York Times Op-Ed article in 2018 that was critical of President Trump, is a lifelong Republican whose service as a senior homeland security official in the Trump administration led him to endorse former Vice President Joseph R. Biden Jr., the Democratic nominee, for president this year.
In the Times essay and in a subsequent book titled “A Warning,” Mr. Taylor anonymously described what he called Mr. Trump’s “amorality,” writing that he witnessed the president’s dysfunctional behavior as part of a “quiet resistance within the administration of people choosing to put country first.”
On Wednesday, he disclosed his identity and his role in the administration as a top official in the Department of Homeland Security. Mr. Taylor, 33, ultimately became chief of staff to Kirstjen Nielsen, Mr. Trump’s third homeland security secretary. In that position, Mr. Taylor was one of the most senior political officials in the sprawling department, which employs more than 240,000 people.
As Ms. Nielsen’s chief adviser, Mr. Taylor was frequently in meetings with top White House officials and sometimes with the president. He had access to the decision-making meetings in the department and with other agencies about a range of topics such as immigration, cybersecurity, terrorism and border security.
A graduate of Indiana University and a Marshall scholar who studied international relations at the University of Oxford, Mr. Taylor spent much of his early career on Capitol Hill. He worked as a staff member on the House Appropriations Committee and later as a senior aide to Republican lawmakers focused on national security issues.
Keep up with Election 2020
For several years, Mr. Taylor served as one of the top aides to Representative Michael McCaul, Republican of Texas, who was the chairman of the House Committee on Homeland Security. Mr. Taylor served as a national security adviser on the committee and was a leading contributor to the task force report on combating terrorist and foreign fighter travel, which the committee released in 2015.
Mr. Taylor joined the Department of Homeland Security in 2017, first as a senior adviser in the agency when John F. Kelly was the secretary and Ms. Nielsen was his chief of staff. When Mr. Kelly left to become the White House chief of staff and was replaced by Ms. Nielsen, Mr. Taylor became the deputy chief of staff and was later promoted to the top job.
After Mr. Trump pushed Ms. Nielsen out of the administration in April 2019, Mr. Taylor was the chief of staff to Kevin K. McAleenan, the acting secretary of the department, until resigning that June.
Google hired Mr. Taylor as its head of national security policy engagement in late 2019. He faced criticism from some of the company’s employees because of his role in the administration when Ms. Nielsen helped enable the separation of migrant children from their families at the border. Google’s leadership defended Mr. Taylor’s hiring and later promoted him to head of advanced technology and security strategy.
Mr. Taylor took a leave of absence from Google this summer to speak publicly about his concerns about the Trump administration and to campaign for Mr. Biden. At the time, he did not reveal that he was Anonymous and in fact denied it on several occasions.
In an interview on CNN on Aug. 21, Anderson Cooper asked Mr. Taylor if he was the anonymous author.
“I wear a mask for two things, Anderson,’’ Mr. Taylor said. “Halloween and pandemics. So no.”
Kayleigh McEnany, the White House press secretary, said on Twitter on Wednesday that the interview was evidence that Mr. Taylor was a liar.
“PROOF: Miles Taylor, who now admits to being ‘Anonymous,’ once told us he was NOT Anonymous. He LIED!” she wrote. “This is everything people hate about Washington — two-faced liars who push their own agendas at the expense of the People. This is the epitome of the swamp!”
Speculation about the identity of Anonymous had been fierce, with readers pointing to specific passages in the Op-Ed essay and the book as clues to who must have written them.
Mr. Taylor’s use of the word “lodestar” in the Times article prompted some to suggest that Vice President Mike Pence was the author because he had used that word in speeches. Others noted that the author appeared to have a particular reverence for Senator John McCain, writing in “A Warning” that he was angry when Mr. Trump refused to keep flags flying at half-staff after the senator’s death.
Several readers of the book noted the author’s repeated references to Cicero, a Roman statesman, politician and philosopher during the time of Julius Caesar and Mark Antony. Mr. Taylor cites Cicero’s work “De Officiis” in assessing Mr. Trump’s behavior in office.
“In the form of a letter addressed to his son, Cicero spelled out how a public servant should behave,” Mr. Taylor wrote in the book. “What does this have to do with Donald Trump? Well, Cicero gave us a useful guide for measuring a leader’s character.”