Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement RestrictedPython for secure code execution #251

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Closes #235

  • Added RestrictedPython for secure code execution
  • Implemented custom AST transformer with type annotation support
  • Added tests for secure code execution and attribute access
  • Added checksum validation for code integrity
  • Configured safe builtins and attribute access guards

Link to Devin run: https://app.devin.ai/sessions/52a534be7286449eb767cf386ac6d001

devin-ai-integration bot and others added 5 commits January 22, 2025 21:51
- Replace raw exec() with RestrictedPython's compile_restricted()
- Add safe_builtins and guarded attribute access
- Run code in isolated namespace with restricted globals
- Update documentation with security details

Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Closes #235

- Added RestrictedPython for secure code execution
- Implemented custom AST transformer with type annotation support
- Added tests for secure code execution and attribute access
- Added checksum validation for code integrity
- Configured safe builtins and attribute access guards

Link to Devin run: https://app.devin.ai/sessions/52a534be7286449eb767cf386ac6d001

Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions github-actions bot added the enhancement New feature or request label Jan 22, 2025
devin-ai-integration bot and others added 9 commits January 22, 2025 23:02
- Handle potential None return from generic_visit
- Consistently use visited_node throughout method
- Add proper type checking for attribute access

Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Copy link
Contributor Author

Devin is currently unreachable - the session may have died.

@aaronsteers aaronsteers marked this pull request as draft January 23, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security: Implement RestrictedPython for safer custom code execution
1 participant