Identity, authorization, privacy, and data protection

Enforce the same access rule on every route to data.

Visual lessons: 1 · 1:40 total Read estimate: 5 min Practice estimate: 12 hr Updated: 2026-10-03
In this lesson · P6 of 12All lessons in this track →

Progress for this track is saved in this browser only. No completion badge is issued. View your learning.

Start with the idea

Enforce the same access rule on every route to data.

Check identity and permission before revealing records. Apply that rule to search, caches, exports and logs. If required identity information is missing, deny rather than guess.

Tenant: An organization or user group whose data must remain separated from others.

See the example and check your understanding

A made-up teaching example

The two-tenant exercise tests direct reads, cached reads, export and log access. Missing tenant information leads to denial with a limited audit record.

Ask yourself

Is a prompt instruction enough to repair a leaking cache path?

Show the explanation

No. Repair shared access enforcement and every caller. Deleted resources and unknown identity must stay blocked.

Start with these checks

  • Test every path to the record.
  • Deny missing or invalid identity.
  • Keep audit records limited to allowed metadata.

Use the different practice case below and check every requirement in its full instructions.

Go to the practice task ↓

The video explains the main idea. Use the sources, instructions and checks below to complete the practice.

Visual lesson1:40

Captions appear here during playback.

Identity, authorization, privacy, and data protection

Enforce the same access rule on every route to data.

Download transcriptOpen video file

Source-based teaching example · Fictional data · Reviewed 2026-10-03. Microsoft Mark · locally synthesized. On a small screen, use fullscreen for diagram details or read the transcript.

Read the descriptive transcript

0:00 · What you will learn

Enforce the same access rule on every route to data.

What appears on screen

Enforce the same access rule on every route to data.

0:06 · The idea

Check identity and permission before revealing records. Apply that rule to search, caches, exports and logs. If required identity information is missing, deny rather than guess.

What appears on screen

Check identity and permission before revealing records. Apply that rule to search, caches, exports and logs. If required identity information is missing, deny rather than guess.

0:21 · One useful term

Tenant. An organization or user group whose data must remain separated from others.

What appears on screen

An organization or user group whose data must remain separated from others.

0:30 · A worked example

The two-tenant exercise tests direct reads, cached reads, export and log access. Missing tenant information leads to denial with a limited audit record.

What appears on screen

The two-tenant exercise tests direct reads, cached reads, export and log access. Missing tenant information leads to denial with a limited audit record.

0:44 · Your turn to think

Is a prompt instruction enough to repair a leaking cache path? Pause and decide before continuing.

What appears on screen

Is a prompt instruction enough to repair a leaking cache path? Pause the video if you need more time.

1:01 · Why this answer works

No. Repair shared access enforcement and every caller. Deleted resources and unknown identity must stay blocked.

What appears on screen

No. Repair shared access enforcement and every caller. Deleted resources and unknown identity must stay blocked.

1:12 · Check 1

Test every path to the record.

What appears on screen

Test every path to the record.

1:17 · Check 2

Deny missing or invalid identity.

What appears on screen

Deny missing or invalid identity.

1:22 · Check 3

Keep audit records limited to allowed metadata.

What appears on screen

Keep audit records limited to allowed metadata.

1:28 · Now try a different case

Open the lesson and try its different practice case. Use every check in the full task. Watching alone does not mark the lesson complete.

What appears on screen

Open the lesson Try the new case Check and revise The full task and its requirements are in the linked lesson.

Watching explains the example. Complete the lesson practice to check what you can do. Explore all visual lessons →

What you will be able to do

  1. Implement least-privilege authorization for users and services.
  2. Protect data across retrieval, tools, logs, and exports.
  3. Design retention, deletion, and access review.

Prerequisites: Builder-level interface validation, Python, testing, metadata logging and state-transition tracing. Hardware benchmarks and model accounts are not required.

This curriculum runs self-study on VetsLearn. Where the text calls for an instructor, peer or formal review, use the stated acceptance criteria for self-review. Reflection questions support reflection; they do not replace independent assessment. A peer review is optional unless your actual organization requires it.

Part 1 Technical instruction

Authentication establishes an identity with stated assurance; authorization decides whether that principal may perform an action on a resource in context. Models do neither reliably. RBAC groups permissions by role; ABAC evaluates attributes such as tenant, ownership, purpose, and resource label. Enforcement must be consistent across retrieval, cache, tool, log, and export paths and fail closed when attributes are missing. Privacy engineering minimizes collection and retention, limits purpose, supports deletion, and makes exceptional full-content access auditable.

Mechanism and implementation

Bind access to identity, action, resource and current policy version. Prompt roles are not identity. Retrieval, tools, caches, logs and export are distinct paths that need common enforcement. Purpose or entitlement changes require deletion/invalidation of derived copies and queued work under the approved policy.

Constructed offline example

Save as topic_example.py and run python topic_example.py with an installed Python 3.11+ interpreter. This standard-library construction uses synthetic values; its checks are not provider measurements.

def permitted(actor, resource, action):
    return (actor.get("tenant") is not None and actor.get("tenant") == resource.get("tenant")
            and action == "read" and resource.get("deleted") is False)
resource = {"tenant": "one", "deleted": False}
assert permitted({"tenant": "one"}, resource, "read")
assert not permitted({"tenant": "two"}, resource, "read")
assert not permitted({"role_in_prompt": "admin"}, resource, "read")
resource["deleted"] = True
assert not permitted({"tenant": "one"}, resource, "read")
print("access and deletion checks passed")

Engineering decisions

  • Select central policy inputs and enforcement points.
  • Partition caches and telemetry by authorization context.
  • Define fail-closed behavior and break-glass governance.

Worked example

A two-tenant case system includes allowed and denied records. Tests attempt direct retrieval, cached retrieval, export, and log access across tenants. Missing tenant attributes deny access and generate a metadata-only audit event.

Diagnose the failure

Unknown identity and deleted resources deny. If one path leaks, repair shared enforcement and every caller; adding a prompt instruction is insufficient.

Part 2 Guided practice

Trace tenant two through read, retrieval, cache and export. Independently change policy after caching and revalidate every read. Explain why matching classification labels alone do not authorize a person.

Answer criteria and feedback: Unknown identity and deleted resources deny. If one path leaks, repair shared enforcement and every caller; adding a prompt instruction is insufficient.

Continue with the downloadable pack below. If the pack or interpreter is unavailable, trace this self-contained example by hand in an input/expected-status/controlling-rule table and label execution unverified. Do not invent passing output. No account, credential, paid call, purchase or actual deployment is required.

Part 3 Remediation

Trace a denied resource through every path. If one path leaks, freeze the exercise, preserve the trace, and repair the common enforcement layer rather than individual prompts. After repair, reassess with the alternate scenario in scenario_alt.json. A critical authorization, data-handling, evidence-integrity, or prohibited-action failure cannot be averaged into successful practice; it requires targeted remediation.

Part 4 Sources and currency

Use the workflow decision reference for model/deployment/harness distinctions and controlled comparisons. Source currency must be checked before each cohort. Provider/product behavior is illustrative where mocked; resolve current interfaces only from official documentation in an authorized environment.

Lesson status:PRACTICE REVIEW REQUIRED

Review your practice