1. A method of producing a compartment specification for an application, comprising: executing the application; determining a resource request made by the executing application, wherein determining the resource request comprises defining wrapper functions that are called when the executing application makes the resource request, wherein the wrapper functions are to call associated system functions that handle the resource request, and wherein the wrapper functions are provided in a wrapper library; and recording a permission corresponding to the resource request in the compartment specification for the application, wherein the compartment specification contains a list of resources that the application is permitted to access.