{"record":{"id":"cb594bd90ab01330","repo":"JuliusBrussee/caveman","slug":"refusing-to-compress-filepath-filename-looks-se","errorCode":null,"errorMessage":"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.","messagePattern":"Refusing to compress (.+?): 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\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"plugins/caveman/skills/caveman-compress/scripts/compress.py","lineNumber":291,"sourceCode":"\n# ---------- Core Logic ----------\n\n\ndef compress_file(filepath: Path) -> bool:\n    # Resolve and validate path\n    filepath = filepath.resolve()\n    MAX_FILE_SIZE = 500_000  # 500KB\n    if not filepath.exists():\n        raise FileNotFoundError(f\"File not found: {filepath}\")\n    if filepath.stat().st_size > MAX_FILE_SIZE:\n        raise ValueError(f\"File too large to compress safely (max 500KB): {filepath}\")\n\n    # Refuse files that look like they contain secrets or PII. Compressing ships\n    # the raw bytes to the Anthropic API — a third-party boundary — so we fail\n    # loudly rather than silently exfiltrate credentials or keys. Override is\n    # intentional: the user must rename the file if the heuristic is wrong.\n    if is_sensitive_path(filepath):\n        raise ValueError(\n            f\"Refusing to compress {filepath}: filename looks sensitive \"\n            \"(credentials, keys, secrets, or known private paths). \"\n            \"Compression sends file contents to the Anthropic API. \"\n            \"Rename the file if this is a false positive.\"\n        )\n\n    print(f\"Processing: {filepath}\")\n\n    if not should_compress(filepath):\n        print(\"Skipping (not natural language)\")\n        return False\n\n    original_text = filepath.read_text(encoding=\"utf-8\", errors=\"ignore\")\n    # Store backup outside the source directory so skill auto-loaders don't\n    # re-ingest the `.original.md` copy as a live file. Mirror the source's\n    # parent-dir name + stem under a platform-aware base to reduce collisions.\n    backup_dir = backup_dir_for(filepath)\n    backup_path = backup_dir / (filepath.stem + \".original.md\")","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/plugins/caveman/skills/caveman-compress/scripts/compress.py#L273-L309","documentation":"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.","triggerScenarios":"Thrown at plugins/caveman/skills/caveman-compress/scripts/compress.py:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The filename looks sensitive; rename it if it is a false positive, otherwise do not compress it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}