Implement Cybernetic Governance Refactoring - #17
Conversation
Implements Layer 2 (Policy-as-Code), Layer 3 (Semantic Verification), Layer 4 (Consensus), and Assisted HITL components within the VACP framework. Integrates these layers into the `VACPGovernedAgent` execution loop to enforce blocking of unsafe actions. - Added `vacp/interfaces.py`: Defines PolicyEngine, Verifier, ConsensusStrategy. - Added `vacp/policy.py`: Implements MockOPAPolicyEngine. - Added `vacp/guards.py`: Implements ShieldGemmaMock and EnsembleConsensus. - Added `vacp/reviewer.py`: Implements ReviewerAgent for HITL context. - Modified `financial-advisor/financial_advisor/agent.py`: Integrated stack and blocking logic. - Modified `vacp/tests/test_vacp.py`: Fixed test regression for ToolGateway policy enforcement. - Added `verify_refactor.py`: Verification script for new governance logic.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Created `ARCHITECTURE_TECHNICAL_DESCRIPTION.md` detailing the system context, cybernetic stack layers (Policy, Verifier, Consensus, HITL), component interactions, and data flow. - This document serves as the canonical reference for the implemented governance architecture.
Implemented the 3-layer defense system (Syntax, Policy, Sentinel) required for the Capstone "Glass Wall" scenario. - **Layer 1 (Syntax):** Added `TradeAction` Pydantic model with strict type and SQL injection validation. - **Layer 2 (Policy):** Updated `MockOPAPolicyEngine` to include stateful logic for Velocity Limiting (3/min), Exposure Limiting ($50k), Blacklisting (LUNA), and Aggregate Exposure (Loophole detection). - **Layer 3 (Sentinel):** Updated `ShieldGemmaMock` to detect "Insider" threats and "Social Engineering" of tool names (`debug_system_check`). - **Testing:** Added `tests/test_capstone_gauntlet.py` implementing the 5 Red Team test cases. Updated `verify_refactor.py` to match strict blocking rules.
Refactored the financial advisor agent to implement a multi-layered Cybernetic Governance architecture as requested. This includes new interfaces for policy, verification, and consensus, and their integration into the agent's run loop to actively block unsafe tool usage.
PR created automatically by Jules for task 14507731647806984323 started by @lahlfors