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: Debugging · Diagnose failures. 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.

Debugging · Diagnose failures

Diagnose failures · Tenant isolation and continuous authorization during execution

Objectives of this level: Link a concrete stale-copy body release to the failed gate, repair a personal fault copy and separate containment from committed-effect reconciliation.

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.

Exact observed evidence, not a status-based permission guess

In the capstone's current_user_permission_revoked drill, the worker exits 2 with permission_denied, local status can remain ready, and the independent merchant count is 0. Denied authentication cannot rewrite protected task state. In cancel_after_business_commit, status is completed_after_cancel and count is 1. Explain both before touching code: local ready is neither current permission nor an effect; local cancellation does not erase an independently committed effect.

Public platform incident input

The following is a disclosed design rehearsal, not a production trace or an unseen diagnostic exam. It combines the same platform boundaries into one sequence; no deployed queue/cache incident is claimed.

{
  "scope": "public_platform_design_rehearsal_not_production_log",
  "events": [
    {
      "seq": 1,
      "kind": "admit",
      "task": "t-revoke",
      "tenant": "acme",
      "owner": "alice",
      "auth_version": 1,
      "operation_key": "return:t-revoke:v1"
    },
    {
      "seq": 2,
      "kind": "prepare_copies",
      "cache_auth_version": 1,
      "checkpoint_auth_version": 1,
      "index_policy_version": 1
    },
    {
      "seq": 3,
      "kind": "revoke",
      "owner": "alice",
      "current_auth_version": 2,
      "active": false,
      "current_policy_version": 2
    },
    {
      "seq": 4,
      "kind": "restore",
      "status": "ready",
      "checked": [
        "checkpoint.status"
      ],
      "authority_lookup": false
    },
    {
      "seq": 5,
      "kind": "cache_body_release",
      "cached_auth_version": 1,
      "body": "private order detail",
      "current_authority_checked": false
    },
    {
      "seq": 6,
      "kind": "write_attempt",
      "operation_key": "return:t-revoke:v1",
      "merchant_result": "permission_denied",
      "merchant_effects": 0
    }
  ],
  "separate_unknown_write": {
    "task": "t-unknown",
    "operation_key": "return:t-unknown:v1",
    "local_status": "outcome_unknown",
    "merchant_receipt_exists": true
  }
}

Before opening any optional explanation, save incident-before.md with observed sequence IDs, two hypotheses, the first body-release invariant violated and one discriminating check. Do not infer that merchant rejection at sequence 6 repaired the disclosure at sequence 5. For t-unknown, a timeout is not evidence of no application; keep its operation key and receipt fact. Access to that receipt still requires an authorized subject.

Execute a focused failing copy, then repair your own module

Use your personal RAG serve and memory restore_context modules from the linked lessons in a separate scratch directory. First retain a known-fault copy which checks only the first derivative dependency; do not change fixture labels. Use the complete implementation-layer probes in those lessons: RAG binds dev-user auth 4/policy 3, with readable d-dev followed by unauthorized d-fin or stale ACL 4; memory uses current epoch 2, live s-style first and revoked/missing s-email second. The faulty copies must fail; same-input repaired copies must pass, and two-valid-dependency controls must still return useful bodies. This is known-fault repair practice, labeled guided_repair, not proof of independent diagnosis. Have a reviewer supply a complete new log/input after public work is frozen for transfer evidence.

Submit the before diagnosis, faulty/repaired modules and diff, the same-input assertion outputs and imported module hashes. Fix the actual body-release/restore gate, not the final answer text. Mark unimplemented entry adapters such as queue resume, artifact download and old-backup readers; a repaired cache handler is not a full platform repair.

Trace the causal chain to a containment decision

The supplied evidence supports a stale-authority release at resume/cache, not a merchant database isolation failure. Contain by pausing sensitive resumes, denying unknown authority, and inventorying bodies already released. Rebuild derivatives only from currently authorized sources; invalidate a mixed derivative when any dependency fails. Keep already-issued write reconciliation separate from authorizing a new write. Test both same-tenant different owner and different tenant, equal document IDs, revoke/regrant generations, expired policy and authority outage.

Log who could view the trace, which fields were redacted and why. Store minimal IDs, versions, rejection reason and receipt binding, not raw private body in ordinary telemetry. The supplied teaching application records full payloads for reproduction; that is not a safe default production logging policy. A log/export path can leak even when every request handler denies correctly.

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

code example

One repaired entry is not every entry

A repaired cache may deny correctly while citation, checkpoint restore or trace export still returns the private body. Test each release path independently.

Acceptance task for this level

Submit incident-before.md before explanation; reproduce first-dependency-only failures in your RAG/memory modules, repair only those modules and retain unchanged-input negative/positive outputs and hashes. Add a scope/redaction containment note and mark guided_repair.

Acceptance self-checks

Reading this browser’s record…

Hide the answer and check your understanding

The merchant rejects sequence 6. Is the privacy incident fixed?

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.