Completely different,
Agents are institutions or people who perform special tasks. For example, when I was a soldier, the Armed Police Force, we called the demining engineering company, the chemical defense company, the light artillery company and the special operations company as agents. The secret service company of the field army is actually a company for soldiers to perform special tasks.
Spy means that spy intelligence agencies secretly send to target countries (regions) to engage in various illegal espionage activities, mainly to steal secrets, and also refers to their own citizens secretly recruited by the other spy intelligence agencies to serve them. Broadly speaking, a spy refers to a person who works as a secret detective, spying on confidential information from enemies or competitors or carrying out sabotage activities to benefit the party he works for.
Spy is a kind of spy work, but spy work includes more than spy work.
In the underground party of our party in wartime, all the personnel who carried out infiltration work belonged to special agents. This word has no positive or negative meaning.