shall, to the extent practicable, carry out research and development, including operational testing, of technologies and techniques for enhancing the Department’s security and situational awareness support to Federal, State, local, Tribal, and territorial officials relating to combating transnational repression and related terrorism threats, in accordance with applicable constitutional, privacy, civil rights, and civil liberties protections. (d) Definitions In this section: (1) Agent of a foreign government The term agent of a foreign government means an individual or entity that operates subject to the direction or control of— (A) a foreign government