Skip to content

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 03 Oct 03:23
· 124 commits to main since this release
7790a8c

New checks for model-controlled input run on the host (IESC002) and for unseeded shuffles (IEBP010, IEBP011), and IEBP003 now also checks FieldSpec-built samples. Each can fail a package that passed 0.9.0. Suppression comments should now give a reason, and suppressed findings count as met. Before moving a pin: JSON reports are now schema_version: 3, because suppressed rules count as passing. A consumer that recomputes or checks scores must accept version 3. The inspect_evals docs dashboard and the inspect-evals-actions register publisher already do.

Added

  • host_code_execution (IESC002) reports model-controlled input that reaches code execution on the host instead of in the sandbox. The sources are tool arguments, model output (.completion, .messages, .tool_calls, .arguments, .output.message, .output.choices, state.output, .generate(...) results, ModelOutput parameters) and sandbox() read_file()/exec() results. The sinks are code execution (exec, eval, compile, __import__, runpy.run_path, runpy.run_module), shell commands, processes with a tainted program (subprocess, asyncio.create_subprocess_exec, os.exec*, os.spawn*, os.posix_spawn, pty.spawn), unsafe deserialisation (pickle, marshal, dill and cloudpickle loads, joblib.load, pandas.read_pickle, numpy.load with allow_pickle, unsafe yaml loads, torch.load without weights_only=True) and a tainted importlib.import_module. inspect_ai.util.subprocess is a shell command when its payload is written as a string and a process when it is a list or tuple literal; any other payload is judged like subprocess.run(cmd). Taint is traced within a file, through one level of same-file calls. A traced flow is an error, allowlisted as path/within/package.py:sink. Every other shell, code or deserialisation sink in host code is a warning, so a reviewer sees each one once. Imports resolve per scope, so importing eval from inspect_ai exempts only eval, and only where the import is in force. Files matched by exclude count as sandbox code and are not read (#12).
  • The exclude documentation now defines host code: every Python file outside its globs.
  • Suppression comments take a reason after --: # inspect-evals-lint: ignore[sample_ids] -- ids are row numbers. suppression_syntax (IECQ005) warns about a comment that suppresses something without one. The suppression still applies, and a warning counts as passing, so no score changes. The reason runs to the end of the line and is never read for other markers. -- followed by another tool's comment, a second --, or an unfilled <reason> placeholder does not count as a reason. The rule's pass message now says every comment has a reason.
  • shuffle_choices_seeded (IEBP010) fails each shuffle_choices= that resolves to True, which shuffles the answer choices without a seed and so changes each sample's option order and target letter between builds. An int is a seed and is accepted. shuffle_seeded (IEBP011) warns on each shuffle= that resolves to true with no seed=, or a seed= that resolves to None, since the order decides which samples --limit picks. It asks for a seed, not for the shuffle to go: a dataset whose records come grouped by category or subject needs a shuffle for a --limit run to span it. A call to inspect_evals' shuffle_and_seed(shuffle) is read as shuffle_choices is, so shuffle: bool | int = 42 passes and = True warns. Both rules also read a dataset's .shuffle() and .shuffle_choices() methods, and skip a call inside an if that the defaults never enter, such as if shuffle: with shuffle=False. A dataset helper passed shuffle_choices=True with a seed= is taken to be seeded, but a known loader is not, since its seed= orders the samples, not the choices. Both read any call passing the argument by keyword, so a task's call to its own dataset helper counts, and shuffle and seed passed positionally to the known loaders. A value is read literally, through the enclosing function's parameter default, or through a module constant the file binds once. A value that can't be resolved, including a parameter the function body reassigns, is not flagged. When the value comes from a parameter default the diagnostic points at the default, and calls reading one default report it once. On inspect_evals main IEBP010 fails 6 sites in lab_bench, sad and truthfulqa. IEBP011 warns at 41 sites in 30 evaluations; 3 of them (mmlu twice, scbench) call a helper that seeds internally (#53).
  • A comment can no longer suppress suppression_syntax findings, which are about the comments themselves. per-file-ignores still can.
  • Every suppression the tool suggests now includes -- <reason>: the CLI's failure summary, the footer on each rule page, the llms.txt intro, and the hints for legacy, malformed and past-header markers.

Changed

  • sample_ids (IEBP003) also checks samples built from a FieldSpec. A FieldSpec(...) without id= fails unless every loader it is passed to as sample_fields= sets auto_id=True. A name passed as sample_fields is resolved by Python's scoping rules, and sample_fields and auto_id passed positionally to Inspect's and inspect_evals' loaders are read. An evaluation whose samples all come from FieldSpec now passes or fails instead of skipping. On inspect_evals main this fails at four sites: air_bench, lingoly and both SimpleQA tasks (#52).
  • Suppressed findings count as met. A suppression is a decision recorded in the repository, and pylint, ruff, mypy, Biome and ESLint all leave suppressed findings out of their counts. In Score, passing is now pass + warn + suppressed. The suppressed count is shown beside the score, e.g. **16/17 checks met** (2 by suppression) in the Markdown headline. A package whose only unmet rules were suppressed now scores 100%, where it scored less on 0.9.0.
  • JSON reports use schema_version: 3, because passing and score add up differently. Fields and statuses are unchanged. A consumer that recomputes or checks the score must count suppressed as passing for version 3, and must be updated before any pin moves to this release. There are two: the register publisher in inspect-evals-actions, and the inspect_evals docs dashboard (docs/_scripts/register-lint.mjs), which checks passing against its parts.
  • The Markdown list's summary line counts the rules it holds by kind, e.g. 1 not met · 1 with warnings · 2 met by suppression. by_suppression(score) is exported for consumers that build their own headline.
  • The package builds with uv_build instead of hatchling, and its version is set once in pyproject.toml; inspect_evals_lint.__version__ reads it from the installed metadata. The wheel holds the same files and metadata as before, apart from __init__.py's version lookup. The sdist now holds only the package source, README.md, LICENSE and pyproject.toml, not the whole repository.

Fixed

  • The console's "Failures by check" and "Warnings by check" tables no longer read messages, hints and locations as Rich markup, which dropped bracketed text such as ignore[<rule>] in a hint.
  • A second marker on the same line, before any reason, is now read. Before, only the first marker on a line took effect.