LESSON 89 / 215·2 min readIntermediate

Authentication, authorization, least privilege, and tenant isolation

Must knowConcept lesson
01 Understand02 Recall03 Prepare

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

  1. Verify session/token
  2. Derive principal
  3. Authorize tool and object
  4. Apply tenant filters
  5. Execute
  6. 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.
PAUSE & RECALL

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.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Validation, rate limiting, and secure database access

Adapted from 13_AI.MD · “Authentication, authorization, least privilege, and tenant isolation”. Examples are study fragments; framework behavior can depend on your version.