Alkaloids can also have environmental impacts. They can affect non-target organisms when plants containing these compounds are used as pesticides or when they leach into waterways. Understanding the ecological role of alkaloids can help mitigate their unintended impacts on ecosystems.