feat(pep): admit bound typed proposals - #231
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PEP now admits cryptographically bound typed proposals through the shared authorization, policy-hook, audit, refusal, and metrics paths while preserving read handling and fail-closed behavior. ChangesTyped proposal admission
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant Enforcer
participant PolicyHook
participant Auditor
participant DecisionObserver
Caller->>Enforcer: AuthorizeProposal(scope, ProposalInput)
Enforcer->>PolicyHook: submit normalized Request
PolicyHook-->>Enforcer: return PolicyDecision
Enforcer->>Auditor: record sanitized AuditEvent
Enforcer->>DecisionObserver: observe canonical proposal verb and outcome
Enforcer-->>Caller: return authorization result
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/pep/audit.go`:
- Around line 69-76: Update the audit validation logic around the role/action
checks and event.Verdict handling to enforce the shared authorization contract
for proposal actions. Reject unauthorized role/action combinations unless the
event has exactly a deny verdict with the role-denied reason code, while
preserving existing validation for valid combinations and other actions.
In `@internal/pep/proposal_test.go`:
- Around line 359-405: Update FuzzProposalInputRejectsTamperedBinding to assert
that each rejected tampered proposal emits the mandatory denial audit with the
invalid-request reason, including fuzz-generated intent-ID mutations. Validate
the collected audits after AuthorizeProposal returns the expected error while
preserving the existing leak and zero-hook assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 869c4b45-cceb-492f-aa19-d4560a875c96
📒 Files selected for processing (8)
internal/pep/audit.gointernal/pep/audit_test.gointernal/pep/boundary_test.gointernal/pep/metrics.gointernal/pep/metrics_test.gointernal/pep/pep.gointernal/pep/pep_test.gointernal/pep/proposal_test.go
Extend the fail-closed policy enforcement point with a proposal-only admission path bound to the verified tenant, actor, canonical action verb, normalized target, intent identifier, and validated argument digest. Keep raw proposal material out of policy audit and metrics, preserve the read-only default hook, and expose distinct typed deny and approval-required outcomes without adding any execution capability. Closes #230 GSTACK-Checkpoint: 2026-07-17/pep-proposal-admission#1 Signed-off-by: Gnani Rahul <gnani.nutakki@gmail.com>
9a7cf0e to
469d860
Compare
Summary
Security and sequencing
This is admission only. It adds no network, provider, connector execution, credential, filesystem, shell, MCP, or dispatch capability. An allow decision cannot execute an intent. The PEP still defaults every proposal to deny until a later reviewed PDP and orchestrator are wired.
Caller-controlled intent identifiers remain inside the domain-separated SHA-256 binding rather than being copied into audit. Refusal normalization erases binding digests before audit conversion.
Validation
PATH=/Volumes/EXTENDED/MacData/tools/bin:$PATH make ciPATH=/Volumes/EXTENDED/MacData/tools/bin:$PATH make e2e-isolationgo test -race ./internal/pep ./internal/hubfleet ./internal/observabilitygo test -fuzz=FuzzProposalInputRejectsTamperedBinding -fuzztime=30s ./internal/pep(8,879,624 executions)Closes #230
Summary by CodeRabbit
New Features
Security & Reliability
Tests