I understand your concern. I have seen situations where once the organization classifies you as about to leave, they automatically classify you as increased risk in their system. I have seen cases where when you finish a project, they just decide to terminate you early. Or, regardless of project completion, they "limit risk" by crediting you financially for pending vacation time, but they limit their "risk" by terminating you this week. So instead of 90 days, suddenly your retirement date is sooner.
This could be ok, but if I expected to qualify for retirement by working until 90 days from now, it would seem safer to me to work the 90 days and then tell them. That way, my benefits are locked in. The worst case is that you are still committed to an additional 3 months. You have to decide whether the extra safety is worth it.