HASP converts agent skills into executable guardrails, lifts reasoning 25–30%
New research from Hongjun Liu and colleagues converts textual agent guidance into Program Functions that activate on failure states, driving 25–30% gains on web-search, math, and coding tasks.

A new framework treats agent skills not as advisory text but as executable code that fires when an LLM is about to fail. HASP (Harnessing LLM Agents with Skill Programs), introduced in a preprint by Hongjun Liu, Yifei Ming, Shafiq Joty, and Chen Zhao, converts reusable lessons from past experience into Program Functions—executable snippets that monitor the agent loop, detect failure-prone states, and inject corrective actions or context on the fly.
The approach is modular. At inference time, Program Functions act as runtime guardrails that modify the next action without retraining. During post-training, they supply structured supervision to internalize the skill. In a self-improvement loop, validated teacher-reviewed functions evolve the skill library over time. The authors report that inference-time Program Functions alone lift average performance by 25 percent over multi-loop ReAct on web-search reasoning, while post-training and controlled evolution push the gain to 30.4 percent over Search-R1. Similar improvements appear on math reasoning and coding tasks.
Unlike prior work that encodes skills as natural-language advice—guidance the agent may or may not follow—HASP's executable functions enforce corrective logic at the moment it matters. The paper includes mechanism analysis showing exactly when Program Functions trigger, how they modify agent state, and what stable evolution of a skill library requires.