If, however, you insist on purchasing the in-shell edamame, inspect each pod carefully for brown spots and holes, open each pod carefully and inspect the inside for discoloration and webbing before picking out each bean with your fingers and popping it into your mouth.
One other option is to chalk the worm issue up to added protein and ignore it altogether. They won't make you sick other than totally grossing, even the most hardy among us, out.