Military intelligence
By the time of the Battle of Kadesh in  BC Egyptian Pharaoh Ramses II was known to have had court spies. In the biblical Book of Genesis Joseph thought his brothers were Canaanite spies.