Read what you wrote yourself.
the idea of the program is to control computers at a distance.
More carefully now.
control computers from a distance.
Your personal definitions of viruses nay were updated successfully.
Your program is made of parts. One of them ensures unrestricted control of a machine. What ensures that other parts cannot be used to capture text from password fields in browsers, for example? Or search for images and transmit them to some server? Or encrypt files against the user’s will, and only decrypt them by remote command? etc., etc., insert the behavior of the time malware here.
So you think of some program that actually allows you to operate a computer over the network, like Team Viewer, or the remote Windows desktop itself. In such cases you "authenticate" your program to use a user account, and that account must be "manipulated" in real time. The scope of what you can do in this way is very limited, but therefore safer. Perhaps, to achieve your goal, you should study the architecture of these programs. Then you can do something similar. But this isn’t remote control.
Another simple idea: maybe you can solve your problem with a client-server architecture. Instead of creating an end-to-end program for remote control, create services that can be installed locally on machines and that do certain actions within a limited scope. You can make these services meet requests about various network protocols. You can also compartmentalize its functionality per service, so it’s easy to control the authorization of what each one can do. But this isn’t remote yet, okay?