Wireless Sensor Networks (WSNs) are prone to security attacks. In order to protect the network from potential adversaries, it is necessary to secure communications between sensor nodes. Also, if we consider a network of heterogeneous objects including WSNs, security requirements may be far more complex. In particular, a single application may deal with multiple different traffic flows, each one of which may have different security requirements, that possibly change over time. In this paper, we present STaR, a software component which provides security transparency and reconfigurability for WSNs programming. STaR allows for securing multiple traffic flows at the same time according to specified security policies, and is totally transparent to the application, ie no changes to the original application or the communication protocol are required. Also, STaR can be easily reconfigured at runtime, thus coping with changes of security requirements. Finally, we present our preliminary implementation of STaR for Tmote Sky motes, and evaluate its impact on performance, in terms of memory occupancy, communication overhead, and energy consumption.