Before any signal leaves the process it MUST be redacted: an attribute declared secret MUST never be written; the user information of a URL and the value of a query parameter whose name says it is a credential (token, key, secret, password, signature, code, and the like) MUST be replaced by REDACTED; a bearer token, a basic credential and a private key block found in a value MUST be replaced; and a process's arguments MUST be kept as the program and its option names alone, never their values. Text MUST be redacted by one function, the same for signals and for a message a harness sends (a mail, a notification), so that what may not be exported may not be mailed either: besides the above it MUST replace the value of a name=value or name: value pair, quoted or bare, in prose, JSON, YAML or an environment file, whose name ends in token, secret, password, passwd, passphrase, apikey, accesskey, secretkey, privatekey, credential or signature (case, -, _ and . ignored), the credential of an Authorization header with any scheme, the token formats that announce themselves (GitHub, GitLab, Slack, Google, Cloudflare, Anthropic, OpenAI, Stripe, npm, DigitalOcean, Docker, Hugging Face, Linear, Atlassian, JSON Web Tokens) and crypt password hashes ($6$, $y$, $2b$), and every exact secret of four characters or more that its caller names (the credential in use).
Enforced (check): .github: cd commons/telemetry && bun test suite/ — otel.test.ts: redaction of secret attributes, URLs, tokens, name=value pairs, provider token formats
Proved by: telemetry/suite/otel.test.ts, telemetry/suite/signals.test.ts
Written in: telemetry/tools/check.ts, telemetry/tools/pack.ts
Tests: passed: suite/otel.test.ts URLs lose their user information and the values of credential parameters; passed: suite/otel.test.ts a command line keeps the program and its option names alone; passed: suite/otel.test.ts an Authorization header keeps its scheme and loses its credential, whatever the scheme; passed: suite/otel.test.ts bearer and basic credentials, private keys and token shapes are replaced in text; passed: suite/otel.test.ts name=value pairs whose name is a secret's lose their values, in prose, JSON, YAML and envi and 3 more