Anybody visiting Indonesia is wise to think about their safety and security. The good news is that, given a minimum of precautions, you can have a perfectly safe and enjoyable trip to anywhere in Indonesia.
In all major cities, such as Jakarta, Surabaya or Bali, hotels, shopping malls and other places that may attract large numbers of people have security precautions in place. These generally include visual searches of all vehicles entering the parking areas and security checks (looking in bags, metal detectors) on all people entering the buildings. The checks are generally unobtrusive and should not pose a problem for tourists. As with anywhere else in the world today, you should be cautious about visiting nightclubs or other places that pack in the people - especially westerners. Be aware of the locations of exits and stay on your guard.
Theft can be a bit of a problem in Indonesia, but taking a few simple precautions can keep you and your valuables safe. Unfortunately, pilferage is quite common at airports in the country, so make sure all compartments of your checked bags are sealed. If you don't want to invest in a lot of locks, I've found plastic tie wraps to be a good means of ensuring that the external compartments of my bags don't get broken into. The tie wraps come in bags of 100 or more, so I just take a few extra with me on trips. You cut the old ones off if you need to get into the bag, and replace the tie with another one to re-close the compartment. I even seal empty compartments in this manner, since there have been accusations of airport employees trafficking drugs in unsuspecting passengers' bags.
Pickpockets can also be a problem in places with a lot of tourists. Pickpockets often work in gangs, with one person posing as a street vendor, so be wary of anyone, even children, selling things on the street. Be careful where you keep your valuables. Fanny packs are big give-aways and should generally be avoided.
Lastly, a word about scams and touts. As in any poor country that attracts a lot of tourists, there are a lot of people hoping to relieve you of your money, one way or another. The assault you receive when arriving at airports can be particularly annoying. If you really hate that kind of thing, consider ordering an airport transfer in advance so you'll be greeted at the airport and taken to your hotel without hassle. In addition, in places like Kuta on Bali, you'll find it hard to walk down the street without having someone try to sell you a tour, or something less savory. The best approach is to say "no thanks" and keep walking.