Mobile agents must be prepared to execute on different hosts and therefore in different execution environments. Even when a homogenous exenvironment is offered by abstracting the underlying heterogeneity, there are scenarios like IT-management, where mobile agents are forced to contain environment dependent implementations. The aim of this work is to equip mobile agents with a flexible capacity to adapt to a range of different environments on demand. We discuss different forms of adaptation and draw a distinction between static and continuous forms. Our solution for dynamic adaptation provides a concept for exchanging environment dependent implementation of mobile agents during runtime. Dynamic adaptation enhances efficency of mobile code in terms of bandwidth and scalability.