Caterpillar and Okta benefit from the AI boom but have enough other revenue streams to balance out any boom-and-bust cycle.