1 Introduction

In recent years, the world population has faced many challenges in the field of healthcare. Its associated problem, including various diseases like cancer, diabetes, cardiovascular disorder, multiple drug resistance, etc. are major defiance for the human fraternity (Qadri et al. 2021; WHO 2020). Even in the era of vaccines and drugs, infectious diseases are responsible for the high mortality rate. Diseases like diarrhea cause the death of around 525 000 children under five years of age (Tesfaye et al. 2020). Around 33 million populations are infected with HIV and reported to be two million deaths last decade (Laga et al. 2015). Mycobacterium tuberculosis is recorded to infect around one-third of the world's population. In tropical and subtropical areas, underprivileged populations are infected with malaria, accounting for about one million deaths (Cárdenas et al. 2021). Similarly, COVID-19 (Pokhrel and Chhetri 2021) and other pandemics as monkeypox (Bhattacharya et al. 2022), immunosuppressive disorders, and the appearance of highly virulent viruses open a new discussion for future treatment and remedies to address those problems (Chatelain 2015). An international health agency prioritizes the conservation of natural resources to create novel therapeutics. Plants are major natural resources and have therapeutic potential that has been tracked down thousand years ago and utilized for the treatment of many diseases (Abel 2013). Today around 40% of modern medicines are plant-derived because of fewer side effects. Plants generate various secondary metabolites, which may be broken down into the chemical categories of phenolics, terpenes, and alkaloids (Sharma and Singh 2021). Secondary metabolites secreted by the plant during different stress and developmental stages make them competitive in their inhabitant (Pang et al. 2021). These small molecules exert a significant impact on plants themselves and also on humans and other organisms (Teoh 2016).

Plants are the natural inhabitant of microorganisms as they form a symbiotic association with them to accomplish one and all requirements. Endophytes (endosymbiotic microbes colonize in plants) and microbes and their bioactive metabolites are important natural sources for promising therapeutic agents. The therapeutic potential of endophytes and their metabolites as biotherapeutic agents has garnered a lot of interest (Xia et al. 2022). Endophytes are associated with the healthy tissue of the plant (Sadrati et al. 2013) and reside in the interior sections of the plant, such as the root, the stem, the petiole, and other components that are referred to as endophytes (Ma et al. 2013; Deepthi et al. 2018). In 1898, Vogl was the first person who reported that endophytic mycelium was present in the grass seeds of Latium teinutentuin (Waghunde et al. 2021). Around 300,000 plant species, each individual having one or more endophytes and having one to hundred strains of endophytes varying according to the host system (Gao et al. 2018). They got much attention when it became apparent that entophytes can produce bioactive secondary metabolites with varied molecular structures, which are barely impersonated by synthetic chemistry (Mengistu 2020). Endophytes play a crucial role in plant development, and survival, and regulate some defense mechanisms. They are formed to be a composite equilibrium to achieve the host boundary and build a mutualistic association with the host (Alam et al. 2021; Nanda et al. 2019). During stressed conditions in the plant, endophytes secreted a range of secondary metabolites in plant cells and incorporated them into the stressed pathways (Nanda et al. 2019). Secretion of stress-controlled molecules like gibberellins (GB), cytokinin (CIS), salicylic acid (SA), and indole-3-acetic acid (IAA) enhance plant growth and development and is responsible for many physiological changes in the plant (Shekhawat et al. 2021; Duc et al. 2018; Shaffique et al 2022).

The biochemical and pharmaceutical industries rely on endophytic fungi as a source of new therapeutic biomolecules that could be immune-suppressant compounds, anti-cancer drugs, plant growth promoters, anti-microbial volatiles, insecticides, anti-oxidants, and antibiotics, offer significant potential for application in medicine. Furthermore, endophytic microorganisms can lessen a plant's capacity to endure nutritional deficiency, high temperatures, salt, trace metals, and water scarcity (Eid et al. 2021). Amylase, cellulase, lyase, and laccase are important enzymes that have significant industrial applications and endophytes play a role in their synthesis (Sharma et al. 2021). Research suggested that the fungal endophytes found to be heterotrophic organisms with various life cycles in natural ecosystems form a symbiotic relationship with plants. The fossil record also reported that endophytic fungi and host plants were associated for 400 million years and intimately involved in the ecology, proliferation, fitness, and steer the evolution of their life (Krings et al. 2007). Plant systems change their habits from water to terrestrial atmosphere with many challenges like nutrient-deficient soil, high carbon dioxide varying temperature conditions, and water availability. Fungal endophytes provided tolerance to the plant during adverse conditions and fixed them in the soil. In the evolutionary period, fungal endophytes evolved themselves in the plant environment through an alteration of genetic behavior, uptake of the DNA, and started producing secondary metabolites (Arora and Ramawat 2017). At least one plant harbour one or more fungal endophytes, especially woody plants containing hundreds of species of fungal endophytes. The fungal endophytes are found in different geographical and climate regions, fin-ray ubiquitously distributed, and rich in species diversity. The abundance of fungal endophytes with great extent, ubiquitous nature, diversity, and wide range of ecological functions are shown to be greatly adapted for plants under worldwide distribution and selective pressure (Rodriguez et al 2009).

