They were accused of 'spying' for a foreign government.
a 'spy' camera/plane [=a camera/plane used for spying]
a 'spy' novel/thriller [=a novel/thriller about spies]
(..) I'm telling you, something's wrong. Yeah, maybe. Look, we need you to keep your ears open, all right? No bullshit. I think Costello's got a spy inside the Special Investigation Unit. You serious? I'm afraid so. Have you heard anything like that? Jesus Christ. (..)2006 The Departed