A university student accused of removing top secret information worth millions of pounds while on a work placement with GCHQ has pleaded guilty to causing a serious risk to national security.