Cloud computing is an emerging paradigm for hosting and delivering Internet services. This technological trend is increasingly attracting individuals and organizations in different disciplines. Healthcare is at the top of fields where cloud becomes widely adopted to provide remote services and real‐time monitoring for patients and medical stakeholders. However, as sensitive health data are sent over insecure cloud networks and stored in the cloud anywhere across the globe, a reliable system meeting security requirements is of utmost importance, particularity in terms of authentication, access control and traceability. In this article, we propose an innovative security‐aware framework typically dedicated for cloud‐assisted healthcare environments. Our framework is mainly based on three efficient mechanisms. First, we introduce an anonymous authentication process based on mobile agents and elliptic curve cryptography to ensure a secure and flexible communication between the cloud and users. The second mechanism designs a fine‐grained data access control model, which beneficially associates the notions of attribute, role, task, constraint, and session. Moreover, we integrate a user behavior analysis performed by mobile agents, which perceive and trace users behaviors to depict potential vulnerabilities and anomalous activities on sensitive resources. The security analysis and the experiments being conducted demonstrate that our contribution is provably secure and shows very promising features.