In my experience (Tesla), attention monitoring works well even when I'm wearing sunglasses. The camera can still see my eyes even through dark polarised lenses.
It may depend on the sunglasses, however - other people report problems with sunglasses that have mirrored lenses etc.
It's a matter of time before someone invents sunglasses with eyes painted on the lenses.
Sometimes I wonder if Tesla also has a much better software stack than most other manufacturers. IIRC, Tesla has had interior cameras in their cars for years now and I haven't heard about major issues stemming from it.