Taylor Swift has claimed ownership over many things. In 2015, she applied for trademarks for lyrics including “this sick beat” and “Nice to meet you. Where you been?” A few months later, she went further, trademarking the year of her birth, “1989”. We now know it didn’t end there. A new book reveals that, a year later, Swift claimed ownership of the name Tay – and threatened to sue Microsoft for infringing it.

In the spring of 2016, Microsoft announced plans to bring a chatbot it had developed for the Chinese market to the US. The chatbot, XiaoIce, was designed to have conversations on social media with teenagers and young adults. Users developed a genuine affinity for it, and would spend a quarter of an hour a day unloading their hopes and fears to a friendly, yet non-judgmental ear.

The US version of the chatbot was to be called Tay. And that, according to Microsoft’s president, Brad Smith, is where Swift’s legal representatives got involved. “I was on vacation when I made the mistake of looking at my phone during dinner,” Smith writes in his forthcoming book, Tools and Weapons. “An email had just arrived from a Beverly Hills lawyer who introduced himself by telling me: ‘We represent Taylor Swift, on whose behalf this is directed to you.’

“He went on to state that ‘the name Tay, as I’m sure you must know, is closely associated with our client.’ No, I actually didn’t know, but the email nonetheless grabbed my attention.

“The lawyer went on to argue that the use of the name Tay created a false and misleading association between the popular singer and our chatbot, and that it violated federal and state laws,” Smith adds.

Swift was, it turned out, right to be concerned. Not because the Tay chatbot grew to become as popular as XiaoIce, but because of what happened next: the chatbot was turned on and plugged into Twitter, where it promptly became a Nazi.

Tay had been built to learn from the conversations it had, improving its speech by listening to what people said to it. Unfortunately, that meant that when what Smith describes as “a small group of American pranksters” began bombarding it with racist statements, Tay soon began repeating the exact same ideas at other interlocutors. “Bush did 9/11 and Hitler would have done a better job than the monkey we have now,” it tweeted. “WE’RE GOING TO BUILD A WALL, AND MEXICO IS GOING TO PAY FOR IT,” it added.

Within 18 hours, Microsoft disconnected the bot from the Tay Twitter account and withdrew it from the market. The event, Smith writes, provided a lesson “not just about cross-cultural norms but about the need for stronger AI safeguards”.

But it did, at least, get Taylor Swift off its back.