This would require all plugins to expose what env variables they expect. Doing this would prevent instances where part of the build ran successfully but then failed later. An alternative to this would be to support rolling back plugins on errors.