[Eval] Measure a pre-execution tool-call gate (Jev noul on BEFORE_TOOL_CALL) on TS-Bench step-level labels
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- huggingface, openapi, python
- Lĩnh vực
- ai, backend-api-design, testing
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 120
- Fork
- 21
- Merge trung bình
- 17 giờ 13 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ThinkFlowLab/system1-agents
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
ThinkFlowLab/system1-agents#129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
ThinkFlowLab/system1-agents#130 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Eval] Measure cross-question interference when decide_many bundles questionsCó thể đã có người làm @Birfy đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
ThinkFlowLab/system1-agents#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feat] Add Cloudflare Clef / Clef-flash as a System One decision backendCó thể đã có người làm @Birfy đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
ThinkFlowLab/system1-agents#126 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Eval] Add a seeded WebHarbor slice: locally reset, verifier-graded browser tasks (offline counterpart to #116)Có thể đã có người làm @Birfy đã nhận 12 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
ThinkFlowLab/system1-agents#118 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ThinkFlowLab/system1-agents
Issue tương tự
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Pin Hugging Face commit revisions for AuK weight downloads and eliminate post-download SHA TOCTOUĐang mởarea:voice better-dependency-freedom dependencies effort:low in-progress model:medium plan planner:gemini-4-neon-high priority:2 security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-area-label
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
OpenFreeEnergy/openfe#2371 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
NCATSTranslator/Babel#1269 ·
Maintainer thường phản hồi trong vòng 1 ngày