René's URL Explorer Experiment


Title: fix(executor): give the workflow agent tool the caller's env and PII policy by waleedlatif1 · Pull Request #6611 · simstudioai/sim · GitHub

Open Graph Title: fix(executor): give the workflow agent tool the caller's env and PII policy by waleedlatif1 · Pull Request #6611 · simstudioai/sim

X Title: fix(executor): give the workflow agent tool the caller's env and PII policy by waleedlatif1 · Pull Request #6611 · simstudioai/sim

Description: Summary A workflow attached as an Agent tool (workflow_executor) ran its entire child execution with environmentVariables: {} and no block-output PII redaction policy. The Pi block reaches the identical path (sim-tools.ts calls executeTool with executionContext: ctx), so it was affected the same way. The failure was silent, and it leaked. With an empty env map the child's resolver cannot resolve {{MY_API_KEY}}, so EnvResolver returns the raw reference and the literal string {{MY_API_KEY}} is transmitted to the third-party API. The vendor 401s, the user sees an opaque auth error, and the variable name has already been handed to the vendor in an Authorization header or request body. Nothing in Sim reports "environment variable missing". Separately, tenants who had explicitly enabled block-output PII redaction had it silently not applied to any child block in these runs. Mechanism buildCustomBlockExecutionContext hardcoded environmentVariables: {} when building the synthetic top-level ExecutionContext. That was safe for the branch it was written for: WorkflowBlockHandler.executeCore re-derives the publisher's env from getCustomBlockAuthority inside if (isCustomBlock), so the {} is provably overwritten before it is read. The workflow-as-agent-tool path's synthetic block carries metadata.id: 'workflow_input' — it is not a custom block. It takes the non-custom branch, which keeps ctx.environmentVariables as-is, so the hardcoded {} flowed straight into the sub-Executor. Both fields landed as unnoticed side effects of #5273; #6539 later patched a third dropped field on the same context without noticing these two. Fix Thread both values through the runner options bag. executeTool reads them off the trusted executionContext, never params._context — that bag spreads model-reachable contextParams._context first, so sourcing from it would let a model inject its own env map or disable redaction. A test pins that a smuggled _context.environmentVariables is ignored. Design decisions — please review these deliberately environmentVariables is required, not optional-with-a-default. This is the entire recurrence guarantee. An empty env map is a wrong identity, not an absent value, and silent omission is exactly how this shipped — twice. Making it optional shortens the diff and re-arms the footgun; a future caller that forgets it is now a compile error. piiBlockOutputRedaction stays optional. Here undefined genuinely is the correct value — most tenants have no policy at all. The asymmetry is intentional and documented in the TSDoc precisely so a future reader does not "unify" it. deployed_block_executor deliberately receives neither value. Custom blocks skip the same-workspace assert and run cross-workspace under the publisher's identity, so the consumer's env and redaction rules would be the wrong tenant's. A test pins this so a later refactor cannot silently unify the branches. Identity semantics — an honest note This is not main's behavior, and it is not a strict subset of it. On main this tool was an HTTP hop into execution-core, which derived env from the child workflow's owner. This forwards the parent caller's map, matching the long-standing canvas workflow block (workflow-handler.ts keeps ctx.environmentVariables on the non-custom branch). It is a different identity, not a narrower one — chosen because it matches the canvas block byte-for-byte, is bounded to one workspace by assertChildWorkflowInWorkspace, and is the only variant consistent with the parent resolvedSecretTraceRegistry this path already forwards. The narrow case that worked on main and still will not: a same-workspace child owned by another workspace member that relied on THAT member's personal environment variables. ⚠️ Release-note-worthy behavior change Re-enabling block-output masking inside child runs means redaction now runs there with onFailure: 'throw' (block-executor.ts aborts rather than feed unmasked data downstream). For tenants who enabled block-output PII redaction, a child agent-tool call that succeeds unmasked today can now fail closed. That restores main's intended semantic — the control was always supposed to apply — but affected users will feel it as new failures. Known gap, deliberately out of scope tools/index.ts coalesces executionContext?.environmentVariables ?? {} because executionContext is optional on the options bag. /api/providers builds a runtime context without one and accepts a caller-supplied tools array, so a workflow_executor_ posted there would hit the same empty-map defect. No in-repo caller does this today, and closing it means changing executeTool's identity contract — its own change, not this one. enforceCredentialAccess is dropped by the same synthetic context and is likewise deferred: forwarding the parent's value would tighten behavior versus main and could break currently-working child runs mid-release. Type of Change Bug fix Testing 233 tests across 4 suites. Reverting the three source files turns exactly 5 red — including the model-smuggled-env-map test and the deployed_block_executor-exclusion test. Type-check and Biome clean. 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 attached as an Agent tool (workflow_executor) ran its entire child execution with environmentVariables: {} and no block-output PII redaction policy. The Pi block reaches the iden...

X Description: Summary A workflow attached as an Agent tool (workflow_executor) ran its entire child execution with environmentVariables: {} and no block-output PII redaction policy. The Pi block reaches the iden...

