How to protect the computer itself

I took apart the usb cable or rather cut into the wire placed a diode in series with the positive or negative wire to allow current to flow in to arduino not out...