We have trade secret laws, national security laws as well as patent laws, at least in the US, as do many/most countries.
IMO, the US govt doesn't prosecute violators, especially in terms of foreign spy programs against domestic companies nearly enough.