prompt
FreeMetrics-first, sandbox-verified prompt optimization
About prompt
The Sandboxed Prompt Engineer is a prompt optimization system inspired by the SPEAR paper (arXiv 2605.26275, May 2026). It automates prompt improvement using a code-as-action loop with four tools: evaluate, python, set_prompt, and finish. The system employs a metrics-first philosophy, enforcing monotone improvement via automatic rollback on metric regression and optional guard metric floors. It uses a Python sandbox for structural error analysis—confusion matrices, error clustering, subgroup breakdowns—rather than intuition-based rewrites. Reported performance includes κ 0.857 on tool-selection, 0.815 F1-macro on filter-relevance, and 0.938 accuracy on BBH-7, outperforming baselines GEPA and TextGrad. The prompt is open source and hosted in the ai-boost/awesome-prompts GitHub repository.
Key Features
Pros & Cons
- Eliminates guesswork by using quantitative metrics to guide prompt changes
- Automatic rollback prevents performance regression
- Sandboxed Python analysis enables deep understanding of failure modes
- Proven performance improvements over baselines like GEPA and TextGrad
- Open source and free to use
- Requires a fixed evaluation set and metric definition, limiting applicability to ad-hoc tasks
- Setup complexity may be non-trivial for users unfamiliar with the code-as-action paradigm
- Only optimizes prompts within the defined constraint of four tools—no external integrations