Add agent-risk-firewall plugin#443
Open
maixuancanh wants to merge 3 commits into
Open
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.
Plugin Submission
Plugin name: agent-risk-firewall
Version: 1.2.0
Type: new-plugin
Checklist
plugin-store lintpasses locally with no errorsokx-,official-,plugin-store-)nameanddescriptionWhat does this plugin do?
agent-risk-firewallis a pre-trade risk firewall for OKX Agentic Wallet workflows on X Layer and Solana. It evaluates proposed swaps, token trades, and approvals before signing, then returns a deterministic JSON verdict:allow,warn, orblock.It supports policy profiles (
balanced,strict,competition,degen-small-size), optional external evidence from other plugins, approval-specific risk checks, and audit trail fields (decisionId,policyVersion,evidenceHash). It does not sign, broadcast, execute swaps, revoke approvals, or handle private keys.Update: v1.2.0 adds Competition Mode Enhancer, including competition context checks, join/status validation, supported-chain checks, participation threshold warnings, and stable/native-only pair blocking.
Which onchainos commands does it use?
The Python CLI may call these read-only / pre-execution OnchainOS commands when enough input context is available:
onchainos security token-scanonchainos security tx-scanonchainos gateway simulateonchainos token liquidityThe plugin documentation also describes integration patterns where a separate trading skill or agent may call:
onchainos swap quoteonchainos swap swapagent-risk-firewallitself does not callonchainos swap execute.Security Considerations
This plugin is a defensive pre-sign guardrail. It never asks for, stores, or handles private keys, seed phrases, mnemonics, wallet credentials, or API secrets.
It does not sign transactions, broadcast transactions, execute swaps, revoke approvals, or transfer assets. It only evaluates intent/quote/transaction context and returns a verdict for the agent to follow.
If scan or simulation data is unavailable, the firewall treats verification as incomplete. In
balanced,competition, anddegen-small-sizeprofiles this returns at leastwarn; instrictprofile it returnsblock.Agent behavior is explicitly defined:
allow: agent may continue only if the user already requested executionwarn: agent must show reasons and ask for explicit confirmationblock: agent must stop and must not ask the user to sign or broadcastTesting
Local validation completed:
plugin-store lint .\skills\agent-risk-firewallpassedpython -m pytest .\skills\agent-risk-firewall\tests -q -p no:cacheproviderpassed with 28 testsTest coverage includes:
HIGH->warnCRITICALbuy/swap ->blockCRITICALsell ->warnwarn->warnblock->blockblockbalanced,strict,competition,degen-small-sizeIntegration dry-runs with real OnchainOS were also performed without signing or broadcasting: