Alejandro Mayorkas, secretary of the U.S. Department of Homeland Security, speaks during a new conference in Brownsville, Texas, U.S., on Thursday, Aug. 12, 2021.

Veronica G. Cardenas | Bloomberg | Getty Images

WASHINGTON – The Department of Homeland Security will establish a new task force to examine how the government can use artificial intelligence technology to protect the country.

DHS Secretary Alejandro Mayorkas announced the task force Friday during a speech at a Council on Foreign Relations event. It comes as popular AI tools like ChatGPT have captured the public’s attention and triggered hopes and fears about how it might be used in the future. Mayorkas’ announcement shows that the Biden administration is looking for ways to embrace AI’s potential benefits, while thinking through the possible harms.

“Our department will lead in the responsible use of AI to secure the homeland,” Mayorkas said, while also pledging to defend “against the malicious use of this transformational technology.”

He added, “As we do this, we will ensure that our use of AI is rigorously tested to avoid bias and disparate impact and is clearly explainable to the people we serve.”

Many tech leaders have raised concerns about the rapid development of so-called generative AI models, fearing that their advancement and potential harms will outpace the ability to input reasonable safeguards. But at the same time, tech companies developing advanced AI models and policymakers recognize the U.S. is in a fast-moving race against China to create the best AI.

Mayorkas gave two examples of how the task force will help determine how AI could be used to fine-tune the agency’s work. One is to deploy AI into DHS systems that screen cargo for goods produced by forced labor. The second is to use the technology to better detect fentanyl in shipments to the U.S., as well as identifying and stopping the flow of “precursor chemicals” used to produce the dangerous drug.

Mayorkas asked Homeland Security Advisory Council Co-Chair Jamie Gorelick to study “the intersection of AI and homeland security and deliver findings that will help guide our use of it and defense against it.”

The announcement adds to the government’s efforts to beef up its AI capabilities. On Wednesday, U.S. Central Command, which oversees the country’s mission in the Middle East and northern Africa, announced it had hired former Google AI Cloud Director Andrew Moore to serve as its first advisor on AI, robotics, cloud computing and data analytics. CENTCOM said Moore would advise its leaders on applying AI and other technologies to its missions and help with innovation task forces.

Subscribe to CNBC on YouTube.

WATCH: Can China’s ChatGPT clones give it an edge over the U.S. in an A.I. arms race?