The principle of least privilege and role-based access control (RBAC) often get treated as the same thing. They work together, but they solve different problems.
RBAC assigns permissions based on a user's role—marketing team, IT staff, finance. The principle of least privilege goes a step further: it makes sure even those roles only carry the bare-minimum access needed to do the job, so a role never becomes a shortcut to overprivileged access.
RBAC is built for scale. It's the right tool for managing permissions across large, complex environments by grouping access into roles instead of managing every user one by one. The principle of least privilege applies more broadly—to roles, individual users, and non-human systems alike—stripping away whatever access isn't actually necessary, even within a role that looks reasonable on paper.
Used together, RBAC gives you a manageable structure, and least privilege makes sure that structure never grants more than it should.
Common examples of least privilege in action
User accounts. An employee's account should only reach the systems and data their job requires, so a compromised login doesn't hand an attacker the whole network—just the narrow slice that account was ever meant to touch.
Service accounts. Automated processes and integrations often run with far more access than their function needs, and because no one's watching them in real time, an overprivileged service account can be exploited quietly for a long time before anyone notices.
Cloud RBAC. Cloud environments make it easy to over-assign roles for convenience, but a single overly broad role can expose entire storage buckets or admin consoles to anyone who compromises that one set of credentials.
Endpoint access. Local admin rights on a laptop or workstation let malware and attackers install software, disable security tools, and move laterally the moment that endpoint is compromised, which is exactly why removing standing admin rights closes off one of the most common attack paths.
Microservices. In a microservices architecture, a service designed to resize images shouldn't have access to delete databases. Without least privilege enforced at the service level, a single compromised microservice can reach far beyond its intended function, turning a narrow vulnerability into a much larger breach.