The best safety device, of course, is prudence. Assuming you're going on your ownnot as part of an organized groupcheck with professional outfitters to see if they have advice on safety precautions. Also talk with people in the U.S. embassy once you get to Peru, as they should be able to tip you off on particular hazards and crime hot spots.
As for yourself, the best thing to do is never look like a would-be "victim." People looking lost, confused, and exhausted, or with their nose buried in a map, are easy prey. Simply practice looking like you're not to be trifled with. And, keep money, credit cards, passport, and other valuables on your body in a money belt or under-the-shirt security holster (for example, Eagle Creek's silk Neck Pouch for $20).
But mainly, have a great trip!