Skip to content
Agent Field Notes
Course contentsExpand a topic to choose a lesson.

SYSTEMATIC LEARNING / FOUR-LEVEL COURSE

Tenant isolation and continuous authorization during execution

Build evidence from strict scoped application work to independent recovery/audit, then platform capacity and failure-window decisions.

Learning objectives: Preserve trusted identity and current authorization across data copies, queues, checkpoints and external effects; implement local audits and estimate bounded resources, while declaring unimplemented deployment races and validation.

Content checked: 2026-10-03 · Each level has independent explanations, tasks and inspections

Choose a starting point based on your familiarity with this topic. Current level: Foundation · Understand the concepts. After completing the task, continue to the next level. Reading and self-checks alone do not establish mastery.

On this level

Review the prerequisites

Suitable for: Backend developers learning Agent applications.

Tenant isolation and continuous authorization during execution
Tenant isolation must cover reads, caches, model context, logs, artifacts, and recovery. Establish trusted tenant identity through authentication and service policy, and preserve the same authorization boundaries during every recovery or fallback.

How does the mechanism work?

Step-by-step explanation
  1. How are log and vector indexes isolated?

    Isolation must cover logs and copies of vector data as well as the database.

  2. Why might restoring old backups violate deletion requirements?

    A durable platform must check whether recovery reintroduces deleted data.

  3. What can the execution plane do when the control plane is unavailable?

    A control-plane failure still requires explicit availability boundaries for the execution plane.

Foundation · Understand the concepts

Understand the principle · Tenant isolation and continuous authorization during execution

Objectives of this level: Predict trusted identity and current permission across the full copy/execution chain before choosing platform components.

Visual guide · Carry isolation through the run

Carry isolation through the run

These are platform boundaries to preserve, not a deployed 50-tenant system. Check caches, artifacts, logs and restored context as well as primary reads. Select the figure to open it at full size.

One platform; learning modes and job capabilities are separate

The case is the same after-sales Agent: read an order, retrieve current return policy, draft a return-application proposal, obtain human approval, execute and reconcile its receipt. The existing capstone uses fictional acme/other tenants, Alice/Bob ownership and an independent merchant HTTP service. It does not implement a 50-tenant managed platform, a general queue/outbox, production identity, an embedding index or production capacity.

Foundation/implementation/debugging/design are four learning modes, not four job ranks. Use an evidence ladder separately:

  • Junior application work: implement strict input and tenant-boundary functions, call an API, explain why model-provided tenant/approved fields cannot authorize it, and retain actual negative controls. Start with the four prerequisite contracts.
  • Intermediate ownership: implement a personal read/audit or business change, preserve identity/receipt across restart, reject revoked cache/checkpoint sources, and explain a reproducible failure using the independent receipt rather than local status.
  • Senior platform work: own cross-service invariants, capacity and fairness assumptions, authorization races, migration/recovery release conditions, operational audits and a failure-window ADR. Supply executable local evidence plus the unimplemented production validation plan. Local scripts alone do not establish senior production experience or a hiring outcome.

Fixed input: identify authority before choosing storage

This JSON is a platform design input, not an added capstone schema. The authenticated session is trusted; the request and historical copies are not current authority.

{
  "scope": "fictional_platform_design_input_not_capstone_schema",
  "trusted_session": {
    "subject": "alice",
    "tenant": "acme",
    "auth_version": 2,
    "active": false
  },
  "request": {
    "order_id": "o-other",
    "tenant": "other",
    "subject": "other",
    "approved": true
  },
  "queued_task": {
    "task_id": "main-return",
    "tenant": "acme",
    "owner": "alice",
    "admitted_auth_version": 1,
    "status": "ready"
  },
  "derived_copies": [
    {
      "entry": "index",
      "tenant": "acme",
      "source_version": 1,
      "policy_version": 1
    },
    {
      "entry": "cache",
      "tenant": "acme",
      "owner": "alice",
      "auth_version": 1,
      "policy_version": 1
    },
    {
      "entry": "checkpoint",
      "tenant": "acme",
      "owner": "alice",
      "auth_version": 1,
      "policy_version": 1
    }
  ],
  "current_policy_version": 2,
  "merchant_receipt": null,
  "public_policy": {
    "publication_approved": true,
    "contains_private_dependency": false
  }
}

Derive the decisions in order. Alice is currently inactive, so suspend sensitive order reads and new writes. Neither request.tenant=other nor approved=true changes her authority. queued_task.status=ready records historical workflow state, not a new permission grant. The index, cache and checkpoint are stale candidates; restoring or querying them must not release private body to the model, user, evaluation worker or export process. A separately publication-approved policy with no private dependency may use a bounded public path, but public text does not authorize the private order. No receipt here proves a committed application; do not claim one.

Follow the copy and execution chain

For each entry write down trusted principal, resource scope, version check, failure decision and evidence: admission; queue claim/resume; database/order API; index/reranker/model context; cache and every dependency; checkpoint/summary; tool commit; log/artifact/export. A tenant prefix isolates names but does not authenticate a subject or prove permission freshness. The same tenant's Alice and Bob still have different order ownership. A privileged log reader is also an authenticated role, not a blanket exception.

Control plane owns approved policy/configuration/quotas/releases; execution plane consumes bounded versions and reports actual state. Separate authorization version, document/source version, workflow schema version and worker fence: advancing one does not refresh the others. PostgreSQL RLS may add a database boundary; superusers/BYPASSRLS and normally owners bypass it, so test the actual connection role. RLS does not cover an external cache, index or already-built model context.

Deliver tenant-boundaries.json with the predicted decisions before running examples. Contrast a current active Alice/acme order with this revoked session and a Bob-owned order. Record which bytes might already have been sent: filtering later cannot recall an earlier model/provider response, log or backup.

Existing evidence and scope

The RAG permission lab checks five read entries, versions, cross-user cache and all dependency rows; its scores are simulated metadata. The memory revocation lab rejects a current-epoch summary whose second source is revoked/missing while retaining an unrelated preference. The capstone rechecks current merchant identity/policy/memory at business commit and audits actual local receipts. Their fixtures differ; map the invariant and restate each input contract rather than renaming fields blindly.

career-route; approval; capstone; capstone_zh; rag; memory; outbox; queue; workflow; prereq; protocol; pg; aws; owasp

code example

Namespace is not freshness

A cache can be correctly namespaced acme/alice yet still carry auth_version 1 after revocation at version 2. A partition eliminates name collisions but cannot refresh that permission.

Acceptance task for this level

Deliver tenant-boundaries.json for the displayed revoked-session input, active-Alice control and Bob-owned order; identify every body-release/effect boundary and which old bytes cannot be recalled.

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

Does an acme cache prefix plus status=ready make Alice’s restored task authorized?

Further explanations and practice

When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.

All linked explanations and exercises (1 )

Sources and verification scope

The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.