Authentication, authorization, least privilege, and tenant isolation
Words made simple
A few useful meanings before you read the explanation.
- Authentication
- Checking who a user or service is, such as by verifying a login session.
- Authorization
- Checking what that identity is allowed to read or do. Being logged in does not grant access to every record.
- Tenant
- A customer or organization whose data must stay separate from other customers in a shared application.
More words from this lesson
- Token
- A small piece of text processed by a model. It may be a whole word, part of a word, or punctuation.
- Vector
- An ordered list of numbers. An embedding is a vector used to represent content for tasks such as similarity search.
- Retrieval
- Finding and fetching information that is useful for the current question.
- Agent
- An application that uses a model to choose its next action within defined limits. It can use tools and continue through several steps.
- Checkpoint
- A saved snapshot of workflow progress that can help it continue later.
Overview
- Authentication verifies identity.
- Authorization decides allowed objects and actions.
- Least privilege grants only required capabilities; tenant isolation keeps one organization's data and operations separated from others.
Why this matters
An agent can propose an identifier it should not access, accidentally or through attack.
An everyday example
A hotel guest can access their room, not every room with a similar number.
A technical example
Query by both server-derived tenantId and claimId, then verify customer ownership and action rights.
How it works
- Verify session/token
- Derive principal
- Authorize tool and object
- Apply tenant filters
- Execute
- Audit identity and outcome.
Architecture and flow
Verified principal → permission checks → tenant-scoped service → data.
The insurance assistant example
Changing C42 to C43 in chat must not expose another customer's claim.
When to use it
All private retrieval, tools, memory, caches, approval/resume endpoints, and downloads.
When to avoid it
Do not let a prompt, model output, or client-supplied tenant field determine access.
Interview answer
“Tenant and object permissions are enforced by services using verified identity. The model never decides who is authorized.”
Benefits, trade-offs, and production considerations
- Recheck access after permission changes, cache invalidation, and approval waits.
- Test cross-tenant access through vector search, parent expansion, checkpoints, object URLs, and semantic caches, not only normal database routes.
Can you explain it without the notes?
Authentication, authorization, least privilege, and tenant isolation
Use your own words. Explain an example and one limitation before checking the explanation.
Check your explanation
Authentication verifies identity. Authorization decides allowed objects and actions. Least privilege grants only required capabilities; tenant isolation keeps one organization's data and operations separated from others.
Turn this concept into a clear answer.
Practice this conceptKeep connecting the ideas.
Next lesson: Validation, rate limiting, and secure database accessAdapted from 13_AI.MD · “Authentication, authorization, least privilege, and tenant isolation”. Examples are study fragments; framework behavior can depend on your version.