First off, this isn't related to Sentry mode, as some posters have intimated. It's just the regular alarm -- once the vehicle is locked, opening the doors (from the inside or the outside) sets it off.
My rule of thumb is never let someone stay in the car unless you unlock it from the app, or...