# Generate, review, and accept AI output

**Flow key:** `ai-generate-review-accept`

## Outcome

A user supplies authorized context, receives a grounded and safely rendered candidate, reviews uncertainty, and explicitly accepts only the intended version and side effects.

## Actors

- User/reviewer
- AI model/orchestrator
- Retrieval/tools
- Destination record/service

## Preconditions and entry points

- Representative synthetic prompts and source data exist.
- Model/prompt/version, safety, retention, cost, and acceptance behavior are observable.

## Required test data

Use synthetic, isolated, resettable data. Never use real credentials, payment instruments, private customer records, or production notifications.

| Data | Canonical valid seed | Critical variations |
|---|---|---|
| Prompt | `Draft a summary of CARBON Project Alpha` | empty, ambiguous, long, multilingual, emoji, adversarial instruction |
| Source | three synthetic project notes with known facts | missing, conflicting, stale, permission-restricted, injected |
| Expected content | fact checklist and prohibited claims | acceptable stylistic variation, abstention case |
| Model config | versioned model/prompt | fallback model, temperature/seed repetitions |
| Destination | draft field in `CARBON-PROJECT-001` | new record, email, external action, unauthorized target |

## Canonical steps

Treat this as the ordinary successful path inferred from common product behavior. Adapt it to observed labels, business rules, APIs, and implementation evidence; do not invent a requirement.

| Step | User or system action | Expected evidence |
|---:|---|---|
| 1 | Open the AI generation entry point. | Purpose, source scope, privacy, cost/limits, and whether output is a draft are clear. |
| 2 | Enter prompt and choose authorized context. | Untrusted content cannot alter higher-priority instructions or expand access. |
| 3 | Generate. | Streaming/progress, cancellation, latency, citations/grounding, and failure state are truthful. |
| 4 | Review output against the known fact and harm checklist. | Unsupported claims, uncertainty, omissions, and source boundaries are visible. |
| 5 | Edit or regenerate. | Versions remain distinct and user edits are not silently overwritten. |
| 6 | Explicitly accept/save/send. | Only the reviewed version and scoped side effect commit once with model/source/user audit. |

## Alternate paths

- Generate draft only
- Regenerate/compare candidates
- Human edit then accept
- High-impact action requiring second approval
- Fallback/abstain

## Failure and recovery paths

- Prompt injection in source
- Model invents facts
- Stream exposes later-redacted content
- Timeout after save/action
- Regeneration overwrites user edits

## Completion oracle

- The stated outcome is true in visible UI and authoritative persisted state.
- Exactly one intended business result and no unintended side effect occurred.
- Identity, tenant, authorization, money/data, lifecycle, notifications, integrations, analytics, and audit agree where applicable.
- Refresh, retry, back/forward, and a second authorized read do not reveal a contradictory result.
- Any partial, delayed, canceled, failed, or unknown outcome is labeled truthfully and has a safe recovery path.

## Evidence to capture

- Entry context, actor, tenant, role, feature flags, locale, time zone, and initial identifiers/state.
- Step-level screenshots or DOM state plus request/response, correlation, job, event, and stable business IDs where available.
- Before/after authoritative records, versions, totals, permissions, lifecycle states, and downstream side effects.
- Notifications, audit events, integration deliveries, retries, deduplication, latency, and recovery evidence.
- Untested branches, unsafe-to-run cases, product decisions, and evidence tier.

## Product decisions to resolve

- Exact eligibility, required data, authorization, and validation rules.
- Which steps are synchronous, asynchronous, optional, skippable, reversible, or irreversible.
- Idempotency, concurrency, timeout, retry, cancellation, and compensation semantics.
- Retention, privacy, notification, audit, performance, accessibility, and localization commitments.

## Related CARBON items

- [common ai baseline](../../items/ai/common-ai-baseline.md)
- [generate](../../items/ai/generate.md)
- [prompt surface](../../items/ai/prompt-surface.md)
- [approve reject](../../items/actions/approve-reject.md)

[Back to AI and automation flows](index.md)
