Repository navigation
feat: integrate contextual guardrails into execution and approvals - #1510
Merged
Merged
Conversation
JAORMX
marked this pull request as ready for review
September 15, 2026 11:46
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
2 times, most recently
from
September 21, 2026 13:04
97bc9cd to
a27173b
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 22, 2026 05:12
a27173b to
f1bc5a2
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 08:02
044c4e3 to
df51996
Compare
aponcedeleonch
left a comment
Member
There was a problem hiding this comment.
I've been hitting Inspection returned an assessment that did not satisfy the review contract locally. Left a few comments on why it happens and how we could make the checker more robust to it.
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 12:10
df51996 to
ec6d1f5
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 12:32
ec6d1f5 to
6b5810c
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 14:13
6b5810c to
b4b3706
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 15:08
b4b3706 to
3643198
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 24, 2026 18:57
3643198 to
8b7fc79
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 25, 2026 06:50
8b7fc79 to
61eccd6
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 25, 2026 07:20
61eccd6 to
143c063
Compare
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 25, 2026 08:21
143c063 to
73be1c1
Compare
Base automatically changed from
plan/contextual-guardrails-20260914
to
main
September 25, 2026 08:39
Co-Authored-By: mecatl <[email protected]>
JAORMX
force-pushed
the
impl/contextual-guardrails-20260914
branch
from
September 25, 2026 08:39
73be1c1 to
c1b2ab2
Compare
aponcedeleonch
approved these changes
Sep 25, 2026
aponcedeleonch
added a commit
that referenced
this pull request
Sep 25, 2026
Main's contextual guardrails integration (#1510) removed buildGuardrailsHooks in favour of an engine ToolReviewer, which broke the build of this branch's configured-guardrail correlation test after rebase. Drive the same dispatch through the real buildGuardrailsActionReviewer and attachGuardrailReviewer wiring, and expect the reviewer's guardrail-review- child session as the active ID while root stays intact. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Sep 25, 2026
This was referenced Sep 25, 2026
Merged
This was referenced Sep 29, 2026
This branch was successfully deployed
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
Replace the hook-based guardrail reviewer with contextual action and inbound-result review integrated into the execution and approval pipeline.
This implements the proposal in #1455 (ADR 0342). It is not only a prompt change: it adds restricted evidence investigation, private task context across workers, exact action grants, and one-time release of already-produced tool results. It also changes shared dispatch, approval, and restart behavior, with corresponding engine, wire, TUI, and SDK changes.
Stacked PR: targets
plan/contextual-guardrails-20260914, notmain. The amended proposal baseline is4d130baf25f4d1d9f2051a21a2765c4fa7fa4a77. Stacked implementation before proposal merge was explicitly authorized; merge sequencing remains human-owned.What changes
Contextual review
Execution and approval correctness
Operator and client surfaces
Compatibility and operational consequences
Run.Approvereturning an error, atomicResolveApproval, and explicit serialized approval origins replacing the previous representation. Seeengine/CHANGELOG.md.Verification and evidence
At
ff1245c8a40d47959e2b8cc991047ac68d7d8079, published CI completed with 30 passed, four expected skips, zero failed or pending:Recorded local verification includes full lint/race tests, docs/site, build, offline demo and benchmarks; later corrections passed affected suites. The final SDK fixture correction passed all 216 SDK tests. The macOS portability job received a 10-to-15-minute timeout adjustment for FreeBSD cross-compilation, without removing checks.
The scoped acceptance trace maps 32 ACs: 31 to executable tests and one to an inspection artifact. Prior implementation reviews reported no blocking or important findings at their checkpoint. These are verification records, not proof of complete semantic conformance, minimal design, low regression risk, or checker efficacy. The subsequent budget discrepancy below remains open.
Open issues and remaining validation
End-to-end review budget discrepancy
The plan requires a 90-second total budget including setup and evidence gathering. Source inspection found that action dependency snapshots and evidence preparation run before the timeout begins in
contextualToolReviewer.Review:engine/agent/actionreview.go:177and:201— preparation under the parent context.internal/app/contextual_reviewer.go:336— reviewer timeout begins.internal/app/contextual_reviewer_protocol_test.go:184— the budget test calls the reviewer directly and does not cover preceding preparation.The reviewer invocation has a shared deadline and up to three attempts, but that does not establish the advertised end-to-end bound. This discrepancy needs resolution before claiming full budget-contract compliance. It was identified by source inspection; no new runtime reproduction has been run.
Checker quality is not yet established
No paid/live checker-quality comparison was authorized or run. The current corpus is a seed of ten short cases in five benign/adversarial pairs. Offline tests demonstrate protocol and safety mechanics, not reduced false positives or reliable attack detection.
Actual checker false-warning, false-block and missed-attack rates, latency, and cost remain release-validation work requiring an agreed route, spend authorization, and acceptance thresholds. This PR does not claim production efficacy or that the added intelligence has yet demonstrated its operational value.
Whole-tree acceptance tooling
The recorded whole-tree
task ac-trace-strictfails because actrace v0.0.3 rejectsstatus: proposedin the unrelateddocs/acceptance/callmcpwithquery-broker-support.md. The feature-scoped trace passes; unrelated plan metadata was not changed to hide the failure.Review focus
Review the necessity and correctness of the machinery, not only feature coverage: shared approvals with guardrails disabled; effective-action ordering and post-wait authority; bounded evidence access; cancellation/restart and exactly-once result delivery; worker ownership/privacy; and older-client behavior. Green CI does not eliminate these architectural and operational risks.