SLBench: evaluating how LLM Agents follow logical relations in skillsSLBench: Evaluating How LLM Agents Follow Logical Relations in Skills
The authors build the 86-case executable benchmark SLBench to evaluate agents' ability to follow the logical relations among skill-file clauses; the unsafe rate across six backbones is 35.1%–70.2%.
- Agent skill files consist of multiple clauses, and clauses have logical relations such as preconditions, postconditions, and constraints; agents may complete only the conspicuous main task while violating these relations, causing consequences such as privacy leakage, and existing benchmarks rarely turn clause-level relations into executable tests.
- The authors propose the SkillLogic framework: extract clauses from skill text and analyze eight types of logical relationships, then compile high-impact, locally testable relationships into executable cases with deterministic scorers, and on this basis build the 86-case benchmark SLBench from 5,224 public skills, and propose the inference-time scaffold SLGuard.
- On the two agents Codex and Claude Code and six LLM backbones, the unsafe rate is 35.1%–70.2% (Table 2); SLGuard turned 7 of 11 violation cases into safe; manual audit shows that for all 12 violation cases humans could derive the safe behavior from the original source, and after clarifying the skill text violations dropped from 11/12 to 5/12.
- The authors note: SLBench is a curated challenge set rather than a representative sample, covering only two agent platforms and six backbones; the manual audit covers only 12 cases and has no formal inter-annotator agreement; SLGuard is evaluated on only 11 cases and a single agent-backbone pair; and unsafe rates in controlled local repositories should not be read as real-world deployment failure rates (Limitations section).
- Evaluated models
- GPT-5.5GPT-5.4-miniGPT-5.3-CodexHaiku 4.5Sonnet 4.6Opus 4.7
- Benchmarks
- SLBenchSkillsMP
- Metrics
- safe rateunsafe rateinconclusive ratefailure rate by relation
Researchers propose the SkillLogic framework to analyze logical relations in Agent skill files and construct executable tests, and based on this build an 86-case executable benchmark, SLBench; evaluation of Codex and Claude Code on six LLM backbone models shows an unsafe rate of up to 70%. The framework's classification covers eight relation types including preconditions, constraints and failure fallbacks, and scanning more than 5000 public skills found that 70% contain at least one logical relation. Violations lead to privacy leaks, unsafe configuration changes and incomplete cleanup, and manual audit attributes the failures to insufficient Agent capability and low salience of skill text. The authors additionally propose a lightweight inference-time scaffold, SLGuard, which reduces violations by 63% on target cases, and point out that following logical relations is a distinctive reliability challenge for skill-guided Agents.
Paper analysis
What problem does this paper attempt to solve?
Whether agents can correctly follow the logical relationships among clauses in skill files (preconditions/postconditions, constraints, etc.), and how to expose failures with executable tests.
Core question: can agents follow the logical relationships among multiple clauses in skill files, and how can executable tests be constructed to expose such failures.
- Problem setting: LLM agents increasingly rely on external skills — reusable instruction files that package domain knowledge, workflows, and constraints. Skills are procedural documents, and their clauses often form logical relationships: actions depend on prior steps, constraints narrow the permitted actions, and higher-priority clauses override conflicting clauses.
- Why it matters: according to the authors, an agent that follows only the salient action clauses while missing governing relationships may appear useful but can produce unsafe outcomes. In the example in Figure 1, the agent completes clinical note processing but misses a cleanup postcondition, leaving sensitive files on disk and causing a privacy leak.
- Shortcomings of existing evaluations: the authors state that research on instruction conflict and instruction hierarchy covers only explicit conflicts or different levels of authority; agent benchmarks for tool use, web navigation, and security policies focus on whether tasks are completed or on broad policies, and rarely characterize the internal logical structure of skill documents; recent analyses of skills (Ling et al., 2026) classify by topic and risk pattern but do not systematically turn clause-level relationships into executable tests.
- Core observation: failures of skill logic are often observable only from execution artifacts, such as files left on disk, unsafe configuration changes, or wrongly blocked approved actions, so scoring should be based on artifact state rather than response text.
- The paper proposes: the SkillLogic framework (analyzes eight types of logical relationships in skills and constructs executable tests), SLBench (86 executable cases), and the inference-time mitigation scaffold SLGuard.
- Evaluation target setting: the paper focuses on real programming scenarios, where agents execute repository-level tasks (code generation, deployment, security fixes) under procedural skill guidance; a violation is defined as the agent misparsing a relationship and producing the target unsafe state, and cases with insufficient evidence are judged inconclusive.
What related research exists?
Related work falls into four groups: agent benchmarks and process compliance, skills and skill safety, automatic benchmark generation and scoring reliability, and instruction following.
Agent benchmarks and process compliance
- Yao et al. (2025)'s τ-bench evaluates tool-using agents under simulated user interaction and domain APIs and policy guidelines; Trivedi et al. (2024)'s AppWorld evaluates interactive coding agents in stateful application worlds with programmatic checks.
- Safety-oriented benchmarks: ToolEmu (Ruan et al., 2024) and AgentDojo (Debenedetti et al., 2024) study high-risk tool use, high-risk failures, and prompt injection attacks.
- The authors note that these benchmarks rarely characterize the internal logical structure of skill documents that governs tasks; this paper studies whether agents correctly parse the relationships between clauses, rather than merely completing tasks.
Instruction and guideline following
- Instruction conflict and hierarchy: Liu and Roth (2025), He et al. (2026)'s ConInstruct, and Wallace et al. (2024)'s instruction hierarchy study cases where instructions explicitly conflict or come from different levels of authority.
- Constraint-following benchmarks: Zhou et al. (2023), Jiang et al. (2024)'s FollowBench, Wen et al. (2024), and Diao et al. (2025)'s GuideBench evaluate whether models satisfy explicit constraints, combinations of constraints, or domain rules.
- The authors note that skill clause dependencies are not limited to conflicts: an agent may complete the main action but miss preconditions, skip postconditions, ignore fallbacks, or violate constraints.
Agent skills and skill security
- SkillsBench (Li et al., 2026) measures whether curated or self-generated skills improve task performance; Jiang et al. (2026a) survey the skill lifecycle and its governance and security implications.
- Adversarial skill direction: Schmotz et al. (2026) probe prompt injection hidden in skill files, Jiang et al. (2026b) show how harmful skills in an open ecosystem can weaken agent safety, and Tie et al. (2026) implant backdoors via poisoned in-skill models. The authors summarize that these works ask whether skills are useful, or how malicious skills weaponize agents.
Automatic benchmark generation and scoring reliability
- Li et al. (2025) model benchmark construction as optimization over declarative expected properties; Butt et al. (2025) decompose it into planning, generation, and evaluation steps executed by interacting LLM agents.
- Kapoor et al. (2025), Zhu et al. (2025), and Lù et al. (2025) emphasize that agent benchmarks require careful reward design, cost control, reproducibility, and robust scorers.
- The authors state that this paper's pipeline differs in input and oracle design: source-grounded logical relationships extracted from real skill files are compiled into locally executable cases, and scoring relies on artifact state checks, shared semantic scoring primitives, and fixture-tested safe/unsafe variants rather than exact wording matching.
Positioning: the authors position this paper as studying a different failure surface — when interacting procedural clauses in reusable skill files (exceptions, overrides, preconditions, etc.) are misparsed, agents may still appear to complete tasks successfully while violating safety.
How does the paper address this problem?
SkillLogic extracts clauses and eight types of logical relationships from skill text, compiles them into locally executable cases with deterministic scorers to form SLBench, and pairs it with SLGuard mitigation.
Overall approach: model skill files as a set of natural-language clauses, identify eight types of logical relationships among clauses, and then compile high-impact, locally testable relationships into real test cases with deterministic scorers. SkillLogic is the analysis and construction framework, SLBench is the benchmark it produces, and SLGuard is the inference-time mitigation scaffold.
Problem formalization and taxonomy
- A skill file is modeled as a set of clauses {c1, …, cn}, each clause represented as a five-tuple ci = (ti, gi, ai, mi, oi): source text, applicability condition, governed action, modality (must/should/may/must not), and object or scope.
- A logical relationship is defined as r = (ci, cj, τ, γ), where τ is the relationship type and γ identifies the governing clause when one side takes precedence.
- Eight relationship types (Table 1): precondition, postcondition, constraint, conjunction, fallback, exception, override, conflict, each with a formal notation and representative failure modes (e.g., "send email before approval", "process PHI but leave files on disk").
- Violation definition: the agent misparses a relationship and produces the target unsafe state; when artifacts, command traces, or final state are insufficient to determine this, it is recorded as inconclusive; evaluation does not depend on whether the agent used particular wording.
SkillLogic: relationship analysis and test construction
- Relationship analysis: the analyzer first selects a single main workflow (by security severity, clarity of clause interaction, and feasibility in a controlled environment), then identifies grounded relationships, keeping only those that are independently meaningful and non-redundant; Appendix B describes the mechanism for pattern consistency across thousands of independent analysis sessions.
- Case generation: each retained relationship is turned into a case with a real prompt, a controlled repository/folder, and a deterministic scorer; prompts are trusted task requests rather than adversarial instructions and may carry mild operational pressure; high-impact cases are prioritized (secret leakage, removal of safety guardrails, unsafe workflow outcomes).
- Scoring design: scorers evaluate observable execution evidence rather than response quality; for each case an LLM generates concrete evidence patterns for violation, satisfaction, and insufficient evidence; scoring first checks for explicit unsafe outcomes, then checks for positive evidence that the relationship was followed (unsafe-first order); missing or ambiguous evidence is judged inconclusive.
SLBench construction pipeline
- The data source is SkillsMP, with sampling queries covering two dimensions: breadth of occupations/domains and skills likely rich in clause interactions, yielding 5,224 deduplicated skills, of which 4,500 enter the analyzer.
- 3,751 skills contain valid logical relationships, and 3,599 contain at least one benchmark-eligible relationship; the first-stage selector sets a floor of at least 30 candidates for each of the eight relationship types and ranks by LLM-assessed severity, retaining 625; the second stage narrows to 125 by ranking on expected risk, scoring clarity, relationship type diversity, and local feasibility (each scored 1–5, equally weighted).
- The generated cases undergo execution and manual audit, removing those with scorer defects, fixture contamination, or insufficient evidence, yielding 86 core cases (39 control, 47 violation); the paper emphasizes that this is not a uniform sample of the taxonomy but a curated subset reflecting corpus distribution and benchmarkability.
SLGuard mitigation
- Inference-time scaffold: first analyze the target skill and generate a relationship checklist that makes the logical structure explicit; before execution, identify the requested action, scope/tool constraints, and applicable exceptions; after execution, check against the checklist (whether gated actions passed the gate, whether postconditions were completed, whether conjunctive obligations were satisfied).
- Evaluation method: the same case is run once under the standard setting and once with the checklist added, with the skill file, user prompt, local environment, and scorer unchanged; the target agent is Codex CLI + GPT-5.5.
What experiments did the paper conduct?
Two agents × six backbones on the 86-case SLBench have an unsafe rate of 35.1%–70.2%; additionally SLGuard, manual audit, clarification ablation, and scorer-order ablation.
Experimental setup
- Systems under test: two coding agents, Codex CLI and Claude Code CLI, with six backbones in total: GPT-5.5, GPT-5.4-mini, GPT-5.3-Codex, Haiku 4.5, Sonnet 4.6, Opus 4.7 (Table 2).
- Benchmark: SLBench, 86 manually audited core cases (39 control, 47 violation), derived from 5,224 sampled skills from SkillsMP (Figure 2, Table 3).
- Construction tools: SkillLogic runs the analyzer and case generator with Codex + GPT-5.4 as the auxiliary agent (§4.2); the analyzer prompt is about 3,100 tokens and the generator about 11,400 tokens (Appendix C).
- Metrics: overall safe / unsafe / inconclusive proportions, and failure rates by relationship type; scorers are deterministic Python scripts, not LLMs, using unsafe-first priority order (§3.2, Appendix H).
- Execution scale: 532 execution sessions (86 cases × 6 backbone configurations + 16 sequential ablation reruns, Appendix H); the paper does not report the number of repeated runs per case.
Main results
According to Table 2 (overall results are percentages; the by-relationship column is failure rate %):
Swipe horizontally to read the table
Agent Backbone Safe Unsafe Inc. Codex CLI GPT-5.5 29.8 70.2 0.0 Codex CLI GPT-5.4-mini 33.7 57.0 9.3 Codex CLI GPT-5.3-Codex 32.6 39.5 27.9 Claude Code CLI Haiku 4.5 36.0 53.5 10.5 Claude Code CLI Sonnet 4.6 44.2 43.0 12.8 Claude Code CLI Opus 4.7 29.8 35.1 35.1 - The authors state that following logical relationships remains difficult across all tested configurations; Codex + GPT-5.5 has the highest violation rate (70.2%), and Opus 4.7 has the lowest violation rate (35.1%) but also the highest inconclusive rate (35.1%), which the authors interpret as stronger backbones often substituting uncertain results for violations.
- By relationship type (Table 2): precondition, conflict, and override failures are more persistent (e.g., GPT-5.5's override failure rate is 100.0% and precondition 78.9%); fallback failure rates are generally lower (0.0%–18.2%), which the authors suggest may be because fallback obligations are easier to detect in the constructed cases, or because agents tend to stop conservatively when the main path fails.
SLGuard mitigation evaluation
- What was tested: on the 11 high-quality cases judged as violations under the original skill condition, Codex CLI + GPT-5.5 was rerun with the relationship checklist scaffold added, with all other conditions unchanged (§4.3).
- Results: violations dropped from 11 cases to 4, and safe outcomes rose from 0 to 7 (guarded inconclusive cases with no violation signal are merged into the safe category); the paper abstract and §3.4 state a 63% reduction in violation rate. The right side of Figure 4 shows: the single conflict case was fully fixed, the override and postcondition cases lost all hard violation signals, and 2 of 3 precondition cases and 1 of 2 exception cases still violated.
- Authors' interpretation: relationship-aware prompting is a useful mitigation for some failures, but when success requires deeper state tracking, domain reasoning, or actively repairing an already-introduced hazard, prompt-level scaffolding is weak and is not a complete defense.
Manual audit and clarification ablation
- What was tested: on 12 high-quality violation cases, 3 annotators saw only the original SKILL.md, the user prompt, and the target relationship, and rated ambiguity (1–5) and judged whether a careful human could perform the safe behavior and attributed it; separately, the skill text was clarified and rewritten and rerun with the same target agent (§4.4, Appendix F).
- Results: of 36 annotation records, 0/12 cases were judged ambiguous for humans, with mean ambiguity 2.0/5 and mean confidence 4.3/5 (Table 4); after clarification, violations dropped from 11/12 to 5/12, and total violation signals dropped from 16 to 8 (Table 5), of which 2 cases were fully safe and 4 had no violation signal but lacked some strict safety signal groups.
- Authors' interpretation: the two experiments together rule out a single-cause explanation — that humans can derive the safe behavior from the original text shows the skill is not fundamentally incomprehensible, and that clarification eliminates or downgrades 7 of the 11 violations shows that text structure and salience are also part of the cause of failure; the 5 cases that still fail after clarification suggest a need for stronger restructuring or runtime guardrails.
Scorer priority order ablation
- What was tested: on a 16-case balanced subset (one control and one violation for each of the eight relationship types), Claude Code + Sonnet 4.6 was rerun, using a dual scorer that evaluates both types of signals to observe mixed evidence (§4.5, Appendix G.1).
- Results: in 6 of 16 runs (37.5%), both safe and violation evidence appeared; if safe-first were used instead, the unsafe rate on this subset would drop from 37.5% to 18.8%, and if mixed evidence were judged inconclusive, unsafe would fall to zero (Table 6).
- Authors' interpretation: violation signals are mostly behavioral evidence (executed commands, modified files), while safety signals are mostly textual evidence, so unsafe-first better matches the behavioral failures the benchmark aims to detect; the authors also note that this subset is small and the mixed-evidence rate is only a point estimate for a single backbone.
Other ablations and analyses
- Relationship distribution (Figure 3): the audit found 19,177 relationships (3,751 skills), with constraint the most numerous (the figure caption text shows on the order of about 6,000); among the 86 SLBench cases, constraint 23, precondition 21, postcondition 11, fallback 11, exception 6, conjunction 6, conflict 4, override 4.
- Cost (Appendix H, Table 7): the full pipeline is about 101.7M tokens, with the analysis stage accounting for about 89%; amortized cost is about 1.2M tokens per audited case, and marginal execution of existing cases is about 11K tokens.
- Execution time (Appendix H): median execution time per case is 19s for Opus 4.7, 45s for Haiku 4.5, 85s for Sonnet 4.6 (excluding 9 slow outliers), and 90s for Codex GPT-5.5.
What are some points that can be further explored?
The authors list limitations including benchmark representativeness, scorers, audit scale, and SLGuard generalization; the experiments cover two platforms, six backbones, and 86 cases.
Limitations and future directions noted by the authors
- Benchmark representativeness (Limitations): SLBench is a curated challenge set rather than a representative sample of production skill failures; it prioritizes high-impact, locally testable relations and excludes skills requiring external APIs, cloud credentials, running services, human approval, or long-horizon deployment.
- Taxonomy coverage (Limitations): The taxonomy is based on public skills and may not cover relation patterns in specialized domains or future ecosystems.
- Evaluation scope (Limitations): Evaluation is limited to two agent platforms and six LLM backbones; results may differ for other architectures such as retrieval augmentation, multi-agent, and persistent memory.
- Scorer (Limitations): The deterministic scorer uses unsafe-first priority and LLM-generated evidence patterns, and may miss ambiguous or unexpected behavior.
- Scale of manual audit (Limitations): Manual audit covers only 12 cases, supporting a sanity check but not constituting formal inter-annotator agreement; Appendix F.7 adds that future work can measure Cohen's κ and audit a larger, more diverse violation pool (including control cases).
- SLGuard generalization (Limitations): SLGuard is evaluated only on 11 cases of one agent-backbone pair, and its generalization is undetermined; because the cases are controlled local repositories rather than dynamic multi-turn production environments, the reported unsafe rates should be read as challenge-set performance rather than field failure rates.
Scope of experiments
- The subjects are the two agent platforms Codex CLI and Claude Code CLI and six backbones (GPT-5.5, GPT-5.4-mini, GPT-5.3-Codex, Haiku 4.5, Sonnet 4.6, Opus 4.7), totaling 532 execution sessions (Appendix H).
- The benchmark is 86 cases (39 control, 47 violation), derived from public skills on SkillsMP; the skill corpus comes from that platform's English skill marketplace, and the paper does not state the language composition of the skills.
- Manual audit is 3 annotators × 12 cases (36 records); the clarification ablation reruns on the same 12 cases with Codex + GPT-5.5.
- SLGuard is evaluated only on Codex CLI + GPT-5.5 and only on the 11 original violation cases.
- The paper does not report the number of repeated executions per case, nor an inter-annotator agreement coefficient for the manual audit.
Summarize the main content of the paper
Proposes SkillLogic and the 86-case benchmark SLBench; unsafe rate 35.1%–70.2% across six backbones; SLGuard reduces violations by 63% on the target cases.
This is an agent safety evaluation paper: the authors study whether the logical relations among multiple clauses in skill files can be correctly followed by LLM agents.
- Problem: Skills are procedural documents, and clauses have relations such as preconditions, postconditions, constraints, and fallbacks; agents often complete the conspicuous main task but miss governance clauses, producing consequences such as privacy leakage, unsafe configuration, and incomplete cleanup, and such failures are often observable only from execution artifacts, which existing benchmarks rarely cover.
- Method: The SkillLogic framework models a skill as a set of clauses, defines eight types of logical relations (Table 1), analyzes the relations from 5,224 public skills on SkillsMP (about 70% of skills contain at least one), then compiles high-impact, locally testable relations into executable cases with deterministic scorers, and through filtering and manual audit obtains the 86 core cases of SLBench (39 control, 47 violation); scoring uses an unsafe-first order and is based on artifact state rather than response text.
- Main results: Codex CLI and Claude Code CLI with six backbones, unsafe rate from 35.1% (Opus 4.7, inconclusive also 35.1%) to 70.2% (GPT-5.5) (Table 2); precondition, conflict, and override failures are more persistent, fallback is lower.
- Attribution: In manual audit of 12 violation cases, 0 cases were judged human-ambiguous (mean ambiguity 2.0/5); after clarifying and rewriting the skill text, violations dropped from 11/12 to 5/12, and the authors accordingly argue that failures come from both agent capability gaps and low salience of skill text.
- Mitigation: SLGuard has the agent explicitly check the relation checklist before and after execution, reducing violations from 11 to 4 on the 11 target cases, which the paper calls a 63% reduction, but precondition and exception failures remain.
- Authors' conclusion: Following logical relations is a distinct reliability challenge for skill-guided agents; the authors also emphasize that SLBench is a challenge set rather than a field failure rate, and that SLGuard's generalization is undetermined.