CaMeLoT: statically verifying agent plans before execution with CTL temporal logicCaMeLoT: CaMeL orchestrated with Temporal logic for static verification and liveness
Translation in progress — untranslated text is omitted.
CaMeLoT is a prompt-injection defense for tool-calling LLM agents, complementing the existing defense CaMeL by statically verifying the agent's generated plan before any tool is invoked. It converts the plan into a finite-state transition system annotated with tool calls, source, and taint information, then checks it with the nuXmv model checker against temporal policies expressed in CTL. Because verification happens before execution, unsafe plans are rejected directly, without consuming LLM calls and tool calls, and without the overhead of rolling back changes or tearing down temporary sandboxes. When verification fails, the model checker returns a counterexample that the agent can use to repair the plan.
- The security of tool-calling agents depends on the entire execution, not just single steps. CaMeL's policies are checked locally at tool call time, making it difficult to express liveness and ordering constraints across executions, and violations are only discovered at runtime.
- CaMeLoT translates the P-LLM's restricted Python plan into a finite-state machine annotated with tools, provenance, and taint, and uses nuXmv for pre-execution verification of CTL policies; on failure, counterexamples are fed back to the P-LLM for repair. Task constraints are proposed by an LLM as typed obligations, then grounded by trusted code and compiled into CTL.
- On the four AgentDojo suites, without prompt injection, with claude-haiku-4-5-20251001, the two agree on allowing or blocking in 59 of 75 successful tests. All 7 hand-crafted SOC temporal violations are blocked by CaMeLoT; simplified CaMeL only blocks the taint-type S7. Exact is 87.6% across 97 tasks, and the extracted formulas from 20 controlled cases agree with hand-written formulas.
- The authors note that the static abstraction over-taints and may incorrectly block safe plans, loops and conditionals are treated as nondeterministic choices, tool calls are treated as black boxes, and Hoare-style pre/postconditions are left as future work. The experiments cover four AgentDojo suites, one simplified SOC workflow, and settings with fixed plans or regular repair disabled.