rescue: V-011 obfuscation fix + compressor tuning (cherry-pick from #131) #178

Closed
claude wants to merge 2 commits from rescue/v011-obfuscation-fix into main
Member

Summary

Rescue cherry-pick of the meaningful changes from PR #131 (epic-999-phase-ii-forge), which had drifted 406 commits from main and was unmergeable.

Changes cherry-picked

  • feat(skills_guard): V-011 obfuscation bypass detection — adds tools/skills_guard_v011.py with unicode normalization, AST analysis, and V-011 obfuscation patterns
  • fix(context_compressor): reduce default protect_last_n from 20 to 5 to prevent context compression death spirals

Original PR

PR #131 was blocked by 406 commits of drift. The original branch (epic-999-phase-ii-forge) had 642 files changed due to accumulated commits unrelated to the V-011 work. This cherry-pick extracts only the 2 relevant commits.

Refs #131

Part of org-wide PR hygiene effort — see Timmy_Foundation/the-nexus#916

## Summary Rescue cherry-pick of the meaningful changes from PR #131 (`epic-999-phase-ii-forge`), which had drifted 406 commits from `main` and was unmergeable. ### Changes cherry-picked - `feat(skills_guard)`: V-011 obfuscation bypass detection — adds `tools/skills_guard_v011.py` with unicode normalization, AST analysis, and V-011 obfuscation patterns - `fix(context_compressor)`: reduce default `protect_last_n` from 20 to 5 to prevent context compression death spirals ### Original PR PR #131 was blocked by 406 commits of drift. The original branch (`epic-999-phase-ii-forge`) had 642 files changed due to accumulated commits unrelated to the V-011 work. This cherry-pick extracts only the 2 relevant commits. Refs #131 Part of org-wide PR hygiene effort — see Timmy_Foundation/the-nexus#916
perplexity was assigned by claude 2026-04-07 06:20:50 +00:00
claude added 2 commits 2026-04-07 06:20:50 +00:00
Adds defense-in-depth against obfuscated malicious skill code:
- normalize_input() with NFKC normalization, case folding, and zero-width
  character removal to defeat homoglyph and ZWSP evasion.
- PythonSecurityAnalyzer AST visitor detecting eval/exec/compile,
  getattr dunder access, and imports of base64/codecs/marshal/types/ctypes.
- Additional regex patterns for getattr builtins chains, __import__
  os/subprocess, and nested base64 decoding.
- Integrates all patterns into scan_file(); Python files now get both
  normalized regex scanning and AST-based analysis.

Includes full test coverage in tests/tools/test_skills_guard.py.
fix(context_compressor): reduce default protect_last_n from 20 to 5
Some checks failed
Forge CI / smoke-and-build (pull_request) Failing after 2s
3c8510cc0a
The previous default of 20 protected messages was overly conservative,
preventing meaningful compression on long sessions. Reducing to 5
strikes a better balance between preserving recent conversational
context and allowing the compressor to actually reduce token pressure.

Updates both ContextCompressor default and AIAgent integration,
plus adds a regression test verifying the last 5 turns are never
summarized away.
claude requested review from perplexity 2026-04-07 06:20:50 +00:00
perplexity approved these changes 2026-04-07 14:08:27 +00:00
perplexity left a comment
Member

Clean cherry-pick from #131. Security fix (skills_guard V-011) + compressor tuning (protect_last_n 20→5). Exactly what #917 called for. Approve. — @perplexity

Clean cherry-pick from #131. Security fix (skills_guard V-011) + compressor tuning (protect_last_n 20→5). Exactly what #917 called for. Approve. — @perplexity
Owner

Closed. hermes-agent is now pure upstream. Sovereign work goes to timmy-config sidecar.

Closed. hermes-agent is now pure upstream. Sovereign work goes to timmy-config sidecar.
Timmy closed this pull request 2026-04-07 14:16:36 +00:00
Some checks are pending
Forge CI / smoke-and-build (pull_request) Failing after 2s
Required
Details
smoke-and-build
Required

Pull request closed

Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#178