IMO, any specialty that has fewer chances of being overtaken by midlevels/technology in 10-20 years is better than anesthesia. I wouldn't count derm among them.
The more interventional the specialty, the safer you'll be, as long as it's not monkey skills and simple procedures (as most are in anesthesia). Midlevels will take over the latter. Even if they will be working under "supervision", do you really want to be legally responsible for 3-4-6-8 people?
The more complex (not just vast) the knowledge base the safer you'll be. Again, midlevels and/or technology will take over things based on pattern recognition and rot memorization. They used to not have access to our level of knowledge base; with technology and Internet, now they do. Plus experience and IQ matter. That's why, after a few years, the smart ones can successfully treat routine patients even in critical care.
The more acute the specialty, the sicker the patients, the higher chances you'll survive as a physician. When time matters, when there is no time for looking up stuff, trial and error, or undo, everybody wants a doctor. Anesthesia for most surgeries doesn't fall into this category. People need to be afraid even of the idea that a midlevel would practice the respective specialty on them.
The worse the lifestyle, geography etc., the safer you'll be. Midlevels are people, and people always tend to go for the low-hanging fruit first. That's why even anesthesia job(market)s are significantly worse on the coasts and in big cities, and better in BFE. You can almost tell the setting-/location-type the attendings who post here work in, just by the level of their happiness. Including mine: East Coast non-rural.
Last but not least, there is a big difference between future probabilities and current realities. While in most specialties the future may be bleak, in anesthesia things are already happening. It's a known entity, an already listing ship. If you could go back in time, would you sail on the Titanic? You might think SDN is biased towards the mental ward, but there is no smoke without fire. Most people don't become/stay happy/unhappy despite their jobs.