fix(engine): keep filter input under env allowlist #28

Merged
thklein merged 3 commits from fix/filter-env-allowlist into main 2026-10-18 17:23:17 +00:00
Owner

With GPTSCRIPT_TOOL_ENV_ALLOWLIST=true, input and output filters lost their payload: the runner hands an output filter {output, continuation, chat} and an input filter {input}, filters declare no Param for those, and the allowlist only exempted TOOL_CALL_ARGS/TOOL_CALL_BODY. A filter reading $OUTPUT (e.g. bpai-tools' result-formatter) got an empty string.

The exemption is keyed by the call's tool category, so an ordinary tool call still cannot receive these keys as undeclared env, and a filter call still cannot pass any other undeclared key.

  • newCommand / runHTTP pass ctx.ToolCategory; daemons use NoCategory.
  • Tests: filter keys survive for input/output categories and are still refused for an ordinary call; a filter call cannot slip another undeclared key through.
  • No behaviour change with the flag off (default).
With `GPTSCRIPT_TOOL_ENV_ALLOWLIST=true`, input and output filters lost their payload: the runner hands an output filter `{output, continuation, chat}` and an input filter `{input}`, filters declare no `Param` for those, and the allowlist only exempted `TOOL_CALL_ARGS`/`TOOL_CALL_BODY`. A filter reading `$OUTPUT` (e.g. bpai-tools' result-formatter) got an empty string. The exemption is keyed by the call's tool category, so an ordinary tool call still cannot receive these keys as undeclared env, and a filter call still cannot pass any other undeclared key. - `newCommand` / `runHTTP` pass `ctx.ToolCategory`; daemons use `NoCategory`. - Tests: filter keys survive for input/output categories and are still refused for an ordinary call; a filter call cannot slip another undeclared key through. - No behaviour change with the flag off (default).
fix(engine): keep filter input under env allowlist
Some checks failed
smoke / check-label (pull_request_target) Failing after 1s
smoke / gpt-4o-2024-08-06 (pull_request_target) Has been skipped
smoke / gpt-4o-mini-2024-07-18 (pull_request_target) Has been skipped
smoke / claude-3-7-sonnet-20250219 (pull_request_target) Has been skipped
Validate docs build / validate-docs (pull_request) Failing after 16s
integration / integration (ubuntu-22.04) (pull_request) Successful in 48s
test / test (ubuntu-22.04) (pull_request) Failing after 51s
integration / integration (windows-latest) (pull_request) Has been cancelled
test / test (windows-latest) (pull_request) Has been cancelled
85ccd1e207
Input and output filters receive their payload as runner-supplied
keys (input; output, continuation, chat) that they never declare as
parameters, so with GPTSCRIPT_TOOL_ENV_ALLOWLIST=true a filter reading
$OUTPUT got an empty string. Treat those keys as engine-supplied, but
only for a call of the matching tool category.
thklein force-pushed fix/filter-env-allowlist from 85ccd1e207
Some checks failed
smoke / check-label (pull_request_target) Failing after 1s
smoke / gpt-4o-2024-08-06 (pull_request_target) Has been skipped
smoke / gpt-4o-mini-2024-07-18 (pull_request_target) Has been skipped
smoke / claude-3-7-sonnet-20250219 (pull_request_target) Has been skipped
Validate docs build / validate-docs (pull_request) Failing after 16s
integration / integration (ubuntu-22.04) (pull_request) Successful in 48s
test / test (ubuntu-22.04) (pull_request) Failing after 51s
integration / integration (windows-latest) (pull_request) Has been cancelled
test / test (windows-latest) (pull_request) Has been cancelled
to 95597ac18e
Some checks failed
smoke / check-label (pull_request_target) Failing after 1s
Validate docs build / validate-docs (pull_request) Failing after 13s
integration / integration (ubuntu-22.04) (pull_request) Successful in 43s
smoke / gpt-4o-2024-08-06 (pull_request_target) Has been skipped
smoke / gpt-4o-mini-2024-07-18 (pull_request_target) Has been skipped
smoke / claude-3-7-sonnet-20250219 (pull_request_target) Has been skipped
integration / integration (windows-latest) (pull_request) Has been cancelled
test / test (windows-latest) (pull_request) Has been cancelled
test / test (ubuntu-22.04) (pull_request) Has been cancelled
2026-10-18 17:07:24 +00:00
Compare
refactor(runner): rename filter subcall helper
Some checks failed
integration / integration (windows-latest) (pull_request) Waiting to run
test / test (windows-latest) (pull_request) Waiting to run
smoke / check-label (pull_request_target) Failing after 5s
smoke / gpt-4o-2024-08-06 (pull_request_target) Has been skipped
smoke / gpt-4o-mini-2024-07-18 (pull_request_target) Has been skipped
smoke / claude-3-7-sonnet-20250219 (pull_request_target) Has been skipped
Validate docs build / validate-docs (pull_request) Failing after 13s
integration / integration (ubuntu-22.04) (pull_request) Successful in 35s
test / test (ubuntu-22.04) (pull_request) Failing after 11m3s
092ecaf220
thklein deleted branch fix/filter-env-allowlist 2026-10-18 17:23:18 +00:00
thklein referenced this pull request from a commit 2026-10-18 21:46:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
basepeak-ai/gptscript!28
No description provided.