fix(sanitization): secret exposure in function and agent trace spans - #6000
fix(sanitization): secret exposure in function and agent trace spans#6000BillLeoutsakosvl346 wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@cursor review |
PR SummaryHigh Risk Overview Provenance is tracked so masking knows which plaintexts to replace: the Function execute API reports Workflow execute projects masked UI retry uses Docs add Execution log protection under Secrets and update agents, MCP, logs, Function, and variables pages with scope and limitations (not a general redactor; encoded/transformed values not matched). Reviewed by Cursor Bugbot for commit c9302a5. Configure here. |
Greptile SummaryThis PR stops resolved environment secrets from appearing in workflow trace spans and Overview logs while keeping runtime execution and API payloads unchanged.
Confidence Score: 5/5No prior Greptile findings remain to re-score and no eligible follow-up inline comments were identified, so the PR appears safe to merge from this pass. No blocking failure remains from outstanding prior threads or newly eligible incomplete-fix findings in this follow-up review.
|
| Filename | Overview |
|---|---|
| apps/sim/executor/utils/resolved-secret-trace-registry.ts | New catalog/active-match registry with encrypted provenance, scope checks, and bounded export-for-value filtering for cross-boundary secret tracking. |
| apps/sim/lib/logs/execution/trace-secret-projection.ts | Terminal projection that rewrites secret literals in trace trees (including large-value refs) without mutating runtime block state. |
| apps/sim/lib/logs/execution/logger.ts | Completes logs with prepared/projected spans, preserves private provenance on PII-masked execution state, and adjusts size compaction of tool-call content. |
| apps/sim/executor/variables/resolvers/env.ts | Records resolved env secrets into the trace registry only when the name exists on execution environment variables. |
| apps/sim/lib/workflows/executor/execution-core.ts | Wires registry creation and trace projection into the main workflow execution completion path. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
EnvResolve["EnvResolver.recordResolved"] --> Registry["ResolvedSecretTraceRegistry"]
Nested["MCP / function / mothership / nested WF"] --> Prov["Encrypted provenance import/export"]
Prov --> Registry
Runtime["Raw block I/O for execution"] --> Logs["buildTraceSpans / completeWorkflowExecution"]
Registry --> Project["projectTraceSpansForSecrets"]
Logs --> Project
Project --> Persist["Persisted executionData.traceSpans"]
Project --> Overview["Overview / export / UI logs"]
Reviews (5): Last reviewed commit: "secrets sanitization correctness" | Re-trigger Greptile
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 95d4fd1. Configure here.
|
@cursor review |
|
@greptile please review the latest commit, including the workflow-overview sanitization follow-up and the streaming token-accounting correction. |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e73afbe. Configure here.
|
Demo: Screen.Recording.2026-07-28.at.12.00.01.AM.mov |
…zation-trace-spans # Conflicts: # apps/sim/lib/logs/execution/logging-session.ts
…zation-trace-spans
…zation-trace-spans
…zation-trace-spans
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 35187658 | Triggered | Username Password | 64f791f | apps/desktop/src/main/browser-credentials/vault.test.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
bugbot run |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2eb706a. Configure here.
…zation-trace-spans
…zation-trace-spans
…zation-trace-spans
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c9302a5. Configure here.
What changed
{{ENV_VAR}}references in trace/display values, including nested tool calls, timing segments, errors, object keys, and URL-encoded values.Root cause
Block inputs and provider/tool outputs were logged after environment references had been resolved. Function display code also resolved environment values, and post-executor paths could overwrite sanitized logs with raw streaming, pause-state, or workflow final-output data immediately before persistence.
Impact
New trace spans and Overview workflow output show configured references such as
{{AWS_SECRET_ACCESS_KEY}}instead of plaintext values. Runtime tool/function execution, API responses, downstream block behavior, billing, retries, pause/resume, and persisted runtime state remain unchanged. Existing historical logs are not rewritten.Validation
git diff --check