Skip to content

fix(logic-engine): isolate trigger sandbox globals#521

Merged
tomdps merged 1 commit into
devfrom
codex/isolate-trigger-sandbox-globals
Jun 25, 2026
Merged

fix(logic-engine): isolate trigger sandbox globals#521
tomdps merged 1 commit into
devfrom
codex/isolate-trigger-sandbox-globals

Conversation

@tomdps

@tomdps tomdps commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve the existing return-based trigger logic contract while running scripts against VM-owned globals.
  • Remove host builtin injection and prototype freezing from LogicEngine.evaluate().
  • Add a child-process regression test proving trigger evaluation no longer freezes host Object.prototype / Array.prototype.
  • Add an Unreleased changelog note for release notes, referencing fix(src/logic-engine): prevent global prototype pollution in agent sandbox #496.

Validation

  • npm ci
  • npx mocha tests/integration/trigger-evaluation.test.js --timeout 10000
    • red before fix: 27 passing, 1 failing (objectPrototypeFrozen / arrayPrototypeFrozen were true)
    • green after fix: 28 passing
  • npm run test:slow -> 131 passing, 17 pending
  • npm run validate:templates -> all templates valid; existing warnings only
  • npm run check -> 0 errors, 115 existing warnings
  • npx prettier --check CHANGELOG.md src/logic-engine.js tests/integration/trigger-evaluation.test.js

No release performed.

Preserve the existing return-based trigger script contract while avoiding host Object/Array prototype freezing during VM evaluation.

Refs: #496

Reported-by: KozakLordOfMatrix <matrixneo2026@tutamail.com>
@tomdps tomdps enabled auto-merge June 25, 2026 10:09
@tomdps tomdps added this pull request to the merge queue Jun 25, 2026
Merged via the queue into dev with commit 58202fe Jun 25, 2026
3 checks passed
@tomdps tomdps deleted the codex/isolate-trigger-sandbox-globals branch June 25, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant