Skip to content

docs(oss): add difficult-user simulation tutorial - #182

Draft
davidberenstein1957 wants to merge 7 commits into
mainfrom
docs-plan/item-09-difficult-user-tutorial
Draft

docs(oss): add difficult-user simulation tutorial#182
davidberenstein1957 wants to merge 7 commits into
mainfrom
docs-plan/item-09-difficult-user-tutorial

Conversation

@davidberenstein1957

Copy link
Copy Markdown
Member

Problem

how-to/simulate-users teaches the mechanics of UserSimulator (persona, max_steps, plugging it into Scenario.interact) but stops at a single cooperative persona, and reference/generators.mdx shows only a flight-booking persona. Nothing shows the interesting case — a hostile user, one who drifts out of scope, or one who social-engineers the agent — which is the whole reason multi-turn simulation exists.

Changes

  • New checks/tutorials/simulate-difficult-users.ipynb (+ generated .mdx): one support agent tested against three escalating personas, each its own section with reusable module-level persona constants.
    1. Frustrated customer — agent stays polite, never mirrors hostility, resolves or escalates within max_steps.
    2. Scope creep — refusal/redirect judge check plus a rule-level FnCheck on forbidden strings.
    3. Social engineering — no-leak check, contrasted with the prompt-injection scan generator.
  • Shows goal_reached is False as the pass condition where the goal is one the agent should deny, with prose explaining the inversion — a pattern absent from the docs today.
  • Closes with when simulation beats a fixed script (and when it costs too much); links back to how-to/simulate-users for parameter details.

Verification

  • Notebook executed, transcripts and outputs committed: all three personas pass, model gpt-4o-mini. .mdx regenerated via scripts/convert-notebooks.mjs; npm run build passes.

Notes / risks

  • Sidebar collision: items 06, 09 and 10 all chose tutorial sidebar.order: 6 — renumber on merge.
  • Item 16 reuses these personas; keep the constants stable.

🤖 Generated with Claude Code

davidberenstein1957 and others added 3 commits August 12, 2026 17:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
giskard-docs f79bc83 Commit Preview URL

Branch Preview URL
Aug 13 2026, 06:01 AM

davidberenstein1957 and others added 2 commits August 13, 2026 07:33
Re-ran simulate-difficult-users.ipynb on a fresh kernel: all three
personas pass and the weak-bot section still fails as advertised.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Use the Azure generator/client pattern the passing notebooks use, so the
notebook runs with the AZURE_AI_* credentials CI provides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidberenstein1957
davidberenstein1957 marked this pull request as ready for review August 13, 2026 05:48
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@henchaves

Copy link
Copy Markdown
Member

Out of scope for this cycle, let's postpone the review of this PR

@henchaves
henchaves marked this pull request as draft August 13, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants