To ensure the energy and environmental security of economic development, it is necessary to efficiently manage natural energy resources. In this context, agricultural raw materials are a type of biomass required for the production of biofuels, green electricity and green heat energy. Considering this, the article is devoted to ensuring the optimization of the biomass supply chain (agricultural raw materials) by factor modeling the interaction of agricultural enterprises and enterprises producing green energy. The factors of biofuel production (agricultural raw materials) have been determined. As a result of assessing the level of interaction between agricultural enterprises and enterprises producing green energy, a positive trend in the production of green energy from biofuels was established. Factor modeling is proposed for optimizing the biomass supply chain from agricultural enterprises to enterprises producing green energy. For this, the factors of the dynamics of biomass production (agricultural raw materials) and the logistics of supplying biomass to enterprises producing green energy are taken as a basis. The indicator of the efficiency of the algorithm of interaction between agricultural enterprises and enterprises producing green energy to optimize the supply chain of biomass is the cost indicator of the produced green energy. The main contribution of the article to science is to develop the biomass supply chain based on the optimization of the factor environment of interaction of agricultural enterprises and enterprises producing green energy.