Intake leaking, heads milled?

Turns out my intake is not square. I put a straight edge on it and shined a light on the other side. It kind of looks like a wave. How much can I machine an intake without getting dangerous? How can I find out how much I need to mill it?