GenPark AST Blocker
Audits Python code via static AST analysis to prevent forbidden module imports, dangerous system calls, and unauthorized filesystem access.
This tool serves as a robust security auditor for Python code, leveraging Abstract Syntax Tree (AST) static analysis. It meticulously scans for and blocks common security vulnerabilities such as unauthorized module imports (e.g., `os`, `subprocess`), dangerous function calls (`eval`, `exec`), and attempts at arbitrary filesystem access or sandbox escapes through dunder method traversal. Engineered with zero external dependencies using only Python's standard `ast` module, it provides a crucial layer of pre-execution security for agent-generated or untrusted Python code.
Key Features
01Zero External Dependencies: Pure Python standard library `ast` module.
02Zero-Latency AST Audit: Static validation executes in under 2 milliseconds before any code runs.
038 GitHub stars
04Dunder Reflection Defense: Prevents sandbox escape attempts exploiting object attribute trees.
Use Cases
01Securing AI agent-generated Python code before execution.
02Blocking dangerous module imports and system calls in any Python application.
03Enforcing sandboxing for untrusted code in a REPL environment.