1. A device-implemented method comprising: moving an agent that utilizes a first as-needed canonical rule set in a first execution environment embodied on a first device to a second execution environment embodied on a second device, where the agent utilizes a second as-needed canonical rule set, by at least: discarding a rule in the first execution environment that will not be needed in the second execution environment; retrieving an additional rule that will be needed in the second execution environment; and sending the agent including the additional rule from the first execution environment to the second execution environment.