Add support-agent example: mock customer-support agent

Demonstrates two harness surfaces the previous examples skipped:

- SkillProvider: KB articles in examples/support-agent/kb/ are exposed
  via runtime.SkillProvider. The runtime auto-registers load_skill and
  inlines a compact article index into the static (cacheable) system
  prompt; full bodies load on demand.

- PermissionChecker: tickets_update and escalate_to_human are gated on
  a 'supervisor' flag. FilterToolDefs hides the gated tools from the
  LLM tool list in non-supervisor mode so it doesn't waste turns
  inventing calls that would just be denied.

Five concrete tools (kb_search, tickets_get, tickets_create,
tickets_update, escalate_to_human) plus the auto-registered load_skill.
Five seed KB articles cover refund policy, escalation matrix, account
recovery, password reset, and API rate limits — chosen to exercise the
common support patterns each tool involves.

In-memory ticket store (examples/support-agent/store.go) seeded with
four tickets in different states. Webhook delivery for escalations is
optional via SUPPORT_AGENT_WEBHOOK; when unset the tool prints the
escalation banner to stdout, so the demo runs with only
ANTHROPIC_API_KEY set.

Tests (support_test.go) cover store CRUD, defensive copying, the
permission checker's read/write split, and KB indexing/search — all
offline, no API needed.
This commit is contained in:
sausheong committed 2026-05-08 00:10:49 +08:00
1 parent 152f653dd7
commit 8ed38d7b66
12 files changed
+1368 -2

No files matched your search

@@ -0,0 +1,40 @@
# Account Recovery
When a customer reports they've lost access or their account was
compromised, follow this script. Do **not** improvise: every step here
exists because of a past incident.
## Step 1 — Triage in one question
Ask: "Are you locked out of your account, or are you still logged in
but seeing activity you don't recognise?"
- **Locked out** → password-reset flow (see `password-reset` article).
- **Unfamiliar activity** → suspected compromise (continue below).
## Step 2 — Suspected compromise
1. **Do not ask for the password**, ever.
2. Tell the customer to immediately:
- Sign out of every active session from Settings → Security → Sign
out everywhere.
- Rotate their password via the standard reset flow.
- Rotate any API keys via Dashboard → API → Keys → Rotate.
- Enable 2FA if not already on.
3. File a ticket with subject `Possible account compromise` and
priority `urgent`.
4. Add an internal note listing what the customer reported (IPs,
timestamps, what they noticed).
5. **Escalate to Security** via `escalate_to_human` — do not attempt
to investigate access logs yourself.
## Step 3 — What we tell them
> "I've filed an urgent ticket and our security team will reach out
> within 30 minutes. While you wait, please rotate your credentials
> using the steps above. If you see any further suspicious activity,
> reply to this thread with timestamps and we'll add them to the
> investigation."
Never confirm or deny what the security team will find — that's their
call to make.