Some of the things that cannot be automated, that might be important:
- assigning people into some roles like manager or military (unless modding raws to use elections, perhaps).
- building new things.
- digging and smoothing new areas.
It can be difficult to defend against all theoretically possible threats without doing any of the three, while still allowing unchecked access for caravans and visitors.
Defending against all currently existing threats in an average world is much easier, though.
This does mean that the fort needs to avoid more dwarves dying of something other than old age than you have coffins for, lest a ghost rise to end the fort.
Also, once your manager dies of old age (provided they're not immortal or elected), you're going to have issues with booze and clothes, though farms, wells and gathering zones will still work - but those also require jobs to be assigned⁎. Even with enough food, this might also hurt the fort through unhappiness, and any tantrum-destroyed building is one that wont be rebuilt. As current dwarves won't stand drinking water without a well, sleeping on cave moss, and having nothing to do but idle, this will eventually end the fort.
⁎ Not sure if you could do this through modding dwarves to have natural skill for plant gathering.