1. A mobile device comprising: a processor and memory; an enterprise agent installed on the mobile device, the enterprise agent being configured to enable enterprise applications installed on the mobile device to securely access resources of an enterprise system of an enterprise, the enterprise agent being further configured to collect state metric data values of a plurality of state metrics associated with the mobile device; a plurality of rules stored in the memory of the mobile device, each particular rule of the plurality of rules comprising a rule name, a security key, and an encrypted rule body comprising logic of the particular rule, at least some of the plurality of rules mapping states indicated by one or more of the state metric data values to problems indicative of security risks or productivity risks associated with the enterprise, a first problem of the problems comprising detecting downloading of more than a threshold amount of data to the mobile device within a time period, and a second problem of the problems comprising a disablement of password protection for the mobile device; and remedial action data stored in the memory of the mobile device, the remedial action data specifying remedial actions for addressing the problems, each of the remedial actions corresponding to at least one problem of the problems and being included in at least one rule of the plurality of rules for detecting the at least one problem of the problems, a first remedial action of the remedial actions comprising producing a message on a user interface of the mobile device, the message instructing a user of the mobile device to activate the password protection for the mobile device, and a second remedial action of the remedial actions comprising reducing a download throughput to the mobile device for a portion of the time period; wherein the enterprise agent installed on the mobile device is configured to: programmatically detect instances of the problems by using the rules to analyze the state metric data values using a process comprising: determining a rule of the rules to be analyzed based on the rule name of the rule to be analyzed; decrypting the encrypted rule body of the rule to be analyzed using the security key; evaluating the logic of the rule to be analyzed from the decrypted rule body; and detecting an instance of one of the problems based on the state metric data values; determine a remedial action of the remedial actions that corresponds to the one of the problems based on the decrypted rule body; and respond to the detected instance of one of the problems by executing the remedial action of the remedial actions on the mobile device, wherein the enterprise agent installed on the mobile device is further configured to: detect the disablement of the password protection for the mobile device; respond to the detected disablement of the password protection for the mobile device by producing the message on the user interface of the mobile device, the message instructing the user of the mobile device to activate the password protection for the mobile device; and determine whether the user of the mobile device activated the password protection for the mobile device within a threshold time period.