Files
cowork-local/security/attachment_validator.py
T
2026-08-09 20:12:05 +07:00

11 lines
408 B
Python

"""Attachment validator — inspects attached files for security risks."""
from __future__ import annotations
from .command_risk_classifier import classify_attachment
ATTACHMENT_DENIED_MESSAGE = "Attached content failed security validation."
def validate_attachment(path: str, mime_type: str = "") -> bool:
result = classify_attachment(path, mime_type or None)
return not result.blocked