All these findings indicate that fungal endophytic population colonization inside the host tissue confers tolerance under specific environmental stresses condition and is responsible for the survival of plants. Extensive research on fungal endophytes (FE) found their crucial role in abiotic and biotic stress tolerance, nutrient supply, growth, and plant development. When searching for natural products mediated by endophytes, researchers may explore EF. It is well established that many bioactive metabolites (BM) with potential pharmacological effects are produced by EF (Tiwari and Bae 2022). The bioactive compounds produced by EF albeit receiving much less attention. The development and production of biomass need a thorough understanding of endophyte ecology, bioactive components, and the biotransformation of substrates. Considering the information available on EF, the article is aimed to review the sampling, optimization, production, and extraction of the secondary metabolites from EF and the pharmacological relevance of the different bioactive metabolites produced by endophytic fungi associated with plants (Fig. 1).

Fig. 1
figure 1

Entry and Colonization of the fungal endophytes in response to biotic (herbivores and pathogens) and abiotic (drought, salinity, heavy metals, and others) stresses and production of secondary metabolites to modulate plant defense, plant growth, and functional role in the pharmacology

2 Sampling and optimization of media for the production of BM from EF

The first steps in sampling and isolation of bioactive molecules from EF are collecting plant material having EF from different geographical areas and pre-processing the plant material, which may involve surface cleaning, slicing, and selecting media. Surface sterilizing agents like mercuric chloride (HgCl2), ethanol, etc., are used to wash and surface sterilize the plant components (leaves, stems, seeds, etc.) (Bisht et al. 2016). They are subsequently diced and cultured in LB media on a PDA (potato dextrose agar) plate. Hyphal tips are harvested from the fungus and then transferred to PDA slants, where they are tested for bioactive secondary metabolites after an extended period of incubation (Sharma et al 2016). It is vital to build a suitable cultivation system for commercial use because EF can produce many biologically active metabolites. Endophytes can be grown through liquid-submerged or solid-state fermentation (SSF). EF fermentation is fruitful, continuous, and environmentally beneficial. Submerged culture produces mycelial biomass and bioactive metabolites faster. It needs less time and has fewer contamination risks. Extensive research has been done on bioactive compounds produced by endophytic fungus in submerged fermentation. In liquid fermentation, temperature, pH, aeration, and agitation affect secondary metabolite production. In addition, each of these different characteristics has been optimized, which has led to an increase in the overall production of BM (Debbab et al. 2013; Brader et al 2014). Various researchers used liquid-submerged fermentation to manufacture myriads of BM. These include antibiotics, anti-oxidants, pigments, enzymes, etc. (Mrudula and Murugammal 2011; Patil et al. 2016). Similarly, cellulase enzyme production from Pestalotiopsis sp (Chen et al. 2011) and glucoamylase from Aspergillus flavus (Karim et al 2017) has been performed previously. Vimal and Kumar 2022 reported optimized production of medically important L-asparaginase enzyme under solid-state and submerged fermentation from agricultural wastes. Similarly, microorganisms are cultured on Wheat bran, Cajanuscajan (red gram), Phaseolus mungo (mung bean), and Glycine max (soybean) bran in solid-state fermentation (SSF). Chitosan production by A. terreus was reported by submerged fermentation in the optimized condition (Abo Elsoud et al. 2023). SSF from fungal cultures provides various advantages over submerged fermentation to manufacture bioactive chemicals in the food, agricultural, and pharmaceutical industries. Furthermore, this includes comparatively improved productivity, greater product concentrations, and simple equipment requirements for the fermentation process of BM (Patil et al 2016). Lovastatin, a potent medication for decreasing blood cholesterol, was extracted from the healthy tissues of Taxusbaccata by an endophytic fungus, A. niger PN2, using SSF with wheat bran as the substrate (Raghunath et al. 2012). Further, we discuss the production and extraction of the SM from EF.

3 Production and extraction of the secondary metabolites (SM) from endophytic fungi (EF)

