Skip to content

feat(token_security_scanner): operator policy and policy_action (#393) - #425

Merged
rosspeili merged 4 commits into
ARPAHLS:mainfrom
Hendobox:feat/issue-393-token-scanner-v02
Oct 14, 2026
Merged

rosspeili merged 4 commits into
ARPAHLS:mainfrom
Hendobox:feat/issue-393-token-scanner-v02

Conversation

@Hendobox

Copy link
Copy Markdown
Contributor

Summary

  • Upgrades defi/token_security_scanner to v0.2.0. Every successful scan now includes policy_action, policy_profile, report_schema_version, and report_id. The bundled enterprise_default profile keeps the v0.1 tiers (critical / high / unknown → block, medium → flag, low → allow).
  • Operators override thresholds in ~/.config/skillware/token_scan_policy.yaml, TOKEN_SCAN_POLICY_PATH, or a per-call policy_path (tax cutoff, closed-source unknown honeypot, minimum holder count). scan accepts an evm.tokens slug such as degen on base.
  • supported_chains marks chains GoPlus does not cover. scan_batch runs up to 5 sequential scans and returns worst_risk_tier. HTTP 429 and 5xx retry once, then fail closed.

Fixes #393

Test plan

  • Existing fixtures still land on the same tiers under the default profile
  • Operator YAML that sets high_tax_pct: 5 turns a 6% buy tax from flag into block
  • token: degen on base resolves to the bundled address
  • A non-GoPlus chain id is goplus_supported: false, and scanning Sepolia fails closed
  • scan_batch of clean / honeypot / medium reports worst tier critical
  • pytest skills/defi/token_security_scanner/test_skill.py tests/test_card_ui_schema.py tests/test_registry_docs.py tests/test_security_audit.py
  • python examples/token_security_scanner_demo.py (offline)

Hosts can tune tax and holder thresholds and gate trades on policy_action without forking the v0.1 risk tiers.
CI requires every examples script to be in the offline smoke list.

@rosspeili rosspeili left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic upgrade @Hendobox! 🚀


Tip

Process Reminder regarding PR Templates for next time:
The PR body content is great and thorough, but please remember to use the official repository template (.github/PULL_REQUEST_TEMPLATE.md) rather than crafting custom headings, this helps conformity and audit logs.

Best practice: While AI agents can write, commit, and push branch code, PRs should ideally be opened and filled manually by contributors. Still, if you want your AI assistant to open or fill the PR description, instruct the agent to populate the standard .github/PULL_REQUEST_TEMPLATE.md checklist and sections verbatim.

I will merge this as is, resolve a changelog minor conflict and commit history in skill doc post merge <3

@rosspeili
rosspeili merged commit d7f721f into ARPAHLS:main Oct 14, 2026
7 checks passed
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.

[Skill Upgrade]: defi/token_security_scanner v0.2 — operator policy profiles, token slug scan, and host policy_action

2 participants