Agent code to clean before publishing