How much data should be shared in the collaboration? Well, I am interested to know how much data, code, results, etc needs to be shared in a successful collaboration. For example: when engineers collaborate with AI researchers to optimize an engineering problem using specific algorithms, should engineers have access to the whole optimization dataset? Even optimization code should be shared among different parts of a research team?
All of it.  If I don't trust you with my data, why would I collaborate with you?

Note: I'm in favor of sharing all the code and data with the whole world, not just my collaborators.  Once you make intellectual property public, it cannot be stolen.