- Category: B. Software Architecture
- English term: Principle of Least Privilege (PoLP)
- Related: Secrets Management · Sandbox and Guardrails · Zero Trust Access & Verification · Bulkhead Pattern (Isolation) · Separation of Concerns (SoC) and Role Boundaries
General Meaning
A foundational principle of information security, the Principle of Least Privilege (PoLP) states that every user, program, or machine-to-machine credential should operate with only the minimum privileges necessary to complete its assigned duty.
Instead of using all-powerful root accounts or wildcard admin tokens, scoping permissions tightly by repository, command, and expiration limits the blast radius of human mistakes, runaway AI agents, or leaked keys.
Why It Matters
- Preventing accidental destruction by runaway automation: Stops a buggy script or confused AI agent from deleting unrelated repositories or overwriting production databases.
- Containing the blast radius of leaked keys: If a scoped token is compromised, only its narrow target resource is exposed rather than the entire infrastructure.
- Clarifying operational boundaries: Makes it explicit which process can touch which resource, simplifying security audits and debugging.
How the Site Factory Uses It
Because the Site Factory coordinates multiple Macs, cloud services, and autonomous AI agents, it enforces multi-layered least privilege across five domains: (1) Inter-machine SSH never grants a general login shell, restricting authorized_keys via command="..." to specific commands such as mq.py remote or status checks (ops/work/2026-10-24-studio-spread-extract-pr.md); (2) AI agent sandboxing runs LLMs inside --sandbox enabled with restricted toolsets rather than raw sudo or unrestricted shells; (3) Scoped API tokens restrict Cloudflare tokens to specific Workers (memocho.dev) and D1 databases, and scope GitHub tokens to designated repositories (ops/machines.md, unkou/README.md); (4) Secret value isolation ensures 1Password MCP handles only environment variable *names* so raw secret values never pass through LLM prompts (rules.md K104); and (5) All-private repositories (rules.md K96) block unauthenticated external access.
All agents operate under the strict rule: never spoof identity and never bypass permission checks or 403 boundaries.
Caveats & Operational Rules
- Never grant temporary admin privileges 'just for development': Broad temporary permissions are easily forgotten and can trigger catastrophic damage inside an autonomous loop.
- Never work around a 403 or permission error with hacks: When a permission check fails, do not bypass the check; either request proper scoped access or revise the design.
Related Terms
- Secrets Management
- Sandbox and Guardrails
- Zero Trust Access & Verification
- Bulkhead Pattern (Isolation)
- Separation of Concerns (SoC) and Role Boundaries
References
- Book: Mark Richards & Neal Ford, *Fundamentals of Software Architecture*, Chapter 18 (Security Architecture)
Verified: 2026-11-08