BEIJING—After five years, China is putting the finishing touches on a sweeping new system to punish and reward companies for their corporate behavior. But foreigners worry that, amid the continuing U.S.-China trade dispute, Beijing will use its new corporate “social credit” system as a weapon against international businesses.

While Beijing’s...