fix(agent-sec-core): require copilot-shell >= 2.4.0 in cosh-hook subpackage#1323
Closed
zhangtaibo wants to merge 1 commit into
Closed
Conversation
…ackage The cosh-hook subpackage provides security hooks (prompt-scanner, pii-checker, etc.) for copilot-shell. Without a version dependency, it can be installed against copilot-shell 2.3.0, which lacks the UserPromptSubmit safety-priority merge fix (commit 42d6cac). In copilot-shell 2.3.0, HookAggregator.mergeOutputs uses last-write-wins (mergeSimple) for UserPromptSubmit, causing a later 'allow' decision to silently override an earlier 'ask' security interception. Add Requires: copilot-shell >= 2.4.0 to ensure the safety-priority merge logic is present. Fixes alibaba#1321
Collaborator
|
ci挂了,应该是ci中没有增加copilot shell对应的镜像源,导致sec-core的rpm安装测试失败 |
yangdao479
requested changes
Jul 9, 2026
yangdao479
left a comment
Collaborator
There was a problem hiding this comment.
如果增加该require,会导致在dnf install agent-sec-core的时候,默认安装copilot-shell>=2.4.0的版本,这不符合实际的安装语义(缺少cosh不会导致sec-core无法独立运行)。 建议修改成为:Conflicts: copilot-shell < 2.4.0
Contributor
Author
|
[automated review] case 连续通过 4 次,PR 未 merged,原始 verdict=impl_drift_need_adapt(非 product_bug),疑似误报,关闭 issue+PR。若确已修复请重开。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1321
The
agent-sec-cosh-hooksubpackage provides security hooks (prompt-scanner, pii-checker, observability-hook, etc.) for copilot-shell. Without a version dependency oncopilot-shell, it can be installed against copilot-shell 2.3.0, which lacks theUserPromptSubmitsafety-priority merge fix (commit42d6cac3, first released in v2.4.0).In copilot-shell 2.3.0,
HookAggregator.mergeOutputsuses last-write-wins (mergeSimple) forUserPromptSubmit, causing a laterallowdecision to silently override an earlierasksecurity interception. This means theprompt-scannerhook'saskdecision (e.g., for jailbreak detection) is overridden bypii-checker'sallow.This PR adds
Requires: copilot-shell >= 2.4.0to theagent-sec-cosh-hooksubpackage to ensure the safety-priority merge logic is present.Root Cause
In copilot-shell 2.3.0
cli.js,HookAggregator.mergeOutputsswitch statement is missingcase HookEventName.UserPromptSubmit:in themergeWithOrLogicbranch. It falls through todefault: mergeSimple(outputs), which does{ ...merged, ...output }for each output — last-write-wins.Commit
42d6cac3("fix(cosh): route UserPromptSubmit through safety-priority merge") added the missing case, ensuring the most restrictive decision (ask/block) wins. This fix is in copilot-shell >= 2.4.0.Fix
%package -n agent-sec-cosh-hook Summary: CoPilot Shell security hooks with linux-sandbox Requires: agent-sec-cli = %{version}-%{release} +Requires: copilot-shell >= 2.4.0 Requires: bubblewrapVerification
161859b9)source /root/.cargo/env && bash scripts/rpm-build.sh agent-sec-core→ exit 0, all 8 RPMs producedrpm -qpR agent-sec-cosh-hook-0.7.0-1.alnx4.x86_64.rpmincludescopilot-shell >= 2.4.0This PR was automatically generated by the nightly test pipeline (run
nightly-20260704-020034).