.agents/skills/review-security/SKILL.md
Monty runs untrusted, potentially malicious Python. Review this branch on that basis.
git diff origin/main...HEAD
Use a subagent to run .agents/skills/fix-pr-comments/pr-threads.sh (from the
fix-pr-comments skill) for security findings already raised on the PR, and confirm
each is properly addressed.
Cover the changes and any code they touch — a caller made unsafe by a changed callee is in scope even if it isn't in the diff. Ask:
unsafe, refcount errors causing use-after-free or
double-free, unchecked indexing, aliasing violations, integer overflow feeding a
length or index.ResourceTracker (String
without StringBuilder), loops with no fuel check, small input → huge allocation.unwrap/expect reachable from sandboxed input, unbounded
recursion hitting a stack-overflow abort.Weight both classes by where they land. In a pool worker the process dies, the parent
replaces the child and raises an exception — contained. Nothing else is: in host/parent
code (monty-pool, monty-proto decoding, monty-fs, the bindings), or in a Rust
embedder calling the monty crate in-process, the same bug takes down the application.
Scrutinise those hardest, especially anything handling a frame from a child.
crates/monty/src/heap.rs and crates/monty-fs/src/path_security.rs are the two most
security-critical files; any change to either needs careful justification. Also check the
public API: could a pydantic_monty or @pydantic/monty user misuse this to expose
their host?
Per finding: the attack, file:line, the sandboxed Python or hostile frame that triggers
it, and the impact. Demonstrate with python-playground rather than asserting where you
can. Say which areas you checked and found clean — coverage matters as much as findings.
Report only, unless the user asks for fixes.