Does keeping an eye on colleagues and writing reports about them come under the heading of spying that is forbidden?
Question

What is the Islamic view on a man who was given instructions to tell the management about anyone who makes a mistake or transgresses the limits with regard to work? Is this action regarded as harming others, or is it regarded as a trust that the management has allocated to him?
Praise be to Allah.Ruling on keeping an eye on employees
There is nothing wrong with accepting the task of keeping an eye on workers and telling the management about their mistakes or transgressions having to do with work, on condition that this does not involve spying on something that they want to conceal, because it is haraam to spy on people.
Allah, may He be exalted, says (interpretation of the meaning): “O you who have believed, avoid much [negative] assumption. Indeed, some assumption is sin. And do not spy or backbite each other. Would one of you like to eat the flesh of his brother when dead? You would detest it. And fear Allah; indeed, Allah is Accepting of repentance and Merciful” [al-Hujuraat 49:12].
Al-Bukhaari (5144) and Muslim (2563) narrated from Abu Hurayrah that the Prophet (blessings and peace of Allah be upon him) said: “Beware of suspicion, for suspicion is the falsest of speech. Do not spy on one another; do not seek out one another’s faults; do not hate one another; and be brothers.”
And the Prophet (blessings and peace of Allah be upon him) said: “O you who have paid lip service to Islam but faith has not entered your hearts, do not harm Muslims or shame them or seek out their faults, for whoever seeks out the faults of his fellow Muslim, Allah will seek out his faults, and if Allah seeks out a person’s faults,  He will expose him even in the innermost part of his house.” Narrated by at-Tirmidhi (2032) and Abu Dawood (4880).
As-Safaareeni said in Ghidha’ al-Albaab (1/263): It says in ar-Ri‘aayah: It is haraam to raise the issue of an evil deed that was done in secret, according to the most correct scholarly view…
Al-Hajaawi (may Allah have mercy on him) said: The one who conceals himself is one who does something in a place where usually no one is aware of what he does except those who are present, then he conceals it and does not speak of it.
As for the one who does something in a place where his neighbours could see him, even if it is in his own house, then he is regarded as one who commits sin openly and does not conceal himself. End quote.
Ruling on eavesdropping on employees and transmitting what they say
That includes eavesdropping on employees’ conversations, accessing their devices or inspecting their personal belongings without their knowledge. All of that comes under the heading of spying, which is haraam.
As for reporting something that is done openly, such as an employee falling asleep on the job, or sitting and not doing any work, or coming late, or leaving early, and the like, this does not come under the heading of spying and there is nothing wrong with it.
But one should be careful to avoid transmitting what they say about one another or about the management, because that comes under the heading of spreading malicious gossip.
The one who is given this task must do his utmost to speak the truth, and offer sincere advice to the employee before reporting him. He should strive to be gentle as much as possible, so as to be included in the supplication of the Prophet (blessings and peace of Allah be upon him). Muslim (1828) narrated from ‘Aa’ishah (may Allah be pleased with her) that she heard the Messenger of Allah (blessings and of Allah be upon him) saying: “O Allah, whoever attains any position of authority over my ummah and is harsh towards them, be harsh towards him, and whoever attains any position of authority over my ummah and is kind towards them, be kind towards him.”
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked: I work in the accounting field, and I keep an eye on workers with regard to the time spent at work and the quality of their work, and I report to the owner on how the work is progressing. That includes, for example, telling him about employees who were absent or came late, or who made a mistake, or did such and such, and so on. That is so that the business owner will be aware of any problems so that he can fix them. Is there any sin on me for doing that, even though I offer sincere advice to the employees before I speak to the company owner, but that has been without success? Please advise me, may Allah reward you.
He (may Allah have mercy on him) replied:
What the questioner is doing is praiseworthy and he will be rewarded for it. The honest person should show no favouritism to anyone. Allah will reward a man who advises the workers first, then if they mend their ways he leaves them alone, but if they do not do that, he tells the boss about them. This is his duty that is expected of him. I ask Allah to make him steadfast and help him, and to bring forth more like him, because people like him are very rare nowadays, and the reason for that is shyness or embarrassment, or because he may say: I do not want anyone to lose his job because of me, and the like. All of that is mistaken, for Allah is not too shy to tell the truth, and if a person is let go from his job because he did not do what he was required to do, then he only has himself to blame.
End quote from Fataawa Noor ‘ala ad-Darb (24/2).
And Allah knows best.