Biomolecules like polysaccharides, polypeptides, unsaturated fatty acids, and glycoproteins are commonly known as elicitors. EF produces the elicitors or signaling molecules stimulated by the bioactive phytochemical accumulation in plants. Some of them provide defense to plants against disease-causing organisms. They also stimulate the production of several phytochemicals, including alkaloids, flavonoids, terpenoids, saponins, and phenols (Chandran et al. 2020). The oligosaccharide components of Colletotrichum gloeosporioides' crude endophytic mycelium have been demonstrated to stimulate artemisinin synthesis in hairy root cultures of Artemannua (Hussain et al. 2015). The bacterial culture was incubated at 32 °C in broth for 36 h, whereas fungal cultures were incubated at 28 °C for two weeks with 150 rpm shaking. Several solvents were employed alone or in combination to extract metabolites. Ethyl acetate, methanol, dichloromethane, hexane, and ethanol are routinely used to extract metabolites from the culture broth. The solubility of the desired component determines the extraction solvent. Equal amounts of solvents were added to the filtrate and agitated for 10 min until two transparent immiscible layers appeared. The extracted compounds were separated from the solvent using a funnel. The solvent was evaporated and the compound was dried in a rotator vacuum evaporator to produce the crude metabolite (Bhardwaj et al. 2015). The crude extract was diluted with dimethyl sulphoxide and kept at 4 °C. Phytochemical screening was conducted to look for alkaloids, saponins, tannins, flavonoids, steroids, sugars, and cardiac glycosides (Mathew et al. 2012). The isolation and characterization methods of secondary metabolites isolated from fungal endophytes are discussed in Table 1 and in this section; we discuss some high throughput methods precisely used for analysis of SM from EF. Chromatographic methods such as TLC and HPLC were employed to get the secondary metabolite extract as pure as feasible. The recovered fractions are usually analyzed by the use of gas chromatography-mass spectrometry (GC–MS), Fourier transform infrared (FTIR), and nuclear magnetic resonance (NMR). NMR and MS are the principal techniques exploited in the structural characterization of BM. According to Madhusudhan et al. (2015), X-ray diffraction (XRD) is also promising for crystalline biomolecules.

Table 1 Isolation, characterization, and their functional role of secondary metabolites isolated from fungal endophytes

3.1 TLC

TLC analysis was used to extract the bioactive components of Pestalotiopsis neglecta BAB-5510, a fungal endophyte that was isolated from the leaves of Cupressus torulosa D. Don. Two distinct fractions were observed on the silica gel TLC plates after being developed in dichloromethane and methanol at a ratio of 90:10, with the second fraction having an Rf value of 0.79. TLC was employed to separate the extracted secondary metabolites synthesized by fungal endophytes, which have been isolated from Mentha piperita. The Rf values of the metabolites that were isolated from bacterial endophytes were found to be quite comparable to those that were obtained by the TLC chromatogram.

3.2 GC–MS

According to the findings of gas chromatography performed on Pestalotiopsis neglecta BAB-5510, the most important active compounds of Pestalotiopsis sp. BAB-5510 are nonadecane (19.74%), 1,2,3-propanetriol, 1-acetate (17.21%), bis (2-Ethylhexyl) phthalate (14.41%), and 4 Hpyran-4-one, 2,3-dihydro-3,5-d (Bunaciu et al. 2015). The GC–MS spectra revealed that these metabolites were terpenes, more notably cinnamaldehyde, cinnamyl alcohol, and eugenol (Kumar et al. 2017) and GC–MS is particularly suitable to identify volatile organic compounds.

3.3 HPLC & LC–MS

Silica gel column chromatography and high-performance liquid chromatography were used to purify BMs. The Taxus cuspidate culture media was treated with di-chloromethane to extract taxol, which was then purified and quantified by employing HPLC. Finally, the structure of taxol was confirmed by utilizing LC–MS and H-NMR spectroscopy (Sharma et al. 2016). Ethyl acetate was used to extract vinblastine and vincristine from the fungus endophyte Fusarium oxysporum.

3.4 NMR

To evaluate the molecular masses of the purified compounds, electrospray ionization mass spectrometry (ESI–MS) and tandem mass spectrometry (MS–MS) followed by nuclear magnetic resonance (NMR) analysis utilized by Kumar et al. 2013. They performed isolation, purification, and characterization of Vinblastine and Vincristine from EF Fusarium oxysporum isolated from Catharanthus roseus.

4 Pharmaceutical application of the endophytic fungal secondary metabolites

EFs are eminent for their competence in synthesizing a distinct variety of pharmacologically significant chemicals with immense therapeutic promise, including antiviral, antifungal, antibacterial, antitumor, and anti-cancer activity. Various EFs are potential sources of plant growth factors and hormones. Some endophytes have been demonstrated to release a broad spectrum of extracellular enzymes, such as phosphatase enzyme, which converts insoluble phosphates to soluble forms for easier assimilation by plants. Secondary metabolites of EFs have been demonstrated to strengthen the host's immune system, reducing the severity of infections and the damage caused by pathogenic microorganisms (Sharma et al. 2021). The biocontrol systems of plants are responsible for the production of various kinds of BMs, which shield plants against potentially lethal diseases and stimulate their development (Santos et al. 2018; Hardoim et al. 2015). Their pharmaceutical role was experienced against various diseases (Table 1) and they are discussed below.

