Skip to content

Store the Studio sandbox credential path names in pieces - #12188

Merged
danielhanchen merged 1 commit into
mainfrom
harden-sandbox-credential-literals
Sep 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
harden-sandbox-credential-literals

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

The Studio tool sandbox keeps a deny list of credential files (id_rsa, .aws/credentials, .netrc, /etc/shadow and so on) in studio/backend/core/inference/tools.py, the same module that holds the web and network tools. Credential-store paths written out beside network code is the shape that got scripts/scan_packages.py quarantined as Generic.PY.STEALER (#12169), and unlike that script this file ships in the wheel to every Studio install. The scanner-shape gate from #12178 recorded it as a follow-up.

The names are now stored in pieces and joined at import with the same _joined helper scan_packages.py uses. Nothing the sandbox matches changes:

  • _SENSITIVE_PATH_RE: the rebuilt pattern string and flags are equal to the old ones.
  • _SENSITIVE_GLOB_TARGETS (same order), _SENSITIVE_GLOB_BASENAMES and _SENSITIVE_FILE_PREFIXES: equal to the old values.
  • Comparing every module-level value of the old and new module: no differences apart from the new helper.

The baseline group for this file is removed, so the gate fails if the names are written out again.

Validation

  • The 57 backend test files that import core.inference.tools, run on main and on this branch: the same result on both (8946 passed), with an identical list of failing test IDs. The failures are in RAG, recall, MCP and web-search tests that fail on main too and do not touch this code.
  • python scripts/lint_av_shapes.py: ok, 0 new errors; the file no longer matches the credential rule.

The tool sandbox keeps a deny list of credential paths (SSH keys, cloud
credential files, shadow) in the same file as network code, which is the
shape the Generic.PY.STEALER heuristic scores. Those names are now stored
split into pieces and joined at import by a small _joined helper, as
scripts/scan_packages.py does since #12169. The compiled pattern, the glob
target tuple, the basename set and the escape-check prefixes are equal to
their previous values, so what the sandbox refuses does not change.

The AV008 baseline group for this file is removed; the file no longer
carries any of the matched names.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T10:19:17.105911Z 34107db Manual request
🔒 Security Review ⚠️ Failed 2026-09-28T10:17:38.663831Z 34107db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-09-28T10:17:38.621842Z 34107db PR opened
🔒 Security Review ⚠️ Failed 2026-09-28T10:17:38.663831Z 34107db PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 34107db0c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 9bc35b6 into main Sep 28, 2026
3 of 35 checks passed
@danielhanchen
danielhanchen deleted the harden-sandbox-credential-literals branch September 28, 2026 11:13
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
The tool sandbox keeps a deny list of credential paths (SSH keys, cloud
credential files, shadow) in the same file as network code, which is the
shape the Generic.PY.STEALER heuristic scores. Those names are now stored
split into pieces and joined at import by a small _joined helper, as
scripts/scan_packages.py does since unslothai#12169. The compiled pattern, the glob
target tuple, the basename set and the escape-check prefixes are equal to
their previous values, so what the sandbox refuses does not change.

The AV008 baseline group for this file is removed; the file no longer
carries any of the matched names.
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