Last week, Ms. Klobuchar, Mr. Warner and Senator John McCain, a Republican from Arizona, introduced a bill that would require digital platforms to report who bought political ads on their sites in the same way that TV broadcast stations must maintain databases with those disclosures. The bill was a response to concern that fake accounts linked to Russia on Facebook and other sites were able to fly past monitors on the sites and easily buy thousands of ads promoting racial and other hot-button issues to sow chaos before the election and to influence the result.

“I welcome this transparency,” Ms. Klobuchar said, “but we need a law in place for two major reasons: Not every company will do this, and you need rules for the road.” She added that the companies should not be left to police themselves.

The announcement from Twitter followed a public relations blitz this month by Facebook’s chief operating officer, Sheryl Sandberg, to announce similar voluntary efforts to tighten standards for ad buyers. Lawmakers are still skeptical, saying there are many unanswered questions about whether the social media sites can prevent the mistakes of the 2016 election on their own.

The changes also raise new issues for politicians. For one, advertising agencies often consider their digital strategy part of their “secret sauce” when trying to sell their services to politicians and campaign strategists. Shining a light on the types of ads, the amount spent on them and how often they change could give valuable information to competing candidates.

It is also unclear whether Twitter will be able to keep up with campaigns’ ever-changing digital targeting, budgets and goals, and the company did not mention how it plans to tackle large-scale misinformation spread by bots.

Many of those automated accounts, along with Twitter users with suspected ties to the Russian government, bombarded the platform without buying advertising. Researchers at the cybersecurity firm FireEye discovered that hundreds or thousands of fake accounts regularly sent out messages criticizing Hillary Clinton — sometimes with identical tweets dispatched seconds apart.

Representative Adam B. Schiff of California, the top Democrat on the House Intelligence Committee, said transparency in advertising alone “is not a solution to the deployment of bots that amplify fake or misleading content or to the successful efforts of online trolls to promote divisive messages.”