Skip to content

test(policy): prove extension grants cannot widen Agent authority - #62

Open
seonghobae wants to merge 5 commits into
mainfrom
test/extension-policy-isolation
Open

test(policy): prove extension grants cannot widen Agent authority#62
seonghobae wants to merge 5 commits into
mainfrom
test/extension-policy-isolation

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Partial implementation of #27.

Buyer/security gap

OriginWeave has an explicit extension-to-Agent grant boundary and an independent typed action policy engine, but it needs integration regressions proving that permission to propose a typed action cannot widen Agent origin/action/secret authority or turn untrusted extension-produced content into trusted policy instruction material.

Exact current scope

Protected main is exact 0841d2ab3d8b5e60a03c0a8e818cf438e2716829. Current exact contributor head is 3690bf0a351b77957071f5399e9a31cec5f39e0b.

After protected main advanced through #179, this lane was reconciled non-destructively to the new protected-main lineage and then repaired for the strengthened extension-grant API. The sole semantic path remains crates/originweave-policy/tests/extension_policy_isolation.rs.

The current test boundary first proves that an exact extension/session/context/origin/unexpired grant genuinely allows ProposeTypedAction, then independently proves five fail-closed Agent-policy outcomes:

  1. proposal authority cannot widen Agent readable-origin authority (OriginNotReadable);
  2. proposal authority cannot supply the missing core Navigate capability (MissingCapability(Navigate));
  3. extension-produced WebContent cannot become a trusted policy instruction (UntrustedInstructionSource);
  4. extension proposal authority cannot turn RawValue into an allowed secret fill (SecretBrokerRequired); and
  5. secret material attached to a non-secret action remains rejected (UnexpectedSecretMaterial).

The grant-first assertion prevents a vacuous pass caused by an extension that lacked proposal authority in the first place.

Root-cause repair after protected-main movement

The reconciled predecessor head 3b002edf01d12f5d1dc943f44ed3517e2a9c606f compiled against the old four-argument grant/request contract and failed current CI after #179 added canonical origin plus trusted-time expiry to ExtensionAgentGrant / ExtensionAccessRequest. Current head 3690bf0a351b77957071f5399e9a31cec5f39e0b applies the narrow test-only repair: the grant and request now use the same canonical extension origin, an exclusive unexpired deadline, and trusted evaluation time. The five downstream denial expectations are unchanged.

Exact-current evidence

On unchanged exact head 3690bf0a351b77957071f5399e9a31cec5f39e0b:

  • CI run 31976441708: success;
  • Security Scan run 31976441644: success;
  • SAST Semgrep run 31976441651: success;
  • Required OpenCode Review run 31976440068: success;
  • Required Noema Review run 31976440036: success;
  • Strix run 31976440134: success;
  • Required PR Review Merge Scheduler run 31976440049: success;
  • Close Empty PR run 31976440071: success;
  • Code Quality run 31976439150: success;
  • no formal reviews are currently returned; and
  • no inline review threads are currently returned.

The earlier unassigned-runner SAST/Security queue was a transient control-plane condition routed to the existing organization incident ContextualWisdomLab/.github#712; both exact-current-head runs later completed successfully without branch churn. That historical queue is therefore no longer a merge-readiness blocker and did not justify a source mutation merely to retrigger it.

Architecture boundary

This PR adds no production API and no new authority. Chrome permission, an OriginWeave extension proposal grant, Agent capability, origin authority, approval, browser execution, secret resolution, trusted broker operation, and verified success remain distinct boundaries. The test does not claim that a real Chromium extension adapter or trusted secret broker exists.

Live governance / integration gate

Active organization ruleset 18156473, freshly re-read on 2026-08-17, requires the seven central required workflows, one approving review, stale-review dismissal after pushes, latest-push approval, and resolved review threads. There are no bypass actors. Passing automation is not an approving review.

All currently applicable exact-head workflows are green and no review thread is open, but no qualifying independent current-head/latest-push formal approval is established. Protected-main AGENTS.md independently forbids scheduled agents from merging, self-approving, altering workflows, adding secrets, weakening checks, tagging, or publishing. This scheduled actor therefore leaves the clean head unchanged while integration waits for qualifying independent approval; that wait blocks only integration.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26f588b3-e72f-4e50-859c-3651127adb38

📥 Commits

Reviewing files that changed from the base of the PR and between 277df96 and e7265a8.

📒 Files selected for processing (1)
  • crates/originweave-policy/tests/extension_policy_isolation.rs

📝 Walkthrough

Walkthrough

브라우저 확장 프로그램 권한 격리 테스트를 추가했다. ProposeTypedAction grant가 출처 접근, Navigate capability, 정책 지시문 신뢰를 확대하지 않는지 검증한다. 원시 비밀값의 우회 전달과 일반 작업 첨부도 거부 사유와 함께 검증한다.

Changes

확장 프로그램 정책 격리

Layer / File(s) Summary
정책 격리 시나리오 검증
crates/originweave-policy/tests/extension_policy_isolation.rs
테스트 헬퍼와 시나리오를 추가했다. ProposeTypedAction grant가 출처 읽기 권한과 Navigate capability를 제공하지 않는지 확인한다. WebContent 지시문이 신뢰된 정책 지시문으로 처리되지 않는지도 검증한다.
비밀 자료 격리 검증
crates/originweave-policy/tests/extension_policy_isolation.rs
원시 비밀값을 전달하는 FillSecret 요청이 SecretBrokerRequired로 거부되는지 확인한다. 원시 비밀값을 일반 Navigate 작업에 첨부한 요청이 UnexpectedSecretMaterial로 거부되는지도 검증한다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to e7265

This PR adds regression tests enforcing extension and Agent authority boundaries; the supplied checks pass, and no actionable merge-blocking risk remains after normal review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 확장 프로그램 권한 부여가 Agent 권한을 확대하지 못함을 검증하는 테스트 추가라는 주요 변경 사항을 명확하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/extension-policy-isolation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 10, 2026 21:59
@cursor

cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 3690bf0a351b77957071f5399e9a31cec5f39e0b.

  • Head SHA: 3690bf0a351b77957071f5399e9a31cec5f39e0b

  • Workflow run: 32053097886

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: extension_policy_isolation.rs"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: extension_policy_isolation.rs"]
  R1 --> V1["required checks"]
Loading

@opencode-agent

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 3690bf0a351b77957071f5399e9a31cec5f39e0b
  • Workflow run: 32053097886
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 3690bf0a351b77957071f5399e9a31cec5f39e0b.

  • Head SHA: 3690bf0a351b77957071f5399e9a31cec5f39e0b

  • Workflow run: 32053097886

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: extension_policy_isolation.rs"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: extension_policy_isolation.rs"]
  R1 --> V1["required checks"]
Loading

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