Question: who spies on hamlet and ophelia?
Answer: Rosencrantz and Guildenstern leave, and Claudius orders Gertrude to leave as well, saying that he and Polonius intend to spy on Hamlet's confrontation with Ophelia. Gertrude exits, and Polonius directs Ophelia to walk around the lobby. Polonius hears Hamlet coming, and he and the king hide.