In the last few years, WSN has been object of an intense research activity that has determined an important improvement by technologic and computation point of view both. The notable level got and the increasing request of applications designed over Sensor Networks make WSN commercial diffusion next to be a fact. One of key issues for commercial diffusion of WSN is related to the robustness of architectures. An adaptive and flexible fault tolerant mechanism for WSN is proposed in the paper. Considering the tradeoffs between robustness and energy efficiency as central issue, a programming model based on multi-behavior agents that can guarantee an efficient, dynamic and extendible implementation is proposed too.