Repository navigation
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| expiresAt, _ := time.Parse(time.RFC3339Nano, bundle.ExpiresAt) | ||
| state.snapshot = Snapshot{Required: true, Ready: true, PromptSequence: sequence, Deployment: &deployment, ExpiresAt: expiresAt} |
There was a problem hiding this comment.
Silently ignoring time parsing error will cause all prompt policies to be treated as expired. If bundle.ExpiresAt is malformed or in an unexpected format, time.Parse will fail and return the zero time value. At line 150, the check time.Now().Before(selected.ExpiresAt) will always be false (since current time is after zero time), causing valid policies to be rejected with "required prompt policy is not ready" errors.
expiresAt, err := time.Parse(time.RFC3339Nano, bundle.ExpiresAt)
if err != nil {
state.snapshot = Snapshot{
Required: true, Ready: false, PromptSequence: sequence,
Failure: fmt.Errorf("invalid expiry time: %w", err),
}
return state.snapshot, state.snapshot.Failure
}| expiresAt, _ := time.Parse(time.RFC3339Nano, bundle.ExpiresAt) | |
| state.snapshot = Snapshot{Required: true, Ready: true, PromptSequence: sequence, Deployment: &deployment, ExpiresAt: expiresAt} | |
| expiresAt, err := time.Parse(time.RFC3339Nano, bundle.ExpiresAt) | |
| if err != nil { | |
| state.snapshot = Snapshot{Required: true, Ready: false, PromptSequence: sequence, Failure: fmt.Errorf("invalid expiry time: %w", err)} | |
| return state.snapshot, state.snapshot.Failure | |
| } | |
| state.snapshot = Snapshot{Required: true, Ready: true, PromptSequence: sequence, Deployment: &deployment, ExpiresAt: expiresAt} | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Greptile SummaryThis PR adds an opt-in synchronous prompt-policy barrier to the managed daemon and selects verified, session-specific Cedar policy sets for subsequent tool calls.
Confidence Score: 4/5The prompt-policy barrier should be fixed before merging because a routine Cedar refresh outage can reject every new user prompt despite a valid authoritative cached deployment. Prompt activation consults only the active Cedar deployment, while the cache and existing enforcement path intentionally continue using LastKnownGood after the active snapshot ages out. Files Needing Attention: internal/sessionpolicy/manager.go Important Files Changed
Sequence DiagramsequenceDiagram
participant Agent
participant Daemon
participant Manager as Session Policy Manager
participant API as Prompt Policy API
participant Cedar
Agent->>Daemon: UserPromptSubmit
Daemon->>Manager: BeginPrompt(session, prompt)
Manager->>API: Derive policy from parent deployment
API-->>Manager: Signed complete PolicySet
Manager-->>Daemon: Atomically activate session policy
Daemon-->>Agent: Allow or activation deny
Agent->>Daemon: PreToolUse
Daemon->>Manager: CurrentFor(session)
Manager-->>Cedar: Selected session PolicySet
Cedar-->>Agent: Authorization decision
|
f12befe to
8867b94
Compare
e5ce4dc to
c27d9dd
Compare
c27d9dd to
fa4e627
Compare
8867b94 to
03a75ff
Compare

ENG-624 CLI stack 4/6; stacked on #468.
Wires the synchronous prompt barrier into the persistent daemon and existing Cedar provider. PreToolUse selects one complete session PolicySet and performs one local Cedar authorization call.
Runtime enablement comes from endpoint configuration. The client needs no prompt-policy trust-key bootstrap or extra cryptographic setup.