Cybrary ForgeCYBRARY / FORGE
Curriculum
A-240·AI safety·40 min

The confused deputy: an agent spending someone else's authority Start this lab

A user signed in once to let the assistant read a file. Minutes later the assistant is writing to finance with that signature. Work the runner's token log, prove where the authority changed hands, and close the boundary without breaking the honest workflow.

Mission brief · A-240

Detection & automation engineer

Detection / automation engineer
Business important
Track default

You are acting as

you, signed in to the automation platform as `eng.you` (build role, not the on-call responder)

How you got here

You are not on the console watching the queue. You picked up a case the on-call analyst already triaged and were asked to make the response repeatable, so you're working the *replay* of that case in the automation platform.

Your access

  • Automation platform (author + test)

    Automation platform

    • Edit playbooks
    • Run against a replayed case
    • Inspect run history and context paths
    • Not yours: Act on production hosts
    • Not yours: Approve your own consequential actions
  • Ticketing (read + work notes)

    Ticketing / ITSM

    • Read the originating case
    • Attach run evidence to the case

What's at stake

The playbook itself

Owner: SOC manager (approves anything that touches production)

A playbook that contains hosts without an approval gate will do it at 3am, at machine speed, to every host in the batch.

Rules of engagement

You may act alone

  • Edit and test the playbook
  • Run it against the replayed case
  • Write work notes

Ask a human first

  • Promoting the playbook to production
  • Any action node that contains, disables or deletes

Where this sits in a real SOC

In a real SOC the analyst works the alert and hands the *pattern* to you. This lab teaches automation design judgement, not triage judgement — pair it with a Tier 1/2 triage lab.

Why this matters

An agent almost never needs a new exploit to over-reach: it already holds authority somebody handed it for a smaller job. The confused-deputy pattern is the most common way agentic access turns into a breach, and it is invisible unless you read the token trail rather than the tool list.

Concepts

Consent is scoped to a moment, not to a session

A user approving a file read is not approving a finance write ten minutes later. When a runner exchanges that signature for a broader audience, the human's consent has been spent on something they never saw.

Audience and scope are the boundary

Read the audience claim first: it names which service will accept the token. A token exchanged for a second audience is a crossing, and any scope beyond read on that crossing needs a human on it.

Contain the deputy, not only the door

Removing the finance tool leaves the exchange path open for the next tool. The runner identity is the thing that can repeat the move, so it is the thing containment has to reach.

Objectives graded

  • Read an agent's token trail and find where authority changed hands
  • Separate the user's consent from the agent's own identity
  • Contain the deputy without breaking the honest workflow

Live walkthrough

The reference response, executed by the same engine that grades your attempt. Yours will differ — the rubric reads end state and evidence, not the shape of your workflow.

  1. 1.Approve consequential actionpromptapproval gateApprove consequential action
  2. 2.Write case field credentialRefactioncredentialRef → vault/soc-automation
  3. 3.Attach evidence: case/soar-a-240/evidenceactionThe learner attached at least one linkable piece of evidence to the case.
  4. 4.Write case field closureNoteactionclosureNote → written
  5. 5.Attach evidence: range/hst-ai-agent01/sessionactionThe token trail was read on the runner rather than taken from the ticket.
  6. 6.Write case field escalatedAudienceactionescalatedAudience → api://northwind-finance
  7. 7.Write case field escalatedScopeactionescalatedScope → files.readwrite.all
  8. 8.Write case field deputyOutputactiondeputyOutput → /var/lib/northwind-agent/out/ledger-q1.csv
  9. 9.enabled on usr-svc-agent-runneractionusr-svc-agent-runner.enabled → false
  10. 10.Write case field segmentGatewayactionsegmentGateway → 10.42.48.1
  11. 11.Write case field seatRamGbactionseatRamGb → 16
  12. 12.Write case field seatDiskGbactionseatDiskGb → 512

Gate approved — 100%

17 of 17 rubric rules hold.

Gate denied — 92%

