# Agent → Playground (`/agent/playground`)

Status: CONFIRMED by the operator 2026-09-12, with one addition: above each
trace, one plain-words sentence saying why the AI answered as it did. Not built
yet; on the board.

## What it is for
Talk to the AI as a contact would, on any channel and in any situation, and
read the trace behind every reply before a real customer ever sees that
behaviour. Nothing here reaches a customer or a platform.

## What it must show
- A **Channel** picker (WhatsApp, Instagram, Facebook, website) and a **Case**
  picker (conversation, comment reply, moderation), so the same words can be
  tried where they would actually land.
- For a comment case, a **Post in context**: pick one of the synced posts so
  the AI reads its stored description, or "No post (comment alone)".
- A chat pane: your messages as the contact, the AI's replies as they would be
  sent, "Thinking…" while it runs, and a few suggested openers ("Try one of
  these") for an empty pane.
- Under every reply, the **trace**: the prompt blocks it was given, the tools it
  called and what they returned, the knowledge it retrieved, the decision and
  its reason, confidence, model, tokens and cost.

## What it must do
- Run a turn with the live prompt, knowledge and tools, in preview mode: tools
  that write (CRM, hand-offs) simulate success and nothing is sent anywhere.
- Mark every turn as a playground turn so it is excluded from Activity's
  counts and from analytics.
- Reset the conversation.

## Deliberately not here
- No prompt editing (Behaviour), no switches (Settings), no side effects.
- No comparison of models side by side; that lives with the models settings.

## Known gaps against intent
- A playground turn spends real model tokens; there is no per-day cap on it.
- The trace is the developer's view of the turn; a plain-words "why it said
  this" line above it is not there yet.

## Proof
`Playground.test.tsx` passes; a playground turn on prod appears in no Activity
count and writes no message row.
