This paper proposes the DISON framework, a generic management system for Wireless Sensor Networks (WSNs). The first objective of the DISON framework is to allow sensor nodes to adapt autonomously to changes in application requirements and network resources. The second objective is to provide a framework that enables both the developer and the administrator of WSNs to choose what management functions to perform, what conditions should trigger sensor nodes’ adaption, and how to adapt in both the development and run-time stages. To achieve these objectives, firstly we propose a multilevel management mechanism where every sensor node is empowered to participate in the management process at different levels according to its resources. Then, we explain how sensor nodes can be self adaptive by defining two data models, a context model and a policy model. We also discuss how context is validated and how it is used to trigger policies. We then present two management functions that can be applied to most applications, the monitoring function and the resource allocating function. We implement DISON in TinyOS operating system as an independent component which can interact with user applications and other network components through public interfaces. The feasibility of the resource allocating function is evaluated on a 26-node indoor testbed. The results of the experiments show that DISON can not only resolve the management problems but also improve network performance such as packet delivery rate or energy consumption. Finally, through experiments in another testbed with different number of nodes, we demonstrate the scalability of DISON.