Petty theft is common but violent crime is rare. Visitors should pay particular attention while using public transportation, and not leave personal belongings in rental cars. You are encouraged to exercise the same level of caution they would in major cities or tourist areas throughout the world (like New York City or Paris). Local law enforcement agencies have limited capabilities so you shouldn’t expect a CSI type of investigation if your house is burglarized. Use common sense like avoid walking alone down dark alleys at nights, same precautions you would take in any major city. Don’t flash money around and leave the gold chains at home when you’re out walking downtown.
You can check the US Embassy crime alert section here: http://costarica.usembassy.gov/uscitizen/the-threat-from-crime2.html