Title: fix(executor): carry child provenance across the workflow agent tool result by waleedlatif1 · Pull Request #6619 · simstudioai/sim · GitHub
Open Graph Title: fix(executor): carry child provenance across the workflow agent tool result by waleedlatif1 · Pull Request #6619 · simstudioai/sim
X Title: fix(executor): carry child provenance across the workflow agent tool result by waleedlatif1 · Pull Request #6619 · simstudioai/sim
Description: Summary A workflow invoked as an agent tool now resolves {{VAR}} to the real decrypted value in the child run (#6611). The tool result handed back to the model vendor is projected through a registry that had dropped those entries, so the plaintext crosses to the vendor verbatim. This is on staging only — the release it belongs to has not been promoted — but it is a promotion blocker for staging → main. What reaches the vendor today on staging. For an agent whose tool is a workflow, the tool message serialized into the next model request contains the child's decrypted environment-variable values — in output.result, and also inside output.childTraceSpans, which carries every child block's inputs and outputs. Reproduced with the real registry, the real EnvResolver, and the real model projection: a live sk-live-… style token appears in both. Mechanism. Model-facing projection (projectToolResultForCopilot) forks with registry.forkForPropagatedEntries(), which keeps only entries a result explicitly carried. EnvResolver (executor/variables/resolvers/env.ts) records the resolution without propagated, unlike the other boundaries that hand a value onward (tools/index.ts, providers/runtime-context.ts). The child shares the caller's registry object, so blockLogs, trace spans and error diagnostics still redact correctly — they read the unforked registry. Only the model fork loses the entries. The blast radius is larger than the child's final output: mapChildOutputToParent puts the full childTraceSpans into the returned object, and postProcessToolOutput strips only __-prefixed keys. Why main does not have this. There, workflow_executor was an HTTP tool: the execute route emitted __resolvedSecretTraceProvenance, the tool imported it as propagated: true, and transformResponse curated the body so childTraceSpans never crossed. The in-process branch returns before any of that runs. The fix runWorkflowTool exports committed provenance for the value it is about to return and imports it back with { trusted: true }, which marks those entries propagated. This is the crossing the custom-block branch already performs in workflow-handler.ts; the non-custom branch skipped it only because the two registries are the same object — exactly the assumption the model fork breaks. Output-projection only. The returned result is byte-identical and the child executes exactly as before; only registry metadata changes. Applied on both the success and the failure return, so a child error message that embeds a resolved secret is covered too. Redacted values render as {{NAME}} — the same literal the model saw before the regression. Fails closed: an unusable envelope marks the registry incomplete, which reduces (never widens) what the model receives. Why not the alternative (marking EnvResolver's records propagated): propagated means "this result carries this secret across a boundary", not "a block consumed this secret". EnvResolver runs at input resolution for the executing block, in every workflow run, into the run-scoped registry — flipping it there would restate an output-crossing fact at an input site and change what crosses at every unrelated boundary in the product, for a defect that exists at exactly one. Smaller diff, much wider reach, and it does not become more correct than the precedent it replaces. Fixing the boundary that is actually broken keeps the canvas workflow block and the custom-block path untouched. On childTraceSpans. Curation alone would not have fixed result, so it was never a substitute. I also did not drop it here: the canvas workflow_input block runs through the same runWorkflowTool, and block-executor lifts childTraceSpans off that output into the block log for trace nesting (span-factory reads it) before stripping it from block state. Dropping it in the runner would silently break child-run traces in the UI. Child block I/O reaching the vendor is still questionable on its own merits, but it needs a model-facing output projection hook, which does not exist today (tools have request.modelInput, no output equivalent) — worth a follow-up, and it is now redacted either way. Short-literal caveat, stated plainly. MIN_SUBSTITUTABLE_LITERAL_LENGTH = 8 governs detection as well as substitution, so an environment value of 7 characters or fewer is not covered by this fix — not in the model result, and not in logs or traces either. That floor is deliberate (it subsumed the per-value exception lists that fixed prior false-positive incidents) and this PR does not touch it. A test pins the behavior so it is documented rather than silent. Testing New tests in workflow-tool-runner.test.ts drive the real ResolvedSecretTraceRegistry, the real EnvResolver, and the real projectToolResultForCopilot. The two leak tests fail on plain staging (secret present in result and in childTraceSpans; secret present in the projected error) and pass with the fix. A third test asserts an unrelated configured secret stays inert, and a fourth pins the short-literal limitation. Green: full executor/ suite (1947), tools/index, resolved-secret registry / projection / refusal suites, providers/runtime-context. bun run type-check clean; biome clean. Type of Change Bug fix Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary A workflow invoked as an agent tool now resolves {{VAR}} to the real decrypted value in the child run (#6611). The tool result handed back to the model vendor is projected through a registr...
X Description: Summary A workflow invoked as an agent tool now resolves {{VAR}} to the real decrypted value in the child run (#6611). The tool result handed back to the model vendor is projected through a registr...
Opengraph URL: https://github.com/simstudioai/sim/pull/6619
X: @github
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:8a0c5de3-c6e8-d595-167c-e8d7cc651f73 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D8E4:3D6EF:24F438:33CAD0:6AFB5253 |
| html-safe-nonce | 4e7bbdc33b7c27073fecba6243a4f9b6477b6f13e457d6405d8e775e6bcc6653 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEU0OjNENkVGOjI0RjQzODozM0NBRDA6NkFGQjUyNTMiLCJ2aXNpdG9yX2lkIjoiNDkwNzAwMjAxMDA4MDU5NjU2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56d23de020b35f0ba0d761f313c070cf4ed70d2ad1cc9161c1a2699b9a58b02b |
| hovercard-subject-tag | pull_request:4260768038 |
| 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 | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6619/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary A workflow invoked as an agent tool now resolves {{VAR}} to the real decrypted value in the child run (#6611). The tool result handed back to the model vendor is projected through a registr... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| 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 | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width