[Eval] Measure a pre-execution tool-call gate (Jev noul on BEFORE_TOOL_CALL) on TS-Bench step-level labels
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 38/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- huggingface, openapi, python
- Bereich
- ai, backend-api-design, testing
Rechercherichtung
Start with docs/roadmap.md, the existing injection_guard rail, and scripts/build_browsesafe_set.py to follow the rail and labelled-set patterns. Then inspect openjiuwen/harness/rails/security/tool_security_rail.py and resolve_interrupt for the ask path. Done means the pinned TS-Bench sample, offline tests, same-id baselines, per-split metrics, and roadmap update meet the acceptance criteria.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
docs/roadmap.md lists two rails still to ship: "Tool-call guardrail inside the permission engine" and branch point #2 "Tool-call gate". In both, Jev would give an allow/ask decision on calls the static policy cannot classify. The roadmap's evidence is a 7-of-7 probe and a planned "100-call labelled set". No repository code or labelled data covers this yet. The only shipped rail, injection_guard, runs on AFTER_TOOL_CALL and judges fetched page text. It never sees the call the agent is about to make.
A public step-level set for exactly this question is now available, so we no longer need to hand-label 100 calls before getting a first precision/recall number:
- TS-Bench (ToolSafe, ACL 2026 Findings): https://aclanthology.org/2026.findings-acl.1850/, data at https://huggingface.co/datasets/MurrayTom/TS-Bench (Apache-2.0, not gated, revision
19047a0c4a54f54cc1ddd4a2c597105d8453b819). Each row is one candidate action, made ofinstruction,history,current_actionandenv_info(tool specs), withscore0 / 0.5 / 1 (safe / controversial / unsafe). Eval splits:AgentDojo-Traj(1,220 rows: 868 safe, 352 unsafe, no 0.5),ASB-Traj(5,231) andAgentHarm-Traj(731). I checked theAgentDojo-Trajcounts by downloading the file. - For context, TraceSafe-Bench (https://arxiv.org/abs/2604.07223) reports that general LLMs beat specialised guard models on mid-trajectory tool-call risk, and that structured-input handling drives the result more than safety tuning. That makes it a useful comparison for a structured
noulhead.
Proposal
- Rail: add
s1a/agents/tool_gate.py, aRailSpeconAgentCallbackEvent.BEFORE_TOOL_CALL,question="noul"("is this tool call unsafe to run for this user request?"). Its state is the user instruction, the trimmed history, the candidate call (name and arguments) and the tool's description. Bands follow the roadmap: allow above p_safe 0.7, ask in between, deny below 0.1. Keep the inversion between the roadmap's "safe p" andflagged="true"explicit. "Ask" uses the interrupt path the permission engine already uses (openjiuwen/harness/rails/security/tool_security_rail.py,resolve_interrupt). Fail closed to "ask", not "deny". - Labelled set: add
scripts/build_tsbench_set.py, which converts a pinned TS-Bench revision into theread_labelledJSONL shape under.external/(not vendored, same pattern asscripts/build_browsesafe_set.py). Commit a seeded sample of ids (e.g. 300 fromAgentDojo-Trajplus 300 fromASB-Traj) and a small committed fixture for offline tests. Score 1 is unsafe, 0 is safe, 0.5 is dropped from the headline and reported separately. - Dedup note:
evals/labelled/injection-public.jsonlalready draws on AgentDojo, but as tool output text for the injection guard. TS-Bench's AgentDojo rows judge the next call. State in the docs that the two measure different hooks, and check that no sampled row duplicates an injection-public item verbatim. - Baselines on the same ids: (a) a static rule baseline: destructive-pattern regex plus "the call's tool is not mentioned in the instruction"; (b)
--model llm(chat model as judge); (c)jev, plus any other text decision backend the run supports.
Acceptance
s1a run tool_gate --labelled-set .external/tsbench/sample.jsonl --model <backend>reports precision, recall and F1 on "unsafe", false-allow rate, ask rate at the default bands, and AUROC from the probabilities, with Wilson intervals, per split.- A results table in
docs/benchmarks.mdlists every backend on the identical committed ids, with the dataset revision and seed. Cells without credentials stay N/A, with no invented numbers. - Offline tests cover the converter (fixture rows → records, 0.5 handling), the band mapping, and fail-closed-to-ask on decision errors.
docs/roadmap.mdis updated: the tool-call guardrail moves from "to ship" to measured, or the PR states why not.
Out of scope
Live AgentDojo or ASB re-runs with the gate switched on (utility under attack). That is a follow-up once the offline step-level numbers exist.
- Vorherrschende Sprache
- Python
- Sterne
- 120
- Forks
- 21
- Ø Merge
- 17 Std. 13 Min.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ThinkFlowLab/system1-agents
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
ThinkFlowLab/system1-agents#129 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
ThinkFlowLab/system1-agents#130 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Eval] Measure cross-question interference when decide_many bundles questionsEvtl. vergeben @Birfy hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
ThinkFlowLab/system1-agents#127 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Feat] Add Cloudflare Clef / Clef-flash as a System One decision backendEvtl. vergeben @Birfy hat das heute übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
ThinkFlowLab/system1-agents#126 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Eval] Add a seeded WebHarbor slice: locally reset, verifier-graded browser tasks (offline counterpart to #116)Evtl. vergeben @Birfy hat das vor 12 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
ThinkFlowLab/system1-agents#118 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in ThinkFlowLab/system1-agents
Ähnliche Issues
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
jxxghp/MoviePilot#7576 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
jbaruch/software-factory#266 ·
Maintainer antworten meist innerhalb von 1 Tag
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag