1. Edit your project's project.xml to make sure Ashcroft is among your dependencies:
    <!-- Test time only -->
  2. Edit project.properties to enable Ashcroft:
    # make sure the ashcroft jar you're using is available in the remote repository (it is at codehaus)
    # install ashcroft as your security manager
    # make sure the jvm forks, otherwise the jvmargs will be ignored

Also see Ashcroft Configuration for a full list of configuration options.