Densification of networks through heterogeneous cells deployment is considered a key technology to satisfy the huge traffic growth in future wireless systems. In addition to achieving the required communication capacity and efficiency, another significant challenge arises from the broadcast nature of wireless channels: vulnerability to wiretapping. Physical-layer security is envisaged as an additional level of security to provide confidentiality of radio communications. Typical characteristics of the wireless channel (noise, interference) can be exploited to keep a message confidential from potential eavesdroppers. In particular, heterogeneous networks (HetNet) have inherent security features: while the legitimate user can benefit of the HetNet architecture, the eavesdropper is strongly affected by the inter-cell interference. This paper presents an overview of HetNets intrinsic security benefits, mainly focusing on users association and resource allocation policies. In particular, allocation of radio resources is a poorly investigated topic when related to information security. However, in systems with a large radio resource reuse like HetNets, co-channel interference can be suitably exploited to resist to the eavesdropper. This paper presents a new framework for radio resources allocation using reinforcement learning (Q-learning) to increase the security level in HetNets. A coordinated scheduling among different cells using the same radio resources is proposed based on the exploitation of the spatial information. The goal is to optimize the security at physical layer. The reinforcement learning approach represents a feasible and efficient solution to the proposed problem.