What is the legal framework for exchanging information with foreign countries?

Updated