Abstract-Smart systems have to deal with environmental changes and react for adapting their behavior to changes in the operating conditions, so to always meet users' expectations. This is fundamental for those systems operating in open environments that may change frequently. Smart environments are complex systems that more than others are affected by these issues. In this paper, we propose a normative framework for regulating at run-time system behavior when some situations occur, thus providing system flexibility. The proposed approach includes also mechanisms to identify anomalous situations that can occur in the system due to the run-time injection of new norms.