4.1 Antibiotics

Antibiotic synthesis through metabolic pathways is widely regarded as an effective strategy for protecting plants against illness. Phytopathogens can be inhibited by various bioactive substances and out of them few have been researched (Suryanarayanan 2013; Daguerre et al. 2017). Endophytes produced diverse metabolites, most of which have anti-microbial properties. These metabolites include alkaloids, flavonoids, peptides, phenols, polyketides, quinones, steroids, and terpenoids (Lugtenberg et al. 2016; Fadiji and Babalola 2020). DAPG, also known as 2, 4-diacetyl phloroglucinol, is a phenolic antibiotic with a broad spectrum of activity and has shown Pseudomonas spp. It contributes to the biological control of plant diseases, particularly soil-borne (Bonaterra et al. 2022). The novel alkaloid altersetin was isolated from the endophyte Alternaria spp. showing substantial antibacterial activity against various pathogenic gram-positive bacteria. Fungal endophytes isolated from Artemisia annua have been shown to inhibit the development of most phytopathogenic organisms in vitro by secreting n-butanol and ethylacetate (Fadiji and Babalola 2020). In addition, pseudomonads spp. generate cyclic lipopeptides (CLPs) amphiphilic molecules with chains of 7–25 amino acids that act as biosurfactants and are significant in biological control because of their favourable competitive capability with numerous groups of microorganisms (Flury et al. 2017; Bonaterra et al. 2022).

4.2 Siderophore

Micronutrient metals including nickel, copper, zinc, and iron are essential for soil plants and microorganisms, however, their bio-availability is often low due to environmental factors (Satapute et al. 2019). Reduced bioavailability of Fe(III) directly results from forming insoluble oxyhydroxide phases in response to harsh environmental conditions. Due to a lack of iron, plants develop chlorosis and have lessened metabolic activity and biomass. In response to various stresses, plants, and microbes have evolved a chelation strategy to increase metal availability (Chowdappa et al. 2020). Endophytes secreted small molecules called siderophores capable of chelating iron and increasing the bioavailability of the iron molecule to the plant (Yadav 2018). The iron in the soil can be dissolved with the assistance of secreted siderophores, which have a strong affinity for the substrate and the potential to assimilate it. The bacterial iron-siderophore complex makes iron accessible for plant development while simultaneously reducing the acquisition of iron by phytopathogens, which restricts phytopathogen proliferation (Santos et al 2018). Despite this, the chemical composition of different microorganisms' siderophores can be somewhat distinct. For instance, bacterial hydroxamates are composed of hydroxylated and acylated alkylamines, whereas fungal hydroxamates are composed of hydroxylated and acylated ornithine groups. Chelating compounds can be obtained from endophytic fungi derived from Cymbidium aloifolium. This medicinal orchid can secrete exogenous siderophores and form stable complexes with the metal ion Fe3+. These metabolites have the great potential to act as antibacterial siderophores. In a similar vein, a hydroxamate-type siderophore obtained from P. crysogenum was found to possess potent antibacterial activities against some of the most virulent phytopathogens, hence safeguarding peanuts and rice plants (Chowdappa et al. 2020). To evaluate the inhibitory efficacy of exogenous deferoxamine-B and siderophores-exochelin MS (a pentapeptide derivative) against methicillin-resistant Staphylococcus aureus, metallo-lactamase producers Acinetobacter baumannii, and Pseudomonas aeruginosa, disc diffusion, micro broth dilution, and turbidimetric growth tests were utilized (Gokarn and Pal 2018). The combination of siderophores and antibiotics was effective against the drug-resistant isolates. They can treat antibiotic-resistant bacteria and acute iron intoxications such as hemochromatosis by producing sideromycins. Evidence suggests they help to treat malaria (Chowdappa et al. 2020), bioremediating mercury (Pietro-Souza et al. 2020), and other plant diseases. According to some research, microorganisms' sensitivity to oxidative stress is lowered by siderophores. They can be used in cosmetics, cancer therapy, combat fish infections, and against bacterial/fungal phytopathogens (Chowdappa et al. 2020; Peralta et al. 2016).

4.3 Hydrolyzing enzyme

