Cambridge is not an especially dangerous city, but unfortunately, as in most places these days, there is some street crime, including aggressive begging. It is unwise for people (especially, but not exclusively, women) to walk the streets after dark alone; the simple precaution is to take care that you are accompanied wherever possible. This is sometimes unrealistic, in which case walk in lighted areas, avoid dark alleyways and pathways, and let someone know where you are going. Many students in Cambridge, like students in other cities, carry a personal alarm. The GP has personal alarms for those who want one. The College operates a taxi voucher scheme so College students need not walk back from Pembroke to their hostels alone at night.
Always lock the door to your room, do not leave it open during the day and never sleep with the door unlocked at night. Though the College obviously takes security precautions, it is impossible to totally secure the College grounds and you must take responsibility for your personal security.
Obvious though it may seem, never leave your bag, purse or wallet unattended (eg in a library) as they often get stolen.