JuliusBrussee/caveman · error · ValueError

Refusing to compress {filepath}: filename looks sensitive (c

Error message

Refusing to compress {filepath}: filename looks sensitive (credentials, keys, secrets, or known private paths). Compression sends file contents to the Anthropic API. Rename the file if this is a false positive.

What it means

Error "Refusing to compress {filepath}: filename looks sensitive (credentials, keys, secrets, or known private paths). Compression sends file contents to the Anthropic API. Rename the file if this is a false positive." thrown in JuliusBrussee/caveman.

Source

Thrown at plugins/caveman/skills/caveman-compress/scripts/compress.py:291

# ---------- Core Logic ----------


def compress_file(filepath: Path) -> bool:
    # Resolve and validate path
    filepath = filepath.resolve()
    MAX_FILE_SIZE = 500_000  # 500KB
    if not filepath.exists():
        raise FileNotFoundError(f"File not found: {filepath}")
    if filepath.stat().st_size > MAX_FILE_SIZE:
        raise ValueError(f"File too large to compress safely (max 500KB): {filepath}")

    # Refuse files that look like they contain secrets or PII. Compressing ships
    # the raw bytes to the Anthropic API — a third-party boundary — so we fail
    # loudly rather than silently exfiltrate credentials or keys. Override is
    # intentional: the user must rename the file if the heuristic is wrong.
    if is_sensitive_path(filepath):
        raise ValueError(
            f"Refusing to compress {filepath}: filename looks sensitive "
            "(credentials, keys, secrets, or known private paths). "
            "Compression sends file contents to the Anthropic API. "
            "Rename the file if this is a false positive."
        )

    print(f"Processing: {filepath}")

    if not should_compress(filepath):
        print("Skipping (not natural language)")
        return False

    original_text = filepath.read_text(encoding="utf-8", errors="ignore")
    # Store backup outside the source directory so skill auto-loaders don't
    # re-ingest the `.original.md` copy as a live file. Mirror the source's
    # parent-dir name + stem under a platform-aware base to reduce collisions.
    backup_dir = backup_dir_for(filepath)
    backup_path = backup_dir / (filepath.stem + ".original.md")

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. The filename looks sensitive; rename it if it is a false positive, otherwise do not compress it.

When it happens

Trigger: Thrown at plugins/caveman/skills/caveman-compress/scripts/compress.py:291 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/cb594bd90ab01330. Report an issue: GitHub.