Skip to content

Conversation

@dguido
Copy link
Member

@dguido dguido commented Jan 23, 2026

Summary

  • Expands UNSAFE_MODULES dict in UnsafeImportsML to ~60+ modules with risk descriptions
  • Expands UNSAFE_IMPORTS dict to include specific dangerous function imports:
    • torch.load, torch.compile, operator.attrgetter, functools.partial
    • Profiling functions (cProfile.run, profile.run, trace.run)
    • Code execution classes (code.InteractiveInterpreter, etc.)
    • IO operations (_io.FileIO, io.open)

Test plan

  • All existing tests pass
  • Linters pass
  • Manual verification with test pickle files containing these imports

🤖 Generated with Claude Code

Significantly expands the UnsafeImportsML analysis:
- Add ~60 modules to UNSAFE_MODULES with risk descriptions
- Add specific dangerous function imports to UNSAFE_IMPORTS dict
  including torch.load, operator.attrgetter, functools.partial, etc.
- Cover profiling, debugging, IO, and code execution modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dguido dguido requested a review from ESultanik as a code owner January 23, 2026 02:48
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.

2 participants