module-5
Skill4 starsChanged 6 months agoMITView on GitHub
Teaching instructions for Module 5 (Authentication and Authorization) — use when module_id is module-5
3 other projects use a version of this.
Adopted by
Most recently taken up by
- NVIDIA/nemoclaw-communitytheir own version, first seen Oct 13, 2026
- brevdev/workshop-build-an-agenttheir own version, first seen Oct 9, 2026
- midegdugarova/operating-production-agentstheir own version, first seen Aug 3, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- brevdev/workshop-build-an-agent★ 156same name
- NVIDIA/nemoclaw-community★ 142same name
- midegdugarova/operating-production-agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- python/deep_tutor/AGENTS.mdAGENTS.md
- python/m5/l5/AGENTS.mdAGENTS.md
- python/m6/dacli_tutor/AGENTS.mdAGENTS.md
- typescript/deep_tutor/AGENTS.mdAGENTS.md
- typescript/m5/l5/AGENTS.mdAGENTS.md
- module-1Skill
- module-2Skill
- module-3Skill
- module-4Skill
- module-5Skill
- module-6Skill
- module-1Skill
- module-2Skill
- module-3Skill
- module-4Skill
- module-6Skill
- module-1Skill
- module-1Skill
- module-2Skill
- module-3Skill
- module-4Skill
- module-5Skill
- module-6Skill
- module-1Skill
- module-2Skill
- module-3Skill
- module-4Skill
- module-5Skill
- module-6Skill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Start with the distinction: authentication answers "who is this?", authorization answers "what can they do?".
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Module 5 — Authentication and Authorization
Lesson Title
Authentication and Authorization in a Multi-Tenant Deployment
Goal
Walk the student through adding real auth to a LangGraph deployment: first identifying users (@auth.authenticate), then scoping their access to resources (@auth.on), then swapping the toy token store for a real identity provider, then wiring it into the tutor agent.
How to run this lesson
- Start with the distinction: authentication answers "who is this?", authorization answers "what can they do?". The two decorators map cleanly to those two questions.
- Walk through m5.1's request-pipeline diagram before touching code. Students should know where in the request lifecycle the auth handler runs.
- For m5.2 (local auth), emphasize that
@auth.authenticateis the ONLY interception point and that its return value flows into the rest of the request. - For m5.3 (private conversations), the key idea is metadata stamping on writes + filter dict on reads. Bob gets a 404 (not 403) on Alice's thread because the filter makes the thread invisible — there's nothing to forbid.
- For m5.4 (Supabase), call out that the
@auth.onhandler from m5.3 does NOT change — only@auth.authenticateis swapped. This is the payoff for keeping auth and authz decoupled. - For m5.5 (tutor), reinforce that
deep_tutor'sstore_namespaceis email-derived (independent of auth identity). Auth gates "can this user call?" while namespace decides "where does their data live?". They meet in@auth.on.store().
Key concepts to cover
@auth.authenticate— receives the rawAuthorizationheader, returns aMinimalUserDictwith at minimumidentity, or raisesAuth.exceptions.HTTPException(401)@auth.on— fires after authenticate, on every resource access; stamps metadata on writes and returns a filter dict on reads- The
langgraph.jsonregistration —auth.path = "./auth.py:auth"is what wires the handler in - Scoped vs broad handlers —
@auth.on.threads.createis more specific than@auth.on; most specific wins - Why Bob gets a 404 (filter, not deny) — the resource is invisible, not forbidden
@auth.on.store()is different — no automatic filter, the handler asserts/raises to allow/block; namespace[0] convention- Swapping the token store — from hardcoded dict (m5.2) to Supabase JWT validation (m5.4); only
@auth.authenticatechanges - Two access paths to the authenticated user —
ctx.user.identityin@auth.onhandlers,runtime.server_info.user.identityin graph nodes - The OAuth2 three-role model — Client App, Auth Provider, Agent Server; the Agent Server never stores credentials
- Auth vs namespace in
deep_tutor— auth gates calls;context.store_namespace(email-derived) decides where data lives; meeting point is@auth.on.store()
Tone guidance
Precise about the contract — students often confuse authentication with authorization. Hammer the separation. When discussing examples, refer to Alice/Bob/admin (the lesson personas) so the student can connect explanations to concrete lab runs.
Reference material
Full reference material is in information.md in this directory. Read it before answering factual questions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

