Companies already have to protect themselves against employees trading the company's shares with insider information. They typically do that in a number of ways:
- Making sure that material insider information, like business results and upcoming major transactions, is announced to the stock market as soon as possible.
- Establishing a general period in which employees can't trade, typically in the run-up to major results announcements (quarterly/annual).
- This period is shorter for senior management of the company who are likely to have more insider information.
- Specifically telling people who have material information (e.g. working on a merger) that they can't trade.
Taken together, this tends to mostly mitigate the risk of employees trading with insider information, though it's probably not perfect.
In practice, the company itself's knowledge of insider information is the same as that of its senior management. So it makes sense for a company to be allowed to trade under the same conditions as its senior management.
From https://corpgov.law.harvard.edu/2013/03/14/questions-surrounding-share-repurchases/ :
If the company is repurchasing outside of a Rule 10b5-1 trading plan,
it should limit its purchases to open window periods when officers and
directors are able to buy and sell securities of the company. In
addition, the company also can choose to disclose any material
non-public information prior to any share repurchase if it is in
possession of material non-public information at a time when it is
seeking to make a share repurchase outside of a Rule 10b5-1 trading
plan.
As mentioned in the quote, a company can also set up a trading plan in advance (at a time when it doesn't have inside information) to be executed unconditionally in the future. Then even if the company comes into possession of inside information, it won't be using this knowledge to direct trades.