Endophytes make lytic enzymes like amylases, lipases, cellulases, pectinases, proteases, phosphatases, hemicellulases, chitinases, and 1, 3-glucanases (Mishra et al. 2019), which help them form symbiotic relationships with host plants and control of plant pathogens. Cellulase produced by endophytic fungi such as Epicoccum nigrum, Trichoderma asperellum, and Alternaria longipes has been shown to suppress the development of Epicoccum sorghinum, Alternaria alternata, Fusarium thapsinum, and Curvularia lunata in vitro by hydrolyzing the cell wall (Fadiji and Babalola 2020). The biocontrol efficacy against tall fescue leafspot and sugar beet damping-off was reduced after mutations in the 1,3-glucanase genes of Lysobacteren zymogenes. The lytic enzymes produced by Streptomyces are also effective against cocoa witch broom (Gao et al. 2018). Lytic enzymes produced by endophytes are often more robust and can function on a broader pH, temperature, and pressure range as compared to enzymes produced using traditional chemical catalysts (Tiwari 2015). These features also bode well for the commercial use of these enzymes in the food, detergent, paper, pharmaceutical, energy, and biofuel industry (Rana et al. 2019) because endophytic amylase hydrolyzes starch by accelerating the creation of 1,4 glycosidic bonds (Tiwari 2015). Bacterial pectinases, which depolymerize pectin linkages, are also widely utilized and have many applications in juice and food industries as well as in paper/pulp production, composting, recycling, etc. (Haile and Ayele 2022).

4.4 Growth-promoting hormones

Plant growth stimulation is bolstered, and phytohormones produced by fungal endophytes alter the plant's shape and form. This quality of endophytes has helped them progress in sustainable agriculture (Fadiji and Babalola 2020). Phytohormones or plant growth regulators are chemical substances that control, impede, or accelerate growth promotion and development of plants at low concentrations (Damam et al. 2016). Many phytohormones, including auxins, gibberellins, abscisic acid, cytokinins, ethylene, strigolactones, brassinosteroids, and jasmonates are produced by endophytic microorganisms (Santoyo et al 2016; Shahzad et al. 2016). The primary function of indole-3-acetic acid (IAA) in plants is to stimulate cell growth and division. The IAA generated by the bacteria in symbiosis facilitates nutrient availability, increases root exudation, and encourages the growth of adventitious and lateral roots. The bacteria of the genera Azospirillum, Herbaspirillum, Azotobacter, Alcaligenes, Pseudomonas, Enterobacter, Klebsiella, Burkholderia, Pantoea, Rhizobium, Bacillus, Rhodococcus, Acetobacter, etc., are familiar endophytic IAA producers (Eid et al. 2021). IAA synthesis also increases the size of bacterial cell walls, speeds up the release of exudates, and makes more of the nutrients that help other beneficial bacteria thrive in the rhizosphere more accessible. As a result, IAA is the primary effector molecule of endophytic bacteria involved in phytostimulation, pathogenicity, and plant–microbe interaction (Etesami et al. 2015). A specific form of bacterial endophyte contains 1-aminocyclopropane-1-carboxylate deaminase, which allows it to convert the ethylene precursor ACC into ammonia and beta-ketobutyrate. (Eid et al. 2021). Due to the release of ACC deaminases, these bacterial endophytes can stimulate plant development in nitrogen-limiting environments. Additional benefits include a more robust immune system and increased resistance to abiotic stress. In the case of sorghum plants, Pseudomonas brassicacearum (SVB6R1) increases the expression of ACC deaminase, increasing the plant's resistance to salt stress (Gamalero et al. 2020).

4.5 Nutrients

The expansion of agricultural production is facilitated by biofortification, which simplifies the uptake of nutrients by plants. Fungal endophytes can colonize plant structures such as roots, stems, and leaves and they are less likely to be outcompeted than microbes that live in the soil, therefore, they can be utilized as a replacement to boost the plant's ability to fix nitrogen (Santos et al. 2018). The presence of many microorganisms in the soil allows for the breakdown of insoluble phosphate and thus phosphorus is made available to the plants (Alori et al. 2017). In addition to their involvement in the release of organic acids into the soil, endophytes are also involved in the solubilization of phosphate complexes and the conversion of these compounds into the ortho-phosphates that plants absorb more readily. Ca3(PO4)2 solubility was observed for poplar endophyte strains WP5 and WP42, and subsequent solubilization tests validated this observation (Kandel et al. 2017; Khan et al. 2015; Varga et al. 2020). Selenobacteria is a plant endophyte that can draw selenium out of the soil and transmit it to the host plant, where it can be used to promote plant development. Selenium biofortification in Glycine max may be enhanced by the endophyte Paraburkholderia megapolitana (MGT9) during drought (Trivedi et al. 2020). Zn solubilizing endophytes (such as B. subtilis DS-178 and Arthrobacter sp. DS-179) improve the translocation and enrichment of Zn to grain in specific Wheat genotypes (Singh et al. 2018).

