Skip to content

v0.9.6: Brain evolution, autoencoder fix, shield migration, CLI restructure#76

Merged
maiconburn merged 5 commits into
developmentfrom
main
Apr 8, 2026
Merged

v0.9.6: Brain evolution, autoencoder fix, shield migration, CLI restructure#76
maiconburn merged 5 commits into
developmentfrom
main

Conversation

@maiconburn

Copy link
Copy Markdown
Collaborator

Summary

Defender Brain Evolution (Feature 006)

  • Replaced gym-only brain (538KB, 0% agreement) with supervised model (27KB, trained on real production + Caldera data)
  • Added BrainStats: tracks agreement rate per day, weekly trend, persisted to brain-stats.json
  • brain-log.json now includes 72-dim features for offline retraining
  • Spec: .specify/features/006-brain-evolution/spec.md
  • First production agreement: 1/1 (tracking started)

Autoencoder Improvements

  • Retrained with labeled data (clean vs attack traffic separated by decisions)
  • Nightly training now excludes blocked IPs — model only learns from clean traffic
  • Converted from standalone detector (1073 alerts/day) to silent signal that boosts confidence
  • Threshold raised from 0.5 to 0.75

Notification Spam Fixes

  • host_drift: added /lib/, /lib64/, /nix/store/ to trusted paths (was 1500+ FP/day)
  • Telegram: global hourly rate limit (30/hour) via send_alert_html()
  • All 14+ send paths now go through the rate limiter

Shield Migration

  • Migrated innerwarden-shield from standalone daemon to crates/shield/
  • 14 modules, 81 tests, inline in agent via shield_inline.rs
  • Standalone daemon preserved via feature flag

CLI Restructure

  • 40 commands → 8 intent-based groups: get, stream, action, trust, config, system, module, agent
  • All old commands work as hidden aliases (backward compat)
  • innerwarden system (no subcommand) shows available options

Operator IP Protection

  • Dynamic session-based protection (SSH publickey → protected, session ends → expires)
  • 3 auto-block gates now check operator_ips
  • Refreshed every 30s via who -i

Test plan

  • 488 agent tests pass
  • 81 shield tests pass
  • 209 CTL tests pass
  • Brain deployed and tracking agreement on production
  • Autoencoder model retrained with labeled data
  • Notification rate limit verified

🤖 Generated with Claude Code

maiconburn and others added 5 commits April 7, 2026 22:45
Consolidate the DDoS protection module from standalone daemon into the
main workspace, following the same pattern as killchain, dna, hypervisor,
and smm migrations.

Components migrated (14 modules, 81 tests):
- rate_limiter: per-IP adaptive rate limiting (token bucket + sliding window)
- escalation: 4-state machine (Normal → Elevated → UnderAttack → Critical)
- syn_tracker: SYN flood detection via SYN/ACK ratio
- attack_classifier: multi-vector attack classification
- tcp_fingerprint: passive OS fingerprinting
- xdp_manager: BPF blocklist management
- cloudflare_failover: auto DNS proxy toggle on escalation
- origin_lockdown: iptables Cloudflare-only restriction
- bgp_monitor: BGP hijack detection via RIPE Stat
- store: state persistence to JSON
- api: HTTP metrics API (daemon feature only)
- telegram_notify: standalone notifier (daemon feature only)

Agent integration (shield_inline.rs):
- Processes network events through rate limiter inline
- Feeds SYN/ACK tracker and TCP fingerprinter
- Runs escalation state machine on 10s ticks
- Manages XDP blocklist entries
- Writes shield incidents to JSONL
- Notifies via agent's Telegram client
- Persists state every 30s

Config: [shield] section in agent.toml (enabled, bpf_path, dry_run)
Standalone daemon preserved via `daemon` feature flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The nightly autoencoder training was learning from ALL events including
attack traffic, which taught the model that attacks are "normal" and
caused a baseline score of 0.896 (everything = anomaly).

Now loads blocked IPs from decisions-*.jsonl and blocked-ips.txt before
training and skips all events from those IPs. The model only learns
from legitimate traffic patterns.

Before: clean score 0.896, attack score 0.959, 100% FP at threshold 0.5
After:  clean score 0.492, attack score 0.555, 13.7% FP at threshold 0.5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… signal

The autoencoder no longer generates its own incidents (Spider Sense).
Instead it observes silently and stores the latest anomaly score, which
is used to boost confidence in decisions made by other detectors.

Changes:
- narrative_anomaly.rs: removed incident creation, kept observation
  and baseline+autoencoder fusion (two independent sources agreeing)
- incident_decision_eval.rs: added anomaly score boost — when neural
  model flags anomaly > 0.7, confidence is boosted by up to 10%
- AgentState: added latest_anomaly_score field

Effect: zero Spider Sense notifications, but the neural model still
contributes to better decisions when it agrees with a real detector.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BrainLogEntry now includes the full feature vector used for each
decision. This enables training the defender brain from real
production data without simulation.

Also increased brain-log retention from 500 to 10000 entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Step 1+4 of Brain Evolution spec:

- Replace gym-only brain (538KB, 0% agreement) with supervised model
  (27KB, trained on real production data + Caldera attacks)
- Add BrainStats: tracks agreement rate per day, rolling weekly trend
- Persist to brain-stats.json for dashboard consumption
- brain-log.json now includes 72-dim features for offline retraining

Spec: .specify/features/006-brain-evolution/spec.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maiconburn maiconburn merged commit ea4081d into development Apr 8, 2026
7 of 11 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.

1 participant