fix(redaction): stop redacting issue keys, Copilot call ids and code identifiers

Merged
MI
20d ago
+210-8

AI coding session redaction replaced values that are not secrets. A rule matches a value once in a key: value position. The redactor then replaces every copy of that value in the session. When the value is an issue key or a common word, the placeholder spreads into tool results, prose, file names and the spec entries. The ai-config-no-secrets policy then reports each placeholder as a leaked credential.

This change removes three false-positive shapes. The redactor still replaces every copy of a real secret.

  • generic-api-key keeps a Jira issue key, such as the key in the arguments of a Jira tool call. The project key part has at most 10 characters, which is the Jira default.
  • The AI coding session redactor treats the apiCallId of a GitHub Copilot model call as opaque data, like base64 media. The value is a long base64 id, and the key name holds api.
  • generic-password keeps an unquoted value that is shaped like a code variable and names a credential: a camelCase or snake_case name such as registryPassword or client_secret, or the bare word secret or token before a code delimiter. The upstream rule drops unquoted values in code files, but it reads the file type from a path that the scanned document does not have.
    • A quoted value is still redacted.
    • A value with a digit or a symbol is still redacted.
    • A plain word in a config file or a command line, such as password: supersecret, is still redacted.
  • RulesetVersion changes to 5.

This change is narrower than the ^[A-Za-z_]+$ exemption that the issue proposes. That exemption also dropped real letters-only passwords in config files and command lines.

Sessions that are already uploaded keep their placeholders.

Closes #3817