Commit 625c495
authored
fix(aio): drop the OTLP telemetry token from process env after reading it
The sandbox delivers POSTHOG_AGENT_OTEL_LOGS_TOKEN via the container
environment, which agent-spawned tool subprocesses inherit - so any `env`
dump in a persisted transcript or PR body would leak the key (flagged by
review bots on PostHog/posthog#71100).
bin.ts is the only consumer: parse it into the server config, then delete
it from process.env so children never see it. Defense in depth, not a
boundary - same-UID processes can still read the container's initial env
via /proc; the key itself remains a write-only capture token scoped to a
dedicated telemetry project.
No test: a one-line env mutation at the CLI entry with no cheap seam;
exercising it would mean spawning the CLI end to end.
Generated-By: PostHog Code
Task-Id: 0c511836-2180-455a-9b58-45df2a0661ec1 parent 28dca3e commit 625c495
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
| |||
0 commit comments