SAN FRANCISCO — Software companies have led the way in using internal messaging apps like Slack and Google Hangouts to do business. But as workers increasingly turn to those platforms to vent about Silicon Valley’s diversity woes, the same tools are presenting new legal risks to employers.

Ex-Google engineer James Damore’s lawsuit against the search giant contains dozens of pages pulled from internal employee Google+ threads focused on diversity issues, all of which Damore’s lawyer uses to argue that the company has created a workplace hostile to conservative, white men.