Grid bugs are one of the weakest monsters in NetHack. They usually deal no damage at all, unless they manage to zap you as well ("You get zapped!"), and even then the damage is very small. This electric attack does not break your rings and wands unless the grid bug is a higher level than zero.
Grid bugs are unique in that they cannot move or attack diagonally. When polymorphed to a grid bug, attempting to move diagonally will provide the message "You can't get there from here..."
Grid bugs are easily handled by all but the most unfortunate beginning characters, and are nothing to worry about once you pass experience level 2. At that point, they are best left as fodder for a pet you plan to train, as they will always gain at least one maximum HP per kill.
If you need to train up a weapon skill, grid bugs can be useful as target practice.
The concept of grid bugs came from the 1982 Disney film, Tron.
These electronically based creatures are not native to this
universe. They appear to come from a world whose laws of
motion are radically different from ours.
Tron looked to his mate and pilot. "I'm going to check on
the beam connection, Yori. You two can keep a watch out for
grid bugs." Tron paced forward along the slender catwalk
that still seemed awfully insubstantial to Flynn, though he
knew it to be amazingly sturdy. He gazed after Tron, asking
himself what in the world a grid bug was, and hoping that the
beam connection -- to which he'd given no thought whatsoever
until this moment -- was healthy and sound."