WASHINGTON — The Trump administration has begun inserting legal protections into recent trade agreements that shield online platforms like Facebook, Twitter and YouTube from lawsuits, a move that could help lock in America’s tech-friendly regulations around the world even as they are being newly questioned at home.

The protections, which stem from a 1990s law, have already been tucked into the administration’s two biggest trade deals — the United States-Mexico-Canada Agreement and a pact with Japan that President Trump signed on Monday. American negotiators have proposed including the language in other prospective deals, including with the European Union, Britain and members of the World Trade Organization.

The administration’s push is the latest salvo in a global fight over who sets the rules for the internet. While the rules for trading goods have largely been written — often by the United States — the world has far fewer standards for digital products. Countries are rushing into this vacuum, and in most cases writing regulations that are far more restrictive than the tech industry would prefer.

Europe has enacted tough policies to curb the behavior of companies like Facebook and Google and passed laws to deal with privacy, hate speech and disinformation. China has largely cordoned itself off from the rest of the internet, allowing Beijing to censor political content and bolster Chinese tech companies like Alibaba and Tencent. In India, Indonesia, Russia and Vietnam, governments are introducing regulations to ostensibly protect their citizens’ privacy and build domestic internet industries that critics say will stymie the ability of American companies to provide services in those countries.