We've just returned from Lima after staying there for 6 days while traveling around Peru. I had been worried about the security of taxis there, So here's my report on the experience.
At the airport, it takes about a minute to find a Green Taxi driver (all of them wear badges and wait for customers). They take you to a taxi,load your luggage and take you to your hotel (it cost us about 45 soles to reach our hotel in Miraflores) It feels very safe at the airport. The police check all arriving cars.
In the city it usually takes 2-5 minutes to catch a taxi. I feel that it's better to choose a cleaner one with a number on the side and a sign that says "taxi". Still, when there were 4 of us in the middle of the day we didn't worry too much about it, and things turned out fine. Not to mention, if you have a smartphone with a GPS app, you can easily tell whether you are on the right route to your destination. Taxis there are cheap and good. If you want, any restaurant or hotel will order a taxi for you. Even in Urubamba, the restaurant ordered for us a clean, high-class taxi.
All in all, I don't recommend buying any expensive transfers to and from airport (as it was said before on this forum,discuss the price before you get in the car) and don't worry about taxis in Lima. Some precautions need to be taken (as you would in any big city), especially at night, and especially downtown. Otherwise,enjoy the city, food,views and very nice people.
If you have any other questions concerning Lima or Peru--even not having to do with taxis--please feel free to ask. I'll be more than happy to answer (I consider myself a hardened veteran, now!)