Kalshi is regulated and trading in this way on Kalshi is explicitly illegal. PolyMarket does not operate under US laws and I don't know if the same insider trading rules are a separate violation on top of just participating.
I don't know the exact legality of it all, but Polymarket wasn't operating in the US up until recently. Even though they are now, they maintain two separate markets. One that is somewhat regulated in the USA and a blockchain based market outside the US. For most of its existence it has very much been offering things that were illegal in the US even though they are based in NY.