Skip to content

feat: ClamAV file scanning for uploaded/downloaded content #91

Description

@aecs4u

Summary

Integrate ClamAV virus scanning for files processed by agent tools (write_file, web_fetch, skill installation) to prevent malware from entering the workspace.

Prior Art

  • AutoGPT integrates ClamAV scanning for all file uploads in its platform — files are scanned via clamd socket before being stored or processed by agent blocks. Infected files are quarantined and the agent is notified.
  • This aligns with RustyClaw's security-first philosophy and complements the existing sandbox isolation.

Motivation

RustyClaw agents can download files from the web (web_fetch), install skills, and write arbitrary files. A compromised or hallucinating agent could inadvertently download malware. ClamAV scanning adds a defense layer that catches known malware signatures before files reach the filesystem.

Proposed Design

  1. Optional integration with clamd daemon via Unix socket or TCP
  2. Scan triggers:
    • web_fetch responses before writing to disk
    • write_file content before writing
    • Skill package files during installation
  3. On detection: quarantine file, log the event (feat: Structured JSONL audit logging with rotation #68), notify user via TUI
  4. Configuration:
    [security.clamav]
    enabled = false
    socket = "/var/run/clamav/clamd.ctl"
    quarantine_dir = "~/.rustyclaw/quarantine"
  5. Feature-gated behind --features clamav to avoid mandatory dependency

Acceptance Criteria

  • ClamAV integration via clamd socket
  • Scanning on file write, web fetch, and skill install
  • Quarantine infected files with audit log entry
  • Feature-gated and optional (graceful degradation when clamd unavailable)
  • Documentation for ClamAV setup

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    ecosystem-analysisFeature identified from cross-project ecosystem analysisenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions