Safe location of a AC current sensor

I'm not worried.... The only way something can go wrong is if an uninsulated part of the low-voltage wire touches an uninsulated part of the hot wire.

I don't know enough about the electrical codes to know what's "legal"... But, I'll make a few suggestions to make it extra-safe.

If you are winding the toroid yourself, or if it's not already insulated, I'd fully encapuslate it with epoxy, RTV, or plasti-dip, or something. Then, once you've got the hot wire inserted through it, use some zip-ties and/or heat shrink to make sure it stays in-place over the insulated part of the hot wire. Basically just double or triple-insulate everything.

If you can wind the toroid with regular insulated wire, rather than enamel-insulated magnet wire, there is a better chance of the insulation staying intact. But, I don't know if that's practical in your application.