feat(openai_sdk): add OAI-029, TypeScript tool writes to the filesystem - #95
Open
bradAGI wants to merge 1 commit into
Open
feat(openai_sdk): add OAI-029, TypeScript tool writes to the filesystem#95bradAGI wants to merge 1 commit into
bradAGI wants to merge 1 commit into
Conversation
OAI-006 covers the Python path-safety case; the TypeScript half was missing. Mirrors CSDK-012, including its coarse-signal caveat — it flags any filesystem write rather than only unnormalized paths, because TS path-normalization analysis is not yet wired. The guardrail story does not cover this, which is the point worth making in an SDK built around guardrails: OAI-101 concerns input guardrails on the agent, which screen what enters the conversation, not what a tool does with an argument once the model has produced it, and a call reaching execute() has already passed whatever guardrails were configured. Tools here also typically run in the same server process as the request handler rather than a sandbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OAI-006 covers the Python path-safety case; the TypeScript half was missing. Mirrors CSDK-012 — the TS half of the Claude SDK pair — including its coarse-signal caveat, stated in the explanation so the finding is honest about itself: it flags any filesystem write, not only unnormalized paths, because TS path-normalization analysis isn't wired yet. Confidence 0.5 to match.
In an SDK built around guardrails, the point worth making is that the guardrail story doesn't cover this. OAI-101 is about input guardrails on the agent — they screen what enters the conversation, not what a tool does with an argument once the model has produced it. A tool call that reaches
execute()has already passed whatever guardrails were configured. Anyone reading this finding and thinking "we have guardrails" would be wrong, so the rule says so directly.Tools here also typically run in the same server process as the request handler rather than a sandbox, so the write inherits the application's own filesystem permissions.
The fix names the stronger remedy for the common case: derive the filename server-side from an id rather than accepting a path from the model at all.
Verification — engine built at
main:Fire (
writeFileSync(notePath, body)withnotePathfrom the parameters schema):OAI-029, OAI-202Silent (server-derived id, no model-supplied path):
OAI-202(OAI-202 is the pre-existing missing-CLAUDE.md repo rule.)
No new predicates, so no
schema_versionbump.