# Agent → Settings (`/agent/settings`)

Status: CONFIRMED by the operator 2026-09-11 ("build the two conversation
switches next").

## What it is for
Everything you set about the AI that is not an instruction: which channels it
answers on, who it answers, how sure it must be, and the fixed sentences a
customer reads. One copy of each, never per situation (ruling 20: Behaviour is
the prompt; this is the configuration).

## What it must show
- One card per channel, each with its on/off switches and a one-line "what this
  does": **Instagram comments** (reply, moderation, comment → private message),
  **Facebook comments** (reply, moderation), **WhatsApp conversations**,
  **Website chat**, and **Instagram conversations** and **Facebook
  conversations** (the direct-message gates). Every switch is on or off; no
  shadow, no canary (ruling 09-05).
- A warning on any combination that sends nothing (comment → private message on
  while the reply gate is off).
- **Test audience**: its own switch and its own list of ids; while on, the AI
  answers only those people and everyone else still reaches the Inbox.
- **Confidence thresholds**: how sure the AI must be before it acts on its own,
  per pass; below the bar a reply waits for approval.
- **Comment moderation by score** (BOARD 6): off until switched on, and today's
  moderation decides meanwhile; the two lines, hide from and delete from; beside
  them, per score band of the last 30 days, the comments and what people did
  after; folded, the second model, the keyword list and the written scale. Under
  the table, the 25-case test: last month's comments, each text once, its cost
  before the press, one run at a time, the last result at the lines above.
- **Fixed sentences**: the brief for the private message it opens with, its
  buttons (English and Arabic), and the "cannot answer" lines; a blank field
  means the standard wording. Each with a preview resolved the way the sender
  resolves it.
- Links out: "Review what it decided" (Activity) and the decision log.

## What it must do
- Flip any gate with a confirm that names what goes live and to whom.
- Edit and save the test audience, thresholds and fixed sentences.

## Deliberately not here
- No instructions, no headings, no knowledge: Behaviour.
- No connections or tokens: Settings → Connections.
- No numbers or status: Overview.

## Known gaps against intent
- **No switch exists for the Instagram or Facebook conversation gates**
  (`instagram:dms`, `facebook:dms`, both off on prod). Every document that told
  the operator to "flip the DM gate in Settings" described a control that is
  not built. The AI leg of the App Review screencast needs it.
- The fixed sentences still also render on Behaviour: one concept, two screens.
- Test audience and WhatsApp still share a `testWaIds` contract in the code.

## Proof
`AgentSettings.test.tsx`, `ChannelsTab.test.tsx` and the channel card tests
pass; on prod, each switch's value matches `settings.channelGates`.
