Yes, research computing and build the Spy Agency. Doesn't have to be in your capital, but often your capital is your highest production city.
Building the agency gets you 3 covert agents (spies). You can send the to other cities, or keep them in one of your cities to reduce the effectiveness of foreign spies.
Fulfilling a quest can get you another spy. Building a Feedsite Hub building or Command Center building in a city will bring up a choice, where one of the choices is an additional covert agent.
A third use for spies (besides their missions in AI cities or protecting a city at home) is to keep some in HQ, in support of your "National Security Agenda." I nearly always choose the one which boosts production of wonders by 1% per spy at headquarters. Then, as I get ready to build the victory wonder, I begin bringing them home from wherever they are. It's not a huge boost, but it helps.