If money goes from a campaign to a foreign agent for matters pertaining to the election no matter how many middle men it's still highly illegal.
Not entirely. There must be either or both of knowledge and intent.
"Did they know that a foreign agent had been utilized in a part of this investigation even if through an indirect route?"
"Did they authorize through neglectful oversight that a foreign agent may be utilized to gather information?"
If the answer to any of the questions above is yes, they can be liable. If not, it is the company who is liable.