The safest pattern is often hybrid
Use AI for a narrow interpretation step and deterministic code for permissions, calculations, routing and final validation.
Know when not to use AI
If a rule is clear, an AI model adds uncertainty without adding useful capability.