One idea to consider might be going into safety critical embedded work (e.g. brake controllers, critical systems for airplanes/trains, medical devices, some industrial systems, ...). AI hasn't penetrated much here yet. It isn't at all clear how or if you would be able to certify the process for example.
That might change with time, but for now, all I see AI used for is additional code review and side scripts/tooling that don't need to be safety rated.
Of course, that might mean entirely switching language (C, C++ or increasingly but still in minority Rust), learning entirely different skills (control system theory, real time systems, possibly formal verification but usually not), etc.