Skip to content

fix: pass complete response to stop hooks - #11366

Merged
jbg merged 3 commits into
mainfrom
jbg/security-stop-hook-response
Aug 20, 2026
Merged

jbg merged 3 commits into
mainfrom
jbg/security-stop-hook-response

Conversation

@jbg

@jbg jbg commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • pass the complete trailing assistant response to state-machine Stop hooks
  • apply the same user-visible message and content-audience filtering in the legacy loop
  • cover split provider response IDs, visibility filtering, and Stop-hook denial retries

Security invariant

Stop hooks must inspect the same complete user-visible assistant response that is presented to the user, regardless of agent loop, provider chunk, or response ID.

Verification

  • bin/cargo fmt --all -- --check
  • bin/cargo test -p goose stop_hook_payload --lib — 2 passed
  • bin/cargo test -p goose agents::state_machine::tests::hooks_lifecycle --lib — 4 passed
  • bin/cargo build -p goose
  • bin/cargo clippy -p goose --all-targets -- -D warnings
  • git diff origin/main...HEAD --check

This finding was discovered by Project Loupe

Signed-off-by: Jasper Hugo <jasper@spiral.xyz>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ca015b223

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/goose/src/agents/state_machine/ops_stop_hook.rs
Signed-off-by: Jasper Hugo <jasper@spiral.xyz>
@jbg
jbg requested review from DOsinga and jamadeo August 19, 2026 19:13
@michaelneale
michaelneale added this pull request to the merge queue Aug 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Aug 20, 2026
* origin/main: (50 commits)
  chore(deps): bump the ui-minor-and-patch group across 1 directory with 53 updates (#11386)
  fix(security): bound call graph traversal (#11193)
  fix: pin arrayref to known-good commit (#11389)
  feat(providers): add SayGM as declarative OpenAI-compatible provider (#11267)
  feat(providers): custom provider cost fields drive cost tracking (config-declared pricing fallback) (#11220)
  fix(deps): repair dangling syn reference in Cargo.lock (#11385)
  fix(flake): add cudaforge hash for git dependency (#10910)
  feat: auto-focus chat input when user starts typing (#11184)
  fix(security): fail closed on invalid Codex ACP mode (#11362)
  fix(mcp): keep stdio extensions alive across worker exits (#10364)
  feat(ui): collapse scheduled job sessions into accordion in chat history (#11265)
  fix: bound retry command diagnostics (#11365)
  Disable thinking for tool call labels (#11207)
  fix(review): contain REVIEW.md discovery (#11367)
  fix(acp): preserve tool result audience metadata (#11375)
  test(providers): isolate environment-proxy test in its own binary (#11262)
  fix(security): bind Foundry API keys to request origin (#11347)
  fix: canonicalize mangled tool names before permission inspection (follow-up to #10230) (#10285)
  feat(providers): add Lynkr as a declarative OpenAI-compatible provider (#11372)
  fix: sanitize Pi imported output (#10990)
  ...

# Conflicts:
#	crates/goose/src/agents/state_machine/tests/hooks_lifecycle.rs
@jbg
jbg added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit ea07f7b Aug 20, 2026
26 checks passed
@jbg
jbg deleted the jbg/security-stop-hook-response branch August 20, 2026 11:07
alexhancock added a commit that referenced this pull request Aug 20, 2026
…bined

* origin/main: (85 commits)
  feat(desktop): sort configured providers to the top of the provider list (#11409)
  fix(cli): refuse symlink diagnostics outputs (#11398)
  test(plugins): isolate GOOSE_PATH_ROOT in discovery tests (#11407)
  fix(config): serialize secret mutations (#11388)
  fix: decouple source file and tool response limits (#11391)
  chore(deps): bump pctx_code_mode from 0.4.1 to 0.5.0 (#11245)
  fix(security): suppress sensitive OTLP traces (#11381)
  feat(openrouter): forward session_id and add app category header (#10868)
  feat(acp): derive and forward thinking effort from the ACP harness (#10949)
  fix(aws_bedrock): replace flat model list with routing table, add Gemma 4 Mantle support (#10297)
  Add GPT-5.6 follow-up support for Codex and Responses API (#10460)
  fix(update): fetch attestation bundles from bundle_url (#10557)
  fix(security): fail closed on invalid default GCP credentials (#11363)
  fix(codex): reject socket-backed MCP extensions (#11304)
  fix: pass complete response to stop hooks (#11366)
  fix: contain and bound skill supporting file reads (#11342)
  chore(deps): bump the ui-minor-and-patch group across 1 directory with 53 updates (#11386)
  fix(security): bound call graph traversal (#11193)
  fix: pin arrayref to known-good commit (#11389)
  feat(providers): add SayGM as declarative OpenAI-compatible provider (#11267)
  ...

# Conflicts:
#	crates/goose/src/agents/agent.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants