Taking inspiration from existing automation tools could also be a good starting point beyond capabilities.
Shortcut for macOS and iOS has disabled-by-default advanced options Allow Running Scripts, Allow Sharing Large Amounts of Data, Allow Deleting without Confirmation, Allow Deleting Large Amounts of Data. [0]
[0] https://support.apple.com/guide/shortcuts-mac/adjust-privacy...