Unix could really do with a command that you can wrap around this type of call. Either a sanity check on the path part or a safe rm alternative that contains it. I would gladly give up full rm access to know that I can safely (or safer-ly) delete in scripts.
It could be something as simple as a file with paths on each line it - match one path or a path with a glob - and the script fails before destroying anything important.
Overriding it might involve adding a --override=/path/to/something but at least then it would be very explicit