Repository navigation
Description
Summary
Add an administrator-only Support Log Export workflow that collects retained SimpleChat diagnostic logs into a downloadable, privacy-reviewed ZIP for administrators to share manually with the development team. Include optional personal-conversation transcripts only after explicit approval from the actual conversation owner.
User Value
Administrators need a self-service equivalent of the developer's troubleshooting collection process: identify an affected user and conversations, collect the surrounding diagnostic evidence, remove recognizable sensitive data, and download one useful support bundle. This should work with ordinary retained logs and be especially useful when debug logging was enabled during the incident, without granting administrators unrestricted access to personal messages.
Proposed Behavior
Administrator workflow
Extend Admin Settings > Operations > Logging & Health with a Support Log Export section in both the classic and V2 interfaces, backed by the same API.
- Select one registered SimpleChat user or explicitly select all users.
- Choose an explicit time range, or select one or more conversations from a metadata-only list/search, including lookup by conversation ID.
- For conversation collection, use editable before/after margins, defaulting to 15 minutes each. Merge overlapping windows and avoid collecting the unrelated gaps between conversations.
- Collect correlated records by default. Allow an explicit option for nearby, separately labeled system context.
- Show source readiness, exact UTC windows, source limitations, privacy mode, consent state, progress, a redacted preview, expiry, and an authenticated ZIP download.
- Keep export actions separate from saving unrelated admin settings. Never enable extra logging automatically or send the ZIP anywhere automatically.
Retained log sources
Use existing Azure Monitor/Application Insights telemetry and Cosmos activity/audit records, with optional existing file-processing diagnostics. Include App Service console logs only when the deployment already collects them in Azure Monitor. Query only configured SimpleChat resources with fixed server-owned queries and managed identity/read-only access.
Unavailable sources, missing query permissions, retention/sampling/ingestion limits, and incomplete historical correlation must be visible. An ingestion connection string does not grant query access. Do not promise to recover logs that were never collected.
Add content-free user/conversation/request correlation to future logging where needed. Intentionally forward debug-gated log_event(debug_only=True) records through the existing tagged Application Insights debug path when configured, without duplicating other debug traces or changing debug-off behavior.
Optional personal transcripts and consent
- Transcripts are off by default and unavailable in all-users mode or for shared/group/collaborative conversations in this version.
- The user approves the whole selected personal conversation as a fixed snapshot, not just the diagnostic time window. Show exact scope, requester, purpose, privacy mode, AI destination when applicable, and expiry before approval.
- Reuse the approvals/notifications experience but add an explicit subject-owner-only authorization policy. An Admin or ControlCenterAdmin role does not authorize approving somebody else's release.
- Bind the grant to one export and the approved snapshots. Changes to content, scope, or disclosure settings cannot reuse stale consent.
- Revalidate consent, ownership, snapshot identity, revocation, and expiry before materialization/download. Do not expose messages or sensitive titles in pre-consent admin responses.
- Include user-visible user/assistant messages in JSON and readable Markdown; exclude hidden prompts/reasoning, raw source documents, attached binaries, and unrestricted blob/citation downloads.
- Declined/expired/revoked consent must block transcripts, with an explicit logs-only alternative rather than silent omission.
Privacy review
Always scrub recognizable credentials. Default to deterministic PII redaction using existing credential and content-screening rules, plus export-specific identifier/IP handling and consistent per-bundle pseudonyms. Do not include reverse mappings or original matched values in reports or audit events.
Offer an optional AI privacy pass using the configured default text/chat model through existing AI Connections helpers. It receives only deterministically scrubbed data, has tools/actions disabled, and detects validated field/span references rather than rewriting the logs. Inspect all exported free text within the approved budget; never silently sample or mark a partial/failed pass as AI-reviewed. Privacy checks remain best effort and must not be presented as a guarantee of anonymity or regulatory compliance.
Confirmed guardrails and packaging
- Last-hour time-range default; maximum 7-day effective log interval and 20 selected conversations.
- Maximum 100,000 records and 50 MiB total uncompressed ZIP contents; reject oversize requests rather than truncate silently.
- Optional AI inspection capped at 200,000 input tokens across all batches, respecting smaller per-request model context limits. Larger requests require narrowing or an explicitly chosen deterministic-only export.
- Generated ZIPs expire after 24 hours, with authenticated no-store downloads and private staging; no public/SAS URLs.
- Durable, idempotent, leased jobs with bounded concurrency, cancellation, stale-worker fencing, and cleanup. Another admin does not automatically gain access to an export someone else created.
- Include a manifest with app/schema version, UTC windows, source coverage/exclusions, counts, checksums and consent references; structured JSONL logs; a readable chronological log; a privacy report; approved conversation snapshots when selected; and a short bundle README.
Acceptance Criteria
- Both classic and V2 admin interfaces complete the workflow without handing off to another UI.
- Ordinary users/dashboard readers cannot use admin export APIs, and object-level tests prevent forged conversation/user IDs and cross-admin archive access.
- Time/user/conversation filters, disjoint windows, pagination, timezone handling, and all confirmed limits are enforced server-side.
- Azure Monitor and Cosmos collection is app/resource-scoped; unavailable sources, partial results, missing permissions, throttling, and ingestion/retention limitations are not hidden by successful empty exports.
- Future user/conversation correlation works without recording raw identifiers or payloads; debug-off behavior and no-duplicate forwarding are covered.
- Optional whole personal-conversation snapshots require exact owner consent, with no administrator override and no shared-conversation transcript release.
- Deterministic and optional complete AI privacy checks cover every exportable text field; archives/reports/telemetry contain no injected recognizable test credentials or original redaction evidence.
- AI budget, refusal, malformed output, unavailable model, prompt injection, cancellation, and partial-coverage cases cannot become success-shaped AI-review results.
- Durable jobs survive worker changes, reject stale writes, respect cancellation/expiry, clean temporary/private artifacts, and produce valid safe ZIP contents with no-store download headers.
- Add targeted functional and Azure Playwright coverage, real installed Cosmos SDK boundary evidence, route-policy coverage, and V2 type/build checks.
- Update feature/admin/approval/workflow documentation, logging tags, feature catalog, generated feature stubs, and app-surface inventory.
- At implementation end, bump only the third application version segment in
application/single_app/config.pyand align new test/documentation version headers. Ask separately about release notes and an issue completion update.
Notes
Triage: P2; size L; assignee Paul Lizer (@paullizer); Simple Chat Roadmap prioritized backlog. This is a planned feature, not an implemented capability.
Current code context: functions_appinsights.py, functions_control_center_activity.py, functions_logging.py, content_screening/deterministic.py, functions_ai_connections.py, functions_approvals.py, functions_notifications.py, background_tasks.py, classic templates/admin/_panes/logging.html, and V2 AdminSettingsPage.tsx.
The application already pins azure-monitor-query==1.4.1; reuse the SDK and existing Azure endpoint validation rather than exposing the model-callable Log Analytics plugin as an admin query console.
Out of scope: a new retained-log collector for deployments without Azure Monitor; shared/group transcript consent; automatic uploads/email to support; arbitrary KQL; attachment/source-document exports; and an AI-generated root-cause summary. No deployment, cloud permission, live extraction, or AI operation is authorized merely by this planning issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsPending Evaluation
Activity