Direct messages sent on Twitter will be end-to-end encrypted – this means private messages can only be read by the sender and the recipient.
Mr Musk said he would not be able to see users’ messages “even if there was a gun to my head”.
He also tweeted about other new intended features for the platform, including voice and video calls.
When he bought Twitter in 2022, Mr Musk hinted at plans to turn it into a “super-app” with multiple functions. In China the super-app WeChat can be used for everything from social media and ordering food to payments and messaging, but there is not really a comparable platform in the West.
Since then he has made a number of dramatic changes to the social network, including the introduction of a subscription service, and the removal of old blue tick badges, previously used by Twitter as a tool in the fight against the spread of disinformation.
Online Safety Bill criticised
Many Twitter users have called for its private messaging service to be made more secure for a long time. However, Mr Musk’s timing could prove awkward for him in the UK, where the government’s Online Safety Bill wants such messages to be accessible if requested by law enforcement. It says this will help to protect children from abuse.
Messaging platforms WhatsApp and Signal have both criticised this part of the Online Safety Bill, currently near the end of its journey through Parliament.
In April, they said they were concerned the legislation could undermine end-to-end encryption, which is considered by privacy campaigners and activists to be an invaluable tool.
They were two of several messaging services whose heads signed a letter calling for a rethink, saying the bill, in its current form, opens the door to “routine, general and indiscriminate surveillance” of personal messages.
Facebook’s parent company Meta has introduced encryption to its Messenger platform with some exceptions, including Marketplace chats.
Mr Musk said he expected encrypted messaging on Twitter “to grow in sophistication rapidly”.
Cyber-security expert Jake Moore, from ESET, said Twitter was responding to demand from privacy-conscious users.
“Without the use of end-to-end encrypted messaging, Twitter staff and the company itself have the opportunity to read people’s messages,” he told the BBC.
“Although this can reap huge rewards for the platform, with advertisers being able to micro-target users, it is a huge security risk to those messaging without such privacy protection.”
Allow Twitter content?
The BBC is not responsible for the content of external sites.
End of twitter post by Elon Musk
A Home Office spokesperson told the BBC: “The Online Safety Bill applies to all platforms, regardless of their design and functionality. Therefore, end-to-end encrypted services are in scope and will be required to meet their duties of care to users.
“We have made clear that companies should only implement end-to-end encryption if they can simultaneously uphold public safety. We continue to work with the tech industry to collaborate on mutually agreeable solutions that protect public safety without compromising security.”