Afghanistan vows to root out foreign spies in government