A preparation able to produce a biopesticide and/or repellent for controlling plant pathogens, comprising at least one nanoporous material and at least one active enzyme, the at least one active enzyme being configured to transform at least one precursor into a biopesticide and/or repellent product. The preparation able to produce a biopesticide and/or repellent for controlling plant pathogens is remarkable in that the at least one active enzyme is immobilized within the at least one nanoporous material.