Is spoofing a user-agent illegal or against the rules?
Changing your own user-agent is legal and common; developers do it to test sites and privacy tools do it to reduce tracking. It becomes a problem when combined with abuse, such as evading rate limits, impersonating Googlebot, or bypassing access controls, which typically violates a site's terms of service and, depending on intent, other laws.