4.6 Phytoremediation

As the global economy has become more industrialized over the past century, various anthropogenic chemicals have been released into the environment. These include polycyclic aromatic hydrocarbons (PAHs), petroleum hydrocarbons (PHC), halogenated hydrocarbons, salt, solvents, pesticides, and heavy metals (Bisht et al. 2015). Microbe-assisted phytoremediation is a method that deals with these issues. Due to endophytes' closer relationship with their host plants, phytoremediation may be enhanced (Li et al. 2012). It has been discovered that many endophytes can withstand high concentrations of heavy metals and degrade organic pollutants. Because of their prolonged exposure to the high metal concentrations stored in the hyperaccumulators of these plants, the endophytes associated with these plants may have become more resistant to the negative consequences of metal exposure (Aishwarya et al. 2014). Furthermore, it has been demonstrated that releasing low-molecular-mass organic acids by specific endophytes might boost heavy-metal mobilization. For example, the organic acids produced by endophytes caused the pH of a solution to fall when the water-soluble Pb concentration increased. When the concentration of water-soluble Pb rose, the pH of the solution decreased because of the organic acids generated by endophytes (Yongpisanphop et al. 2020).

4.7 Anti-cancer activity

Cancer is the second largest cause of mortality worldwide due to its high incidence rate. Malignant cells kill 15 million people annually, and the number is rising. Cancer can be treated with safe, biocompatible, less toxic, and more resistant natural chemicals from endophytic organisms. These natural chemicals are cancer treatment alternatives to chemotherapeutic medicines. These natural chemicals are anti-cancer and can control many malignancies. Due to their abundance, they can be employed to treat cancer. Endophytic fungi including Taxomyces andreanaeSeimatoantlerium nepalenseAlternaria alternate, and Chaetomellaraphigera have been linked to the production of the anti-cancer drug paclitaxel (Kousar et al. 2022). Paclitaxel treats Kaposi's sarcoma, prostate, lung, and ovarian cancer (Weaver 2014). It binds to tubulin and inhibits depolymerization during cell division (Leung and Cassimeris 2019). Taxol isolated from sick Chilli plant fruits has shown cytotoxic activity against human cell lines MCF-7, HLK-210, and HL-251. Endophytes Sinopodophyllum hexandrum and Dysosma veitchii generate podophyllotoxin which is used to treat leukemia, testicular, prostate, lung, and ovarian cancer (Leung and Cassimeris 2019). Camptothecin is an effective cytotoxic compound for the treatment of solid tumors of the liver, bladder, lungs, and ovaries. A study found that camptothecin (extracted from A. niger) caused apoptosis when given to colon cancer cell lines, and cell death occurs at dosages as low as 7.8 mg/L and as high as 1000 mg/L with the highest and lowest cell viability occurring at concentrations of 11.85 and 65.13%, respectively (Aswani and Soundhari 2018). Fusarium oxysporum generates the anti-cancer compound vinblastine in Cathranthus roseus, which is helpful against lymphoblastic leukemia and cancer cell lines HepG-2 at 7.48 g/mL (Kousar et al. 2022).

4.8 Immunosuppressive activity

An immediate quench strategy to overcome graft rejection and autoimmune diseases; researchers have been looking for a substance that might dampen the immune system (Rajamanikyam et al. 2017). Fungal endophytes can synthesize some substances with immunosuppressive effects (Egbuta et al. 2017). Synthetic chemical immunosuppressive medications have serious side effects because of the time they took to treat diseases. Infection risks like hyperlipidemia, nephrotoxicity, hypertension, and neurotoxicity have side effects from long-term usage of chemical immunosuppressive medications (Hošková et al. 2017). A recent study has revealed that immunosuppressive medicines produced from fungal endophytes are highly effective. Sydoxanthones A and B, 13-O-acetylsydowinin B, colutellin A, methyl peniphenone, dibenzofurane, xanthone derivatives, subglutinols A and B, peniphenone, lipopeptide, benzophenone derivatives, (-) mycousnine, etc. are used in the treatments. There was speculation that cyclosporin A, an immunosuppressant medication, originated in the fungus Tolypocladiumin flatum (El-Gowelli and El-Mas 2015). cyclosporin A, an extract from the endophytic soil fungus Trichoderma polysporum, was discovered as a critical immunosuppressive agent. Endophytic fungus Fusarium subglutinan was discovered in Tripterygium wilfordii, where it produces noncytotoxic diterpene pyrenes and immunosuppressive Subglutinol A and B (Vasundhara et al. 2016; Adeleke et al. 2021).

4.9 Anti-diabetic activity

