[Eval] Measure a pre-execution tool-call gate (Jev noul on BEFORE_TOOL_CALL) on TS-Bench step-level labels
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 38/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- huggingface, openapi, python
- Domínio
- ai, backend-api-design, testing
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 120
- Forks
- 21
- Merge médio
- 17h 13min
- PRs com merge (30d)
- 7
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de ThinkFlowLab/system1-agents
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
ThinkFlowLab/system1-agents#129 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
ThinkFlowLab/system1-agents#130 ·
Mantenedores costumam responder em até 1 dia
-
[Eval] Measure cross-question interference when decide_many bundles questionsTalvez já em andamento @Birfy assumiu há 4 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
ThinkFlowLab/system1-agents#127 ·
Mantenedores costumam responder em até 1 dia
-
[Feat] Add Cloudflare Clef / Clef-flash as a System One decision backendTalvez já em andamento @Birfy assumiu há 1 dia. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 28/100
ThinkFlowLab/system1-agents#126 ·
Mantenedores costumam responder em até 1 dia
-
[Eval] Add a seeded WebHarbor slice: locally reset, verifier-graded browser tasks (offline counterpart to #116)Talvez já em andamento @Birfy assumiu há 13 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 22/100
ThinkFlowLab/system1-agents#118 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de ThinkFlowLab/system1-agents
Issues semelhantes
-
bug docs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
mesa/mesa#4223 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
ActivityWatch/docs#223 ·
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier captureTalvez já em andamento @jianyx1 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
volcengine/OpenViking#8354 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ARTPARK-SAHAI-ORG/calibrate-frontend#842 ·
Mantenedores costumam responder em até 1 dia
-
comp/tools P2 tool/skills type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NousResearch/hermes-agent#159541 ·
Mantenedores costumam responder em até 1 dia