All of which means that it's more or less impossible to buy a weapon from a foreign power without opening yourself up wide to that power. You have to let their military advisors onto your bases, to train your troops on the doctrines that go with the weapon. You have to let their logistical specialists into your inventory systems, so they can hook you into the pipelines through which the spare parts and ammo flow. Any of these people could be using their access to snoop on you or worse, but there's not much you can do about that because without them all you've bought is a $100 million paperweight.
If you're the buyer, yes, that absolutely sucks. But, unless you're willing to spend vast amounts of money you don't have to build up your own domestic military-industrial complex, you don't have a lot of alternatives. You either buy into one of the existing ecosystems (American, Russian, European or Chinese), or get curb-stomped by a neighbor who did. Once you're bought into one of those ecosystems you're effectively at the mercy of the state that operates it, of course, but hey, you do what you've gotta do. As the saying goes, the strong do what they will, and the weak suffer what they must.