Recent research has suggested that endophytic fungus might be a source of substances with anti-diabetic properties. The endophytic fungus Nigrosporaoryzae in Combretum dolichopetalum leaves has been proven to lower fasting blood sugar in diabetic mice when its purified components are administered (Uzor et al. 2017). These chemicals include abscisic acid, 70-hydroxy abscisic acid, and 4-des-hydroxyl altersolanol A. Indrianingsih and Tachibana (2017) showed that 8-hydroxy-6,7-dimethoxy-3-methyl isocoumarins exhibit strong glucosidase inhibitory effect and are produced by the endophytic fungus Xylariaceae spp. in the stem of Quercusgilva Blume. Oral administration of glucose and alloxan to Wistar albino rats accompanied with Salvadoraoleoides extracts of Phoma spp. and Aspergillus spp. induced anti-diabetic and hypolipidemic effects (Ezekwesili and Ogbunugafor 2015). Endophytic fungi isolated from medicinal plants such as Rauwolfia densiflora and Leucas ciliata have been tested as a potential therapeutics for diabetes through bioprospecting. There is evidence that compounds generated from Fusarium spp. and Alternaria spp. exhibit anti-diabetic action, suggesting that these fungal endophytes may serve as a source of multifunctional therapies (Adeleke et al. 2021).

4.9.1 Anti-malarial activity

Due to the rapid spread of anti-drug resistance malaria parasites in recent years, there is an urgent need for novel malaria therapy drugs. It was shown that the anti-malarial activity of two endophytic fungi, munumbicins E-4 and E-5, was twice as potent as that of chloroquine (Fadiji and Babalola 2020). The endophyte Diaporthemiriciae is responsible for producing the secondary metabolite epoxy cytochalasin H. This compound exhibits robust anti-malarial suppression against a strain of Plasmodium falciparum resistant to chloroquine (Ferreira et al. 2017). Ateba et al. (2018) found that the endophyte species Paecilomyces lilcinus and Penicillium janthinellum are great resources for new compounds that are active against Plasmodium falciparum and show potential in the treatment of malaria. It has been proven that various endophytic fungi, in addition to Aspergillus niger, Fusarium spp., and Nigrospora spp. can produce bioactive compounds with an antiplasmodial effect against Plasmodium falciparum (Kaushik et al. 2014).

4.9.2 Antituberculosis

Tuberculosis (TB), an infection of the lungs caused by Mycobacterium tuberculosis, is a worldwide health concern. It has lasted for centuries and is one of the world's most devastating illnesses. The World Health Organization (WHO) estimates that 10 million individuals are currently living with TB. Ending the TB pandemic by 2030 is one of the health aims of the sustainable development goals of the United Nations. M. tuberculosis has been proven to acquire resistance to numerous synthetic medications. To this end, it is crucial to keep looking for new, natural antimycobacterial medicines that may kill mycobacteria without causing resistance. Bioprospecting for fungal endophytes as a cure for TB is an exciting field of study since many fungal metabolites are naturally antimycobacterial. Azadirachta indica and Parthenium hysterophorus fungal endophytes have been found to exhibit antibacterial effects against TB (Mane et al. 2017). Phomopsis spp., an endophytic fungus isolated from Garcinia spp. is responsible for the production of Phomoxanthone A and B, which have been shown to suppress the development of M. tuberculosis (Kumar et al. 2017). Alternaria alternate and Phomopsis spp., two fungal endophytes isolated from Thai medicinal plants, have been shown to generate 3-nitro propionic acid and tenuazonic acid, exhibit indecisive action against M. tuberculosis (H37Ra) (Kumar et al. 2017; Deshmukh et al. 2015). Endophytic fungus Phomopsis spp. isolated from Garcinia adulcis generates bioactive metabolites with anti-tuberculosis potential (Kumar et al. 2017). These metabolites include phomoenamide and phomonitroester. Benzopyran, diaportheone A and B are bioactive chemicals produced by Diaporthe spp. They are associated with the leaves of Pandanus amaryllifolius and suppress aggressive strains of M. tuberculosis (Chepkirui and Stadler 2017).

4.9.3 Antiviral

