MODULE 06 · AUTHENTICATION & SECURITY
Least Privilege
Least privilege means giving each user, service, or tool only the access it needs for its current task.
01 · What is it?
Least privilege is a security principle that limits access to the smallest set of permissions required to complete an approved task.
Access should be limited by identity, action, resource, and time when those boundaries are useful. Extra access creates extra opportunities for mistakes, misuse, or compromise.
Simple Definition:
Give a caller only the permissions it needs, and no more.
02 · Think of it like...
Think of least privilege like giving a contractor one key for one room during one appointment.
The key opens the room needed for the job.
It does not open every room in the building, and it can be collected when the job is done.
Analogy:
Contractor
→
Assigned Task
→
One Key
→
Approved Room
03 · What does it do?
Least privilege puts useful boundaries around what an identity or system component can do.
Reduce Blast RadiusLimit the damage if an account, token, or tool is misused.
Prevent AccidentsMake dangerous or unrelated actions unavailable by default.
Clarify ResponsibilityMake it easier to see which identity is allowed to perform an action.
Support ReviewGive teams a smaller, clearer permission set to inspect and maintain.
04 · Where is it used?
Least privilege applies anywhere software decides who or what may access a resource.
User AccountsRole and permission designA person can access the records and actions needed for their job.
Service AccountsBackend integrationsA service can read or change only the data required by its workflow.
APIs and DatabasesScoped accessA caller can use selected endpoints, tables, operations, or fields.
Cloud InfrastructureIdentity and access policiesA workload can reach only the resources it needs to run.
AI Agent ToolsControlled capabilitiesAn agent can use approved tools without receiving unrestricted system access.
Temporary WorkShort-lived permissionsAccess can expire or be removed after a task is complete.
05 · Example
Reporting service
resource: orders
actions: read
fields: id, status, total
duration: 15 minutes
A reporting service needs to read a small set of order fields. It does not need to create, update, or delete orders, so those permissions are not granted.
If the reporting service is compromised, its limited permissions reduce what the attacker can reach or change.
06 · How it connects
Request→Identity→Policy→Least Privilege Check→Allowed Action→Audit Log
Authentication identifies the caller. Authorization evaluates the policy. Least privilege shapes that policy so the allowed action is as narrow as the task requires.
07 · Do Not Confuse
Authentication
Checks who or what is making a request.
Least privilege: limits what that authenticated caller can do.
Role
Groups a set of responsibilities or permissions.
Least privilege: asks whether that set is still no broader than necessary.
Deny by Default
Blocks access unless a rule allows it.
Least privilege: defines the narrow access that an approved caller receives.
Least privilege does not mean removing all access. It means making access specific, justified, and limited.
08 · Topic Glossary
| ENGLISH TERM | 中文 | SIMPLE ENGLISH | 中文小白理解 |
| Least Privilege | 最小权限 | Giving only the access needed for a task. | 只给完成任务所需要的权限。 |
| Permission | 权限 | A rule that allows a specific action. | 允许某个具体操作的规则。 |
| Authorization | 授权 | Checking what a caller is allowed to do. | 检查调用方可以做什么。 |
| Role | 角色 | A named set of responsibilities or permissions. | 一组有名字的职责或权限。 |
| Scope | 范围 | The resources or actions covered by access. | 权限覆盖的资源或操作范围。 |
| Service Account | 服务账户 | An identity used by software instead of a person. | 由软件使用而不是由人使用的身份。 |
| Blast Radius | 影响范围 | How much can be affected when something goes wrong. | 出问题时可能受到影响的范围。 |
| Audit Log | 审计日志 | A record of access and actions. | 记录访问和操作的日志。 |
09 · What to Remember
Least privilege gives each identity or tool the smallest useful set of permissions for an approved task.
Keep access narrow, review it regularly, and remove or expire it when it is no longer needed.
Core Flow:
Identify the Caller → Check the Policy → Allow Only the Required Action → Record the Result