Opengraph URL: https://github.com/simstudioai/sim/pull/6611

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:71ef97e8-4f5e-3848-13a3-8f66fbeaa016
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCDF0:327CBE:6D5660:9B3E15:6AFB47B5
html-safe-nonce810d87c28f74e481d3ab5a96e811c38c5b1426a939aa63765338498ed26d9b66
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREYwOjMyN0NCRTo2RDU2NjA6OUIzRTE1OjZBRkI0N0I1IiwidmlzaXRvcl9pZCI6IjczOTYwMTExNDUyNDIwMzYxNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac441a344e82e8b441a23dc85280b3ea3adab4c9ca95f07c575fa60f225f8212b7
hovercard-subject-tagpull_request:4260562907
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6611/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary A workflow attached as an Agent tool (workflow_executor) ran its entire child execution with environmentVariables: {} and no block-output PII redaction policy. The Pi block reaches the iden...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6611/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6611%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6611%2Ffiles
Sign uphttps://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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6611/files
Reloadhttps://github.com/simstudioai/sim/pull/6611/files
Reloadhttps://github.com/simstudioai/sim/pull/6611/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/b3-agent-tool-env-and-piihttps://github.com/simstudioai/sim/tree/fix/b3-agent-tool-env-and-pii
Conversation 3 https://github.com/simstudioai/sim/pull/6611
Commits 1 https://github.com/simstudioai/sim/pull/6611/commits
Checks 30 https://github.com/simstudioai/sim/pull/6611/checks
Files changed https://github.com/simstudioai/sim/pull/6611/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6611/files
fix(executor): give the workflow agent tool the caller's env and PII policy https://github.com/simstudioai/sim/pull/6611/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/6611/files
321438a fix(executor): give the workflow agent tool the caller's env and PII … waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6611/commits/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b
Clear filters https://github.com/simstudioai/sim/pull/6611/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6611/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6611/files
custom-block-tool-runner.test.ts https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
custom-block-tool-runner.ts https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
workflow-handler.test.ts https://github.com/simstudioai/sim/pull/6611/files#diff-182c6898e81ed049b72228d06098a79da369fbfa2129d094da599733fb5566e4
workflow-tool-runner.test.ts https://github.com/simstudioai/sim/pull/6611/files#diff-3fb03b6818608e62eca6cf2c5604cb665f55e26c38d64cfd5e6481d5f5f0a920
workflow-tool-runner.ts https://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
index.test.ts https://github.com/simstudioai/sim/pull/6611/files#diff-9ba0f7033f9247e496b4f9e0f46183a13c79b1bb48d721ba4bf042bdd08e4dd0
index.ts https://github.com/simstudioai/sim/pull/6611/files#diff-47ae0066fea628681d98d136239929a240a55aaf3d99ef293c83b3eca7e197c1
apps/sim/executor/handlers/workflow/custom-block-tool-runner.test.tshttps://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
View file https://github.com/simstudioai/sim/blob/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b/apps/sim/executor/handlers/workflow/custom-block-tool-runner.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6611/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
https://github.com/simstudioai/sim/pull/6611/files#diff-8221e78b18a066a665c0b5aa9f6b955a1de62128f944c94f19bf27580b5bb0e6
apps/sim/executor/handlers/workflow/custom-block-tool-runner.tshttps://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
View file https://github.com/simstudioai/sim/blob/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b/apps/sim/executor/handlers/workflow/custom-block-tool-runner.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6611/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
https://github.com/simstudioai/sim/pull/6611/files#diff-c20239fc4890ba48ec0a56928d0037e7d76e75be22da776dc920a97fd0e2de0e
apps/sim/executor/handlers/workflow/workflow-handler.test.tshttps://github.com/simstudioai/sim/pull/6611/files#diff-182c6898e81ed049b72228d06098a79da369fbfa2129d094da599733fb5566e4
View file https://github.com/simstudioai/sim/blob/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b/apps/sim/executor/handlers/workflow/workflow-handler.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6611/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6611/files#diff-182c6898e81ed049b72228d06098a79da369fbfa2129d094da599733fb5566e4
https://github.com/simstudioai/sim/pull/6611/files#diff-182c6898e81ed049b72228d06098a79da369fbfa2129d094da599733fb5566e4
apps/sim/executor/handlers/workflow/workflow-tool-runner.test.tshttps://github.com/simstudioai/sim/pull/6611/files#diff-3fb03b6818608e62eca6cf2c5604cb665f55e26c38d64cfd5e6481d5f5f0a920
View file https://github.com/simstudioai/sim/blob/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b/apps/sim/executor/handlers/workflow/workflow-tool-runner.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6611/{{ revealButtonHref }}
apps/sim/executor/handlers/workflow/workflow-tool-runner.tshttps://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
View file https://github.com/simstudioai/sim/blob/321438a14a28aa5bf0f6925c91a42ca5e8eaf64b/apps/sim/executor/handlers/workflow/workflow-tool-runner.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6611/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
https://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
https://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
https://github.com/simstudioai/sim/pull/6611/files#diff-e6542e73bb496b9e1f881d492538e13844587410fa73e36dd0846ba64ae6b93f
Please reload this pagehttps://github.com/simstudioai/sim/pull/6611/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6611/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.