Despite their malicious usages, spyware programs are generally legal under certain conditions. These include using them to track your device or a minor you have legal control over. These programs are also permitted if the person you're tracking also consents to them.