systemdesign.academyAI EngineeringFree lessonsSign inGet the course
  1. Home
  2. AI Engineering: Evaluation, LLM Ops and Security
Previous lessonTool and Sandbox Security: Locking Down What an Agent Can DoNext lessonOWASP Agentic Threat Model and Red-Teaming Your Agent

System Design

  • Foundation
  • Intermediate
  • Advanced
  • Capstone

AI Engineering

  • Foundation
  • Data, RAG and Agents
  • Evaluation, LLM Ops and Security

systemdesign.academy

  • Home
  • Glossary
  • Interview prep
  • Reviews
  • About
  • Pricing
  • Privacy
  • Terms
  • Refunds
  • Delivery
  • Contact
  • AI Security and Agent Safety
  • Agent Identity and Authorization: Whose Authority Is It?
  • AI Engineering · Security

    Agent Identity and Authorization: Whose Authority Is It?

    Free preview: the first part of this 13-part lesson.

    Already bought the course? Sign in to read the whole lesson.

    this lesson is part of

    AI Engineering

    Unlock this lesson and the 199 other paid lessons

    • 210 lessons in 16 chapters
    • 118 lessons built on a lab that really ran
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the AI Engineering course

    The rest of this lesson

    1. Two Questions, and Two Subjects, Behind Every Agent Call
    2. Least Privilege Is an Intersection, Not a Union
    3. Delegated Authority With OAuth Token Exchange
    4. The aud Claim: A Token That Only Fits One Lock
    5. Delegation vs Impersonation: Can the Log Still Name the Agent?
    6. The Token That Expires Before It Can Be Abused
    7. Token Passthrough: The Confused Deputy the Tool Lesson Deferred
    8. One User's Data, and Only That User's
    9. Identity for Agents That Have No User
    10. Centralize the Decision: The PEP Asks, the PDP Decides
    11. The Agent That Holds No Standing Key
    12. Knowledge Check

    read the rest of this lesson in

    AI Engineering

    Unlock this lesson and the 199 other paid lessons

    • 210 lessons in 16 chapters
    • 118 lessons built on a lab that really ran
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the AI Engineering course

    Continue this lesson

    in Security

    This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.

    One-time payment. Lifetime access. No subscription.
    Global
    $49/lifetime

    One-time payment via PayPal

    Get Lifetime Access
    Foundation lessons free, try before you buy
    India Special
    India
    ₹999/lifetime

    One-time payment: UPI, card or netbanking

    Get Lifetime Access
    Foundation lessons free, try before you buy
    Every ML Platform lesson, Foundation to Advanced
    Real architecture diagrams with real tool logos
    MLOps, LLMOps, and data engineering in depth
    Quizzes with instant feedback
    Built and reviewed by senior engineers
    Lifetime access, all future content included

    Foundation lessons of this course are free, no payment needed. Try them now

    When an Agent Acts, Whose Authority Is It Using?

    Here is the question that decides whether your agent is safe or a liability, and almost no first version answers it. When the agent reads a database row, sends an email, or deletes a record, whose permission is it acting on?

    Most agents answer this by accident. They get one service key with broad scope so they work for every user, and that key becomes the agent's standing authority. It never expires. It works for every tenant. It is convenient, and it is the single most dangerous design choice you can make.

    Blast-radius reach grid: two side by side panels over the same four-tenant backend, the broad admin key lighting all twelve tenant-by-resource cells red for 40,800 reachable records across all four tenants, and the per-task scoped token lighting only the single acme tickets cell green for 5,000 records, one tenant read only, an eight times smaller reachable surface for the same delivered task

    Read the picture as a mismatch. The user on the left is allowed to see their own tickets and nothing else. The agent in the middle carries an admin key that reaches every customer's tickets, everyone's billing records, and an admin surface that can delete accounts. Now recall what the sandbox lesson established. An agent reads untrusted text on every turn, from web pages, PDFs, and tool output, and it cannot always tell a real instruction from an injected one. Point that agent at a broad key and one poisoned input runs with admin power, not with the narrow power of the person who asked.

    The term for the reachable damage behind a credential is the blast radius. This whole lesson is about shrinking it. The goal is simple to state and takes real work to reach. The agent should act with the requesting user's authority, narrowed to the task in front of it, and never with authority of its own. Everything below is the machinery that makes that possible: how you authenticate two subjects at once, how you delegate authority without copying it, how you bind a token to one resource and one short window, and how you give an identity to an agent that has no user at all.