You don't need a tech, you just need to set some spending on the Espionage tab of the Econ dialog box. (That's also where you can assign empire-wide spies in the latest versions.)
IMO, it's a good idea to set some espionage spending as soon as you can spare a few BC every turn. Having some spies in the bank early can help you get those intel levels against the AIs and be ready for just the situation you describe in your OP.