Skip to content

Implement Cybernetic Governance Refactoring - #17

Draft
google-labs-jules[bot] wants to merge 3 commits into
oldfrom
cybernetic-governance-refactor-14507731647806984323
Draft

Implement Cybernetic Governance Refactoring#17
google-labs-jules[bot] wants to merge 3 commits into
oldfrom
cybernetic-governance-refactor-14507731647806984323

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

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

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.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


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.
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.

0 participants