-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
ExecutionContext stores a reference to the live GovernancePolicy object (base.py line 556). If the policy is mutated mid-session — via hot-reload, compose, or direct attribute change — all active contexts immediately see the new policy, breaking determinism.
Evidence
create_context()(line 830):policy=self.policypasses reference, not copypre_execute()readsself.policydirectly (lines 861, 875, 882, 888)- No version pinning, staleness detection, or snapshot mechanism exists
- No
policy_changedorversion_checkpatterns anywhere in codebase
Proposed Solution
- Snapshot on session start: Deep-copy the policy in
create_context() - Add
policy_versionfield toGovernancePolicy(auto-incremented on mutation) pre_execute()should compare context's pinned version against live version and log a warning if they diverge- Add
GovernancePolicy.snapshot()method for explicit copy
Risk Without Fix
A supply-chain or runtime attack that mutates BaseIntegration.policy silently changes enforcement for ALL active sessions — including sessions that started under the old rules.
/cc @imran-siddique
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working