Pydantic Monty adds sandboxed native dataclasses without codegen or exec

samuelcolvin · x · 2026-07-29

Pydantic Monty is getting closer to letting agents “do whatever they want” inside a sandbox. The highlighted PR adds native @dataclass support defined entirely in-sandbox, rather than relying on host-provided dataclasses.

The design stores DataclassMeta on the class and synthesizes dunder methods from metadata instead of generating code. That avoids exec and bytecode generation while keeping the class ordinary: methods still work, isinstance behaves normally, type(p) is Point holds, and class remains intact.

Original post →

More from coding & agent

coding & agent channel →