Refusing the consequential action is a defensible choice with a measured cost; the difference is what the lab is teaching.

  • pass behavior · The workflow reached a terminal success state on the graded run.
  • pass safety · A consequential action passed through a human approval gate.
  • pass efficiency · No non-idempotent operation was retried without an idempotency key.
  • pass configuration · Every action node resolves its secret from the vault, never an inline field.
  • pass investigation · The learner attached at least one linkable piece of evidence to the case.
  • pass explanation · The case carries an analyst closure note explaining the outcome.
  • pass behavior · No innocent asset in the alert batch was contained, disabled or revoked.
  • pass configuration · The playbook survived the integration faults it met and still finished.
  • pass investigation · Nothing was changed in the estate before evidence had been gathered.
  • pass investigation · The token trail was read on the runner rather than taken from the ticket.
  • pass investigation · The audience the token was exchanged for was identified from the log.
  • pass configuration · The scope the exchange granted was named, not guessed.
  • pass behavior · The artifact produced with borrowed authority was located on disk.
  • pass safety · The runner identity was disabled under approval while the exchange path stayed open.
  • pass investigation · The analyst scoped the host's network from the wire, so containment decisions know which segment is in play.
  • pass investigation · The analyst scoped the machine itself, so memory-hungry triage steps are planned against real capacity rather than a guess.
  • pass investigation · Disk capacity was taken from the volume itself, which is what makes an image or memory-dump decision defensible.

MITRE ATT&CK coverage

A token exchanged for a second audience is authority the user never granted: the agent becomes the deputy an attacker spends.

TechniqueNameTactic
T1134.005Access Token Manipulation: SID-History InjectionPrivilege Escalation
T1550Use Alternate Authentication MaterialDefense Evasion
T1078.004Valid Accounts: Cloud AccountsDefense Evasion

What each rubric rule proves

  • The workflow reached a terminal success state on the graded run.

    behavior · weight 20

  • A consequential action passed through a human approval gate.

    safety · weight 15

  • No non-idempotent operation was retried without an idempotency key.

    efficiency · weight 10

  • Every action node resolves its secret from the vault, never an inline field.

    configuration · weight 10

  • The learner attached at least one linkable piece of evidence to the case.

    investigation · weight 10

  • The case carries an analyst closure note explaining the outcome.

    explanation · weight 10

  • No innocent asset in the alert batch was contained, disabled or revoked.

    behavior · weight 15

  • The playbook survived the integration faults it met and still finished.

    configuration · weight 15

  • Nothing was changed in the estate before evidence had been gathered.

    investigation · weight 10

  • The token trail was read on the runner rather than taken from the ticket.

    investigation · weight 15

  • The audience the token was exchanged for was identified from the log.

    investigation · weight 10 · T1134.005 Access Token Manipulation: SID-History Injection (Privilege Escalation)

  • The scope the exchange granted was named, not guessed.

    configuration · weight 10 · T1550 Use Alternate Authentication Material (Defense Evasion)

  • The artifact produced with borrowed authority was located on disk.

    behavior · weight 10

  • The runner identity was disabled under approval while the exchange path stayed open.

    safety · weight 20 · T1078.004 Valid Accounts: Cloud Accounts (Defense Evasion)

  • The analyst scoped the host's network from the wire, so containment decisions know which segment is in play.

    investigation · weight 5

  • The analyst scoped the machine itself, so memory-hungry triage steps are planned against real capacity rather than a guess.

    investigation · weight 3

  • Disk capacity was taken from the volume itself, which is what makes an image or memory-dump decision defensible.

    investigation · weight 3

Common mistakes

  • Reading the tool list and never reading the token log.
  • Treating on-behalf-of as proof the user approved this action.
  • Disabling the finance tool and calling the boundary fixed.

Same idea, three vendors

Vocabulary is generated from the teaching profiles, so it always matches what the consoles render.

ConceptCortex ForgeSummit SOARStoryline
approvalManual taskPromptPage

Where does this value come from?

The same reference to an enrichment node's verdict, written three ways:

  • Cortex Forge: ${enrich-sender.verdict}
  • Summit SOAR: enrich-sender.verdict
  • Storyline: <<enrich-sender.verdict>>

The same concepts in shipping products

The consoles you practice in use teaching names. These are the words the real vendors print in their own documentation, so the vocabulary survives the day you sit in front of a production tenant.

ConceptCortex XSOARXSOAR 8.xSplunk SOARSplunk SOAR 6.x (formerly Phantom)TinesTines (2026 cloud)Microsoft Sentinel + Logic AppsSentinel (Defender portal, 2026)Google SecOps SOARSecOps SOAR (formerly Siemplify)Swimlane TurbineTurbine (2026)Torq HyperautomationTorq (2026)IBM QRadar SOARQRadar SOAR (Resilient) 51.xServiceNow Security OperationsSecOps (Flow Designer era)
approvalManual (data collection) taskPrompt blockPage (form) / Send to ChatApproval action (Teams / email)Manual actionTask / approval actionApproval step (Torq Chat / Slack)Manual task / phase gateApproval activity

What transfers

Audience, scope and on-behalf-of chains work the same way in OAuth, workload identity and service meshes — the reading generalizes far past agents.