Evidence suggests that endophytic fungi can create antiviral drugs that are effective against a wide range of viruses, including HIV (Farooq et al. 2016), human CMV (Raekiansyah et al. 2017), Dengue virus (Liu et al. 2019), and influenza A (HINI) virus (Ambele et al. 2020). Antiviral activity has been found in two novel substances, cytonic acid A and cytonic acid B, which are isolated from Cytonaema spp. With the use of mass spectrometry and nuclear magnetic resonance, the structures of ptrideside isomers were conferred, leading to the identification of novel inhibitors of the protease activity of human cytomegalovirus. Fungal endophytes in the phyllosphere (leaves) of an oak tree (Quercuscoccifera) generate the antiviral chemical Hinnuliquinone, which has been linked to the inhibition of HIV-1 protease activity (Adeleke et al. 2021). Alternaria tenuissima QUE1Se is an endophytic fungus that generates altertoxins, a substance with potent anti-HIV-1 action. In addition to emerimidine (A, B), dehydroaustin, austinol, aspernidine (A, B), austin, emeriphenolicins (A, D), and acetoxydehydroaustin, many other compounds isolated from Emericella spp. (HKZJ) have been found to have antiviral activity against the influenza A virus (H1N1) (Raekiansyah et al. 2017). The antiviral activity of most medicinal plant mixtures is relatively high, even in their crudest forms. Antiviral activity in certain actinomycetes has been demonstrated (Fadiji and Babalola 2020). The antiviral chemical 2-(furan-2-yl)-6-(2S, 3S, 4-trihydroxybutyl) pyrazine was initially isolated from the plant species Jishengella endophytica 161,111. This chemical is adequate to combat the spread of the influenza A (H1N1) virus (Fadiji and Babalola 2020; Raekiansyah et al. 2017).

4.9.4 Other pharmacological potentials of the endophytic fungal secondary metabolites

In addition to their potential uses in food, agriculture, medicine, and cosmetics, the bioactive metabolites found in endophytes are excellent pharmaceutical sources for treating various disease conditions (Shukla et al. 2014). The metabolites generated by fungal endophytes contain a wide variety of functional groups including alkaloids, flavonoids, terpenoids, phenolic acids, quinones, steroids, benzopyranones, tannins, tetralones, and chinones (Gouda et al. 2016). Half of all deaths worldwide are attributable to infectious and parasitic disorders. It has been established that endophytes are the origin of a wide variety of commercially accessible bioactive chemicals and secondary metabolites. New compounds produced by endophytic microbes have shown promise as antibiotics, anti-inflammatory agents, cancer treatments, immunosuppressants, anti-diabetic activity, anti-malarial activity, and even insecticides (Fadiji and Babalola 2020).

5 Conclusion

The purpose of this article is to gather updated knowledge on secondary metabolites of endophytic fungi, their production, methods of analysis, pharmaceutical potential, and application. Microorganisms that are endophytic to a plant provide benefits to the host plant and stimulate plant growth via several direct and indirect mechanisms of action. Fungal endophytes represent an inexhaustible reservoir of pharmacologically essential compounds. Endophytic fungi are an essential component for the production of novel biomolecules for the biochemical and pharmaceutical industries. The fungal endophytes are in a pivotal position in producing certain enzymes, such as amylase, cellulase, laccase, lyase, etc., that have significant commercial and pharmaceutical applications. Several promising pharmaceutical lead molecules have been reported and derived from endophytic fungi. Because they produce physiologically active metabolites that are immune suppressants, anti-cancer agents, promote plant growth, anti-microbial volatiles, anti-oxidants, and antibiotics. Future insights are necessary to understand more about dynamic fungal endophytes, host interactions, and molecular players of fungal endophytes involved in producing biopharmaceuticals of human interest. Finally, the use of metagenomics in combination with next-generation sequencing technologies is anticipated to unlock Endophytes have the potential to offer at least partial, if not total, answers to critical concerns such as rising strain on the global food supply, climate change, environmental degradation, and therapeutics. As a result, the biology of endophytes has to be investigated more if we are going to reap the advantages of these organisms in the fields of agriculture, industry, and medicine. Information on bioactive natural compounds found in endophytic fungi has not been explored effectively. The reservoir of pharmacologically important chemicals that may be found in fungal endophytes is almost endless. To get a better understanding of the dynamic fungal endophytes, the host relationships, and the molecular actors of fungal endophytes that are engaged in the production of biopharmaceuticals of human interest, more research is required. In conclusion, the use of metagenomics in conjunction with next-generation sequencing technologies is projected to open a wide variety of hitherto undiscovered pools of antimicrobials that are released by endophytic microorganisms that have not yet been farmed. Endophytes have just come to be seen as an important contributor to the overall pool of biological variety and numerous bioactive molecules secreted by as-yet-uncultivated endophytic microbes are not explored. The resources that endophytes give may be used for a variety of purposes, including formulations and bioprospecting. Because of this, further research into the biology of endophytes is required if we want to benefit from the presence of these organisms in the sectors of agriculture, industry, and medicine. The discovery of bioactive natural chemicals discovered in endophytic fungus has had an indelible impact on the treatment of a variety of diseases, including cancer, diabetes, and neurological conditions. With the use of cutting-edge biotechnology like genetic engineering and the microbial fermentation process, these microbial resources may be better utilized for human benefit.