René's URL Explorer Experiment
Title: fix(cli): stop logging project env var values in the "started attempt" debug log by enderyildirim · Pull Request #4457 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: fix(cli): stop logging project env var values in the "started attempt" debug log by enderyildirim · Pull Request #4457 · triggerdotdev/trigger.dev
X Title: fix(cli): stop logging project env var values in the "started attempt" debug log by enderyildirim · Pull Request #4457 · triggerdotdev/trigger.dev
Description: Fixes the remaining leak site from #3566.
What I observed
On a self-hosted v4 install, each runner container writes the whole startRunAttempt response body to stdout at the start of every attempt. WorkerApiRunAttemptStartResponseBody is StartRunAttemptResult & { envVars: z.record(z.string()) }, so that object contains the full project environment variable map. Redacted excerpt of a real runner log:
{"timestamp":"...","message":"started attempt","$name":"managed-run-logger","$level":"log",
"start":{"envVars":{
"DATABASE_URL":"postgresql://user:REAL_PASSWORD_WAS_HERE@db:5432/app",
"SOME_PROVIDER_API_KEY":"REAL_KEY_WAS_HERE",
"APP_SIGNING_SECRET":"REAL_SECRET_WAS_HERE"
}, ...}}
Those values landed in every runner container's json log file, one entry per attempt.
Why the existing redaction doesn't catch it
SimpleStructuredLogger passes each line through redact() from packages/core/src/logger.ts, but filterKeys matches on the whole lowercased key name:
if (keys.has(key.toLowerCase())) { ... }
envVars isn't in DEFAULT_FILTERED_KEYS, so it's recursed into, and the user-defined names inside it (DATABASE_URL, SUPABASE_SERVICE_ROLE_KEY, …) match nothing in the list either. That leaves only SECRET_VALUE_PATTERN, which catches tr_*, sk-* and Bearer * — so a Postgres URL, a JWT-shaped service key, or a hex master key all pass through verbatim. The payload and metadata fields on the same object are filtered, which is why this is easy to miss.
ManagedRunLogger.sendDebugLog also forwards the same properties to the webapp debug-log endpoint via flattenAttributes, with no redaction on that path. It's gated behind TRIGGER_SEND_RUN_DEBUG_LOGS (default false), so it only leaks for operators who turned that on — but when they do, unredacted.
Why it matters for self-hosters
Runner stdout goes to whatever collects container logs (Loki, CloudWatch, Datadog, plain docker json files). Those pipelines are usually treated as low-sensitivity and are broadly readable, retained for weeks, and often shipped off-box. A task that needs any credential to do its job ends up publishing that credential there on every single attempt. LOG_LEVEL / DEBUG don't suppress it: sendDebugLog uses SimpleStructuredLogger.log, which is LogLevel.log = 0, the lowest value in the enum, so the if (this.level < LogLevel.log) return guard can never fire.
What I changed
execution.ts now logs an explicit projection instead of the raw response body — new executionLogging.ts, mirroring the buildWorkerLogging.ts split added in #4420 so the payload is unit-testable:
this.sendDebugLog("started attempt", startedAttemptLogProperties(start.data));
which yields run/snapshot identifiers, attempt number, task, queue, machine preset, and envVarKeys — the environment variable names only.
Two deliberate choices:
Redact rather than remove. The entry is a useful "the attempt started, here is what it started with" marker, and the names answer the common question of whether a variable actually reached the runner. Only the values are dropped.
Allow-list, not deny-list. envVars keys are user-defined, so no name-based deny-list can classify them — hence values are dropped wholesale rather than filtered. For the rest of the body an allow-list means a new field on the API response can't silently reintroduce a leak. This matches #4336, which fixed the equivalent leak in taskRunProcess.ts by logging Object.keys(fullEnv).
Since both sinks share one properties object, this fixes the stdout and webapp-endpoint halves together.
Scope
The other two sites named in #3566 are already handled on main, so this PR leaves them alone:
taskRunProcess.ts — fixed by #4336 (released in 4.5.7); logs envKeys now.
controller.ts — ...env.raw became ...env.rawForLogging, which redacts TRIGGER_DEPLOYMENT_ID. The rest is the bounded RunnerEnv zod schema, so no project secrets reach it.
One thing I noticed but did not touch, to keep this to a single issue: the debug-log HTTP sink in ManagedRunLogger.sendDebugLog flattens the raw mergedProperties, so it doesn't get the redact() pass that the stdout sink gets from SimpleStructuredLogger. Any other sendDebugLog caller that passes something sensitive is therefore protected on stdout but not on the wire. Happy to open a follow-up if you'd like that sink to redact too.
How I tested
Added packages/cli-v3/src/entryPoints/managed/executionLogging.test.ts (4 tests, passing): asserts the serialized properties contain neither an env var value nor the run payload, that the env var names survive, the exact field set, and the envVars-absent case.
Confirmed the test fails if the projection regresses — adding the raw body back to the returned object turns 2 of the 4 red.
oxlint and oxfmt --check clean on the touched files.
tsc -p tsconfig.src.json --noEmit reports the same 7 errors with and without this change (all from workspace packages I hadn't built), so no new type errors.
I could not run snapshot.test.ts / taskRunProcess.test.ts in the same package: they need a built @trigger.dev/core, and building it needs Node 24, which I don't have locally. They fail identically on a clean checkout of main, so this change doesn't affect them, but I have not run the full cli-v3 suite.
Open Graph Description: Fixes the remaining leak site from #3566.
What I observed
On a self-hosted v4 install, each runner container writes the whole startRunAttempt response body to stdout at the start of every attempt. ...
X Description: Fixes the remaining leak site from #3566.
What I observed
On a self-hosted v4 install, each runner container writes the whole startRunAttempt response body to stdout at the start of every attempt. ...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4457
X: @github
direct link
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:39ed3376-8cf7-898b-2cf6-cb6a3b2724bf |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E1CE:42EA3:3343FA7:48BB2CF:6AFAF73B |
| html-safe-nonce | f66d60e86e777828a35183be5bb582063a21c74023ff74ecd09d5929643b1f56 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUNFOjQyRUEzOjMzNDNGQTc6NDhCQjJDRjo2QUZBRjczQiIsInZpc2l0b3JfaWQiOiI4OTM3MDExMDI5ODMzNjExMDY3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b2515943b5769e279e7c4495e8d5465e3e40734950b0b2f24cf1584c59b07bbe |
| hovercard-subject-tag | pull_request:4185714311 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| twitter:image | https://avatars.githubusercontent.com/u/16105744?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/16105744?s=400&v=4 |
| og:image:alt | Fixes the remaining leak site from #3566.
What I observed
On a self-hosted v4 install, each runner container writes the whole startRunAttempt response body to stdout at the start of every attempt. ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a85e96a83bed7871993e6b1ffda24105928eee17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4457%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4457%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| triggerdotdev | https://github.com/triggerdotdev |
| trigger.dev | https://github.com/triggerdotdev/trigger.dev |
| Code | https://github.com/triggerdotdev/trigger.dev |
| Issues203 (203) | https://github.com/triggerdotdev/trigger.dev/issues |
| Pull requests67 (67) | https://github.com/triggerdotdev/trigger.dev/pulls |
| Discussions | https://github.com/triggerdotdev/trigger.dev/discussions |
| Actions | https://github.com/triggerdotdev/trigger.dev/actions |
| Projects | https://github.com/triggerdotdev/trigger.dev/projects |
| Security and quality39 (39) | https://github.com/triggerdotdev/trigger.dev/security |
| Insights | https://github.com/triggerdotdev/trigger.dev/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose |
| enderyildirim | https://github.com/enderyildirim |
| triggerdotdev:main | https://github.com/triggerdotdev/trigger.dev/tree/main |
| enderyildirim:fix/redact-started-attempt-env-vars | https://github.com/enderyildirim/trigger.dev/tree/fix/redact-started-attempt-env-vars |
|
Conversation
5
| https://github.com/triggerdotdev/trigger.dev/pull/4457 |
|
Commits
1
| https://github.com/triggerdotdev/trigger.dev/pull/4457/commits |
|
Checks
2
| https://github.com/triggerdotdev/trigger.dev/pull/4457/checks |
|
Files changed
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
|
fix(cli): stop logging project env var values in the "started attempt" debug log
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#top |
|
Show all changes
1 commit
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
|
5c98043
fix(cli): stop logging project env var values in "started attempt" de…
enderyildirim Aug 1, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4457/commits/5c980436b6665a817ebce7f8b0801f1882c03fce |
|
Clear filters
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
|
redact-started-attempt-debug-log.md
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-abecc699e74a7710462712889a6d788d8f161199af07b922b51fc718137392d4 |
|
execution.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
|
executionLogging.test.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-712ac943bcc7296a9e085eded4c1346ef7a93b945e3c4872739bcdc6b13ac612 |
|
executionLogging.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-b9964b45d89506359c10e58ce874308f56c93402da59bce90b866f0be3648fd7 |
| .changeset/redact-started-attempt-debug-log.md | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-abecc699e74a7710462712889a6d788d8f161199af07b922b51fc718137392d4 |
|
View file
| https://github.com/enderyildirim/trigger.dev/blob/5c980436b6665a817ebce7f8b0801f1882c03fce/.changeset/redact-started-attempt-debug-log.md |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4457/{{ revealButtonHref }} |
| packages/cli-v3/src/entryPoints/managed/execution.ts | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
|
View file
| https://github.com/enderyildirim/trigger.dev/blob/5c980436b6665a817ebce7f8b0801f1882c03fce/packages/cli-v3/src/entryPoints/managed/execution.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4457/{{ revealButtonHref }} |
|
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
|
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
|
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
|
| https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-fd09e5be9c6024f887d9c86bad758d66df933478d302ba98e754b61f1ddd1713 |
| packages/cli-v3/src/entryPoints/managed/executionLogging.test.ts | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-712ac943bcc7296a9e085eded4c1346ef7a93b945e3c4872739bcdc6b13ac612 |
|
View file
| https://github.com/enderyildirim/trigger.dev/blob/5c980436b6665a817ebce7f8b0801f1882c03fce/packages/cli-v3/src/entryPoints/managed/executionLogging.test.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4457/{{ revealButtonHref }} |
| packages/cli-v3/src/entryPoints/managed/executionLogging.ts | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#diff-b9964b45d89506359c10e58ce874308f56c93402da59bce90b866f0be3648fd7 |
|
View file
| https://github.com/enderyildirim/trigger.dev/blob/5c980436b6665a817ebce7f8b0801f1882c03fce/packages/cli-v3/src/entryPoints/managed/executionLogging.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4457/{{ revealButtonHref }} |
| devin-ai-integration | https://github.com/apps/devin-ai-integration |
| Aug 1, 2026 | https://github.com/triggerdotdev/trigger.dev/pull/4457/files#r3696801383 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
|
| https://app.devin.ai/review/triggerdotdev/trigger.dev/pull/4457 |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4457/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Viewport: width=device-width
URLs of crawlers that visited me.