Gmail is reading your emails and attachments to train its AI, unless you turn it off
(www.malwarebytes.com)
it probably is illegal in some countries, the problem is google almost always goes by a do it and see if you get in trouble instead of just following laws.