In OSX 10.9, I'm running the following code to see if my program is trusted:
NSDictionary *options = @{(id)kAXTrustedCheckOptionPrompt: @YES};
if(!AXIsProcessTrustedWithOptions((CFDictionaryRef)options))
// Not trusted! ...
which opens the dialog to open System Preferences > Privacy > Accessibility to grant my application permission.
When I check the box to give my app permissions and run it again, my app still doesn't have permission and the checkbox is now unchecked.
Simply running AXIsProcessTrustedWithOptions
appears to uncheck that box for some reason.