Skip to content

Add configurable Python module lists via config directives#122

Open
nickdavies wants to merge 1 commit intoldayton:mainfrom
nickdavies:claude/python-configurable-modules-GCu5f
Open

Add configurable Python module lists via config directives#122
nickdavies wants to merge 1 commit intoldayton:mainfrom
nickdavies:claude/python-configurable-modules-GCu5f

Conversation

@nickdavies
Copy link
Copy Markdown
Contributor

I wanted to be able to configure Python modules in preparation for enabling -c analysis. I'm not super familiar with the codebase so please let me know what you think of the approach. Happy to adjust to match any style etc.

Add python-allow-module and python-deny-module config directives so users can customize which Python modules are considered safe or dangerous during static analysis.

  • Config: parse and validate module names (dotted identifiers only), accumulate across config layers, support inline comments
  • SafetyAnalyzer: parameterize with extra_safe_modules/extra_deny_modules merged with hardcoded sets. Allow overrides exact matches in the dangerous list (submodules must be allowed separately).
  • Thread Config through HandlerContext so python handler can access configured module lists.

Example .dippy config:
python-allow-module numpy python-allow-module pandas python-deny-module requests

@nickdavies nickdavies closed this Mar 31, 2026
@nickdavies nickdavies deleted the claude/python-configurable-modules-GCu5f branch March 31, 2026 23:45
@nickdavies nickdavies restored the claude/python-configurable-modules-GCu5f branch March 31, 2026 23:51
@nickdavies nickdavies reopened this Mar 31, 2026
Add python-allow-module and python-deny-module config directives so
users can customize which Python modules are considered safe or
dangerous during static analysis.

- Config: parse and validate module names (dotted identifiers only),
  accumulate across config layers, support inline comments
- SafetyAnalyzer: parameterize with extra_safe_modules/extra_deny_modules
  merged with hardcoded sets. Allow overrides exact matches in the
  dangerous list (submodules must be allowed separately).
- Thread Config through HandlerContext so python handler can access
  configured module lists.

Example .dippy config:
  python-allow-module numpy
  python-allow-module pandas
  python-deny-module requests
@nickdavies nickdavies force-pushed the claude/python-configurable-modules-GCu5f branch from 7910583 to 42ddb64 Compare April 1, 2026 00:36
@nickdavies nickdavies mentioned this pull request Apr 1, 2026
@nickdavies nickdavies marked this pull request as ready for review April 1, 2026 00:42
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