I am looking at a job where I will be driving nails into the apex of a roof to secure roof anchors. My concern is accidentally hitting an electrical line on the underside of the roof. Is this an unwarranted concern given electrical codes and/or standards? On every youtube video and home improvement show the roofers drive nails into the roof as if there were no chance of striking an electrical line on the other side. Left to my own devices, I would probably at least use a non-contact voltage tester (such as the one made by Klein Tools).
Typically if there are any wires in the attic attached to the roof framing, they will be on the underside of the rafters well separated from the surface you are planning on installing the roof anchors.
The only wires I could ever think would be of concern are wires that would run to an attic light. They will be attached to the sides of the rafters well below where nail points will be that you will be driving. All other wires would be in the ceiling joists for room lighting, etc.