feat: implement risk engine (guard, factors, and client integration)#3
Open
abiorh-claw wants to merge 1 commit intomainfrom
Open
feat: implement risk engine (guard, factors, and client integration)#3abiorh-claw wants to merge 1 commit intomainfrom
abiorh-claw wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the Risk Engine (Phase 1 & 2) for OmniClaw.
This system evaluates transactions based on risk factors (velocity, amount, new recipient) and assigns a Risk Score (0-100).
Key Features
AmountFactor: Exponential risk scaling for large amounts.VelocityFactor: Checks transaction frequency spikes.NewRecipientFactor: Higher risk for unknown addresses.pay()now catchesRiskFlaggedErrorand automatically creates a pending PaymentIntent instead of failing.Changes
src/omniclaw/risk/guard.pyandfactors.py.OmniClawClient.pay()to handle risk exceptions.examples/test_risk.pyfor verification.docs/specs/002_risk_engine.md.Verification
examples/test_risk.pylocally. Confirmed Allow, Flag (Intent Creation logic simulated), and Block scenarios.