Skip to content

[feat] agent: redact credentials from exported traces before considering removal of download warning #506

Backlog

Description

@yefuyou

Context

Follow-up idea from @FayeSpica's approval of PR #422:

Maybe as a follow-up, we could redact credentials such as API keys and auth tokens from trace exports, then remove the download confirmation dialog.

PR #422 merged the conversation-wide original trace ZIP download. It intentionally preserves each available JSONL source byte-for-byte, including model.jsonl, and currently warns the user before downloading because the original trace may contain sensitive information.

This issue records a potential future improvement, not a commitment to implement it. Unassigned, not scheduled, and no implementation PR is proposed yet.

Problem and design constraint

Users may want to attach trace archives to bug reports or share them for debugging, but raw model/tool traces can contain credentials, bearer tokens, headers, prompts, tool outputs, and private paths.

A redacted archive would no longer be the byte-for-byte original trace. That difference must be explicit in the UX and archive metadata; a sanitized export must not silently replace the original evidence format or claim to be safe against every form of secret disclosure.

Proposed exploration (scope to agree before implementation)

  • Define the intended product contract: raw diagnostic archive, redacted sharing archive, or a clearly distinguished choice between both. Preserve trace diagnostic usefulness, provenance, and the Turn / tool-call / Job correlation.
  • Review sources and likely secret surfaces, including JSONL model requests/responses, authentication fields, nested tool inputs/results, CLI output, and any free-form text. Use fixture-only synthetic secrets in tests.
  • Prefer structured, field-aware redaction where a schema is known, combined with a carefully scoped strategy for unstructured values. Avoid brittle global substring replacement that alters timestamps, identifiers, structural JSON, or unrelated diagnostic evidence.
  • Ensure failures or unknown formats do not create a false safety guarantee. Define whether an unredactable entry aborts a sanitized export, remains warned, or is omitted and explicitly reported; never silently publish potentially secret-bearing data as sanitized.
  • Preserve a manifest record of the export mode, redaction policy/version and any omissions or incomplete processing. Do not include the original secret value in redaction reports or errors.
  • Only consider removing the confirmation dialog after the sanitization contract, coverage, and residual-risk UX are reviewed and accepted. Credential redaction alone cannot guarantee prompts, personal data, or arbitrary tool output are safe to share.
  • Keep export read-only and bounded, and keep the existing download working unless the maintainers explicitly approve changing its semantics.

Candidate acceptance criteria (for a future implementation)

  • Maintainers agree on what “redacted trace export” guarantees and how it is distinguished from the original ZIP.
  • Representative known credential-bearing fields and nested JSON are redacted in synthetic fixtures, without changing unrelated trace events, Turn IDs, Job IDs, or error diagnostics.
  • Mixed runtimes, malformed JSONL, arbitrary text, binary/encoding edge cases, missing sources and archived turns have documented behavior.
  • Tests verify the exported files contain no planted test secrets, including manifest, error messages, paths and metadata, using an independent archive reader.
  • The original trace export remains available and clearly marked as sensitive if retained; sanitized output never labels itself as “original byte-for-byte”.
  • Bilingual UX communicates the remaining privacy limitations. Removal of the download confirmation is a separate decision, not automatic acceptance of this feature.
  • No project-state mutation or new provider calls.

Status / ownership

Parking this proposal for discussion only. No assignee, milestone, branch, or PR. Maintainers can decide priority, scope, and ownership later.

Related: #421, merged #422, #374, #409.

Activity

  1. added
    area:agent
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions