[Conformance] Claude Code host: a Bash command that exits non-zero reaches the model without the result gate
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bash, bun, typescript
- Lĩnh vực
- security
Hướng nghiên cứu
Start with docs/spec/instrument/hooks.md and tool-call-result.json to confirm when toolCallResult is expected, then read claude-code.hookmap.yaml:184 and the shim settings under refimpl/claude-code-read and hosts/claude-code/settings.json. Reproduce the documented cat fake-secret.txt; exit 1 case, checking the session transcript and Guardian envelope log for a missing steps/toolCallResult. Done means the spec and shim state how a non-zero-exit Bash result is governed, so the result gate cannot be skipped by appending ; exit 1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What you ran
Claude Code 2.1.325 (claude-opus-5-5, -p, default permission mode) with the reference Guardian and the Claude Code shim from PR #597 (refimpl/claude-code-read at 201ddb3, on integration d3323ba), Bun 1.3.11. The shipped hosts/claude-code/settings.json and ACS_ON_DECISION_FAILURE=deny, with a fresh Guardian and session for every run and 3 runs per case.
fake-secret.txt holds the AWS documentation example key, which the shipped policy redacts. I read what reached the model from the API requests that Claude Code records in the session transcript, not from the model's reply.
What you expected
docs/spec/instrument/hooks.md says toolCallResult "Fires after tool execution, before the result is ingested into the agent's reasoning context", and tool-call-result.json allows exit_status: failure. A command that fails has still run and produced output, so its result should go through the result gate like any other. cat fake-secret.txt; exit 1 should reach the model redacted, the same as cat fake-secret.txt.
What happened
As a control, cat fake-secret.txt goes through PostToolUse, the Guardian redacts the key, and the model gets [REDACTED] (3/3).
With ; exit 1 or ; exit 3 appended, the output skips the Guardian (3/3 for each exit code):
- the Guardian allows the command at
PreToolUse; - Claude Code treats the non-zero exit as a failed tool call and fires
PostToolUseFailureinstead ofPostToolUse; - the shipped settings register no hook for that event, so the Guardian's envelope log has
handshake/helloandsteps/toolCallRequestbut nosteps/toolCallResult, and no audit entry is written; - the next API request carries the whole output, key included.
Claude Code decides per command what counts as a failure. Its tools reference treats exit 1 as a valid result only for grep, rg, egrep, fgrep, find, diff, test, [, git diff and git grep. Any other command that exits non-zero takes the failure path, so a command the Guardian allowed only needs ; exit 1 at the end to skip the result gate.
Wiring the event would not withhold the output either. The hooks reference says "PostToolUseFailure can't rewrite a result, so a failing command's output reaches Claude unchanged." I checked it with a probe hook on PostToolUseFailure, 3 runs per response, and the key stayed in the request every time:
- exit 2 adds the probe's stderr next to the output;
{"decision": "block"}adds the reason next to it;additionalContextadds the context next to it;updatedToolOutput, which is not documented for this event, is ignored.
The probe does get the full output in error. A shim wired to the event could send a toolCallResult and write an audit entry, but it could not redact.
claude-code.hookmap.yaml:184 notes that PostToolUseFailure is "not wired in this slice". Nothing in the tree says that a failing command's output reaches the model ungoverned.
Related: #375 covers stderr and exit 2 on the PostToolUse path, and #568 covers a Read result the shim cannot rewrite. This is another way past the same gate, and the command the Guardian allowed is the one that takes it.
Current Priority Scope
Feeds conformance evidence
- Ngôn ngữ chính
- TypeScript
- Star
- 183
- Fork
- 56
- Merge trung bình
- 3 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 67
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 GenAI-Security-Project/agent-control-standard
-
status:needs-triage type:bug workstream:refimpl
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GenAI-Security-Project/agent-control-standard#764 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:needs-triage type:docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 96/100
GenAI-Security-Project/agent-control-standard#717 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:needs-triage type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GenAI-Security-Project/agent-control-standard#650 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:P1 status:needs-triage type:conformance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
GenAI-Security-Project/agent-control-standard#614 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Conformance] Tool-call trace spans are dropped by a GenAI backend: no gen_ai.operation.name, span name is not execute_toolCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởstatus:needs-triage type:conformance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
GenAI-Security-Project/agent-control-standard#520 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GenAI-Security-Project/agent-control-standard
Issue tương tự
-
Media browser returns "Not found" for repositories using the SHA-256 object formatCó thể đã có người làm @adamchodera đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Follow-ups from #312Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
janhesters/remixcn#318 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
danielmiessler/LifeOS#3150 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Make the "%" unit spacing the same in the web and in A10Có thể đã có người làm @kragent66-glitch đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 bình luận ·