Skip to content

fix(guardrails): isolate contextual reviewer instructions - #2006

Merged
JAORMX merged 2 commits into
mainfrom
fix/guardrail-reviewer-isolation
Sep 30, 2026
Merged

JAORMX merged 2 commits into
mainfrom
fix/guardrail-reviewer-isolation

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Correct the role mismatch that let the contextual guardrail reviewer inherit ordinary working-agent context.

The production factory creates guardrail-reviewer, but the two injection exclusions still named guardrail-checker. As a result, configured harness instructions/rules and operator-profile preferences could be added to the checker's prompt as instructions or preferences.

  • Match both exclusions to the actual reviewer role; do not retain an unused alias.
  • Exercise the real reviewer factory and observe the actual LLM requests, including an invalid-assessment retry.
  • Preserve admitted instruction facts as review data, the fixed reviewer rubric, and the two evidence-protocol tools.
  • Prove the same context still reaches an ordinary task child.
  • Clarify this boundary in the owning permissions guide.

Scope

Second small Routine repair from the guardrail investigation following #2001. Direct delivery without an acceptance plan was explicitly requested. No changes to enforcement, yolo/advisory policy, evidence selection or limits, model routing, deadlines, or common prompt tone. This repairs instruction isolation; it does not claim measured checker-quality improvements or resolution of every guardrail failure.

Verification

  • RED: new factory regression failed against the original exclusions with all three context sentinels present.
  • Separate mutation checks: reverting only the profile exclusion leaked the profile sentinel; reverting only the harness exclusion leaked instruction and rule sentinels.
  • GREEN: focused tests, targeted race test, and full go test ./internal/app passed.
  • task test: passed.
  • Offline demo: passed with tool call, permission ask/approval, and final result.
  • Independent Spec, Standards, Test adequacy, Security, Architecture, Reuse, Duplication, and UX review: no findings.
  • task docs and task site:build: passed.
  • task lint and task test:race: passed on the final candidate. Lint reports zero issues across all modules. Initial 600-second outer deadlines required longer reruns; lint then identified import shadowing in a test, which was corrected before rerunning the full test and race gates.

Candidate: fbed437d7.

Documentation owner: user-docs/building/what-you-get/permissions.md; explains reviewer instruction isolation without implying that relevant admitted facts disappear from review data.

Match internal child-context exclusions to the guardrail-reviewer role used by the production factory. Keep admitted facts as review data and preserve ordinary worker context, with request-level regression and retry coverage.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX marked this pull request as ready for review September 30, 2026 06:50
@JAORMX
JAORMX merged commit d96c141 into main Sep 30, 2026
72 checks passed
@JAORMX
JAORMX deleted the fix/guardrail-reviewer-isolation branch September 30, 2026 07:03
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 30, 2026
2 tasks
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.

1 participant