Guarding the kingdom of skilled agents in a computational AI dynasty: control-flow integrity for agent skills
Guarding the Kingdom of Skill-Based Agents in the AI Dynasty of Computation: Control-Flow Integrity for Agent Skills
The researchers propose SkillCFI, which brings control-flow integrity (CFI) to skill-based agents, generating executable contracts from skills at compile time and enforcing them with a deterministic runtime enforcer. After a skill writes a procedure into the prompt, the model can decide whether each step runs in reasoning, a tool call or a script; a permission whitelist would allow violations such as overwriting files before validation, and a prompt-injected model can also falsely claim checks passed to evade monitoring; SkillCFI permits tool requests only on trusted evidence and rejects unmediated channels such as inline scripts. Across 770 agent sessions, all 240 violations that the whitelist would allow were blocked before dispatch, and the normal task completion rate was close to that without protection; listing the next legal operations on rejection raised the recovery rate from 21% to 65%, checks took about 2% of task time, and the compact command form reduced session slowdown from 1.32× to 1.08×. None of the 53 public skills compiled as-is, and the diagnostics guided 7 of them to be revised into enforceable contracts.