Skip to content

classify

fialr classify <target> [options]

Classify each file into a sensitivity tier and suggest a category. Classification uses structural signals only — filename patterns, extensions, directory heuristics, and MIME type. File content is never read during classification.


ArgumentDescription
targetDirectory to classify (required)
OptionDescription
-o, --output PATHWrite classifications JSON to this path
--sensitivity-rules PATHPath to sensitivity.yaml (default: config/sensitivity.yaml)

classify runs a scan first (identical to fialr scan), then applies sensitivity rules from sensitivity.yaml to assign each file a tier:

TierLabelMeaning
1RESTRICTEDNo AI access. Manual operations only. Encrypted vault.
2SENSITIVELocal LLM on extracted text. Human confirmation required.
3INTERNALFull local enrichment. Automated above confidence threshold.

Tier assignment is rule-based. Rules match against path patterns, filename patterns, and file extensions. Tier 1 rules are evaluated first; if no Tier 1 or Tier 2 rule matches, the file defaults to Tier 3.

Each file also receives a category suggestion (e.g., financial, legal, medical, technical, media). Categories are defined in sensitivity.yaml and matched by the same structural signals. The category determines the destination directory during planning.

Every file classified as Tier 1 is added to the review queue. Tier 1 files are never processed automatically by any subsequent command. They require manual review and confirmation before any operation.


To stderr:

classify ~/Documents
SCAN 847 files (2.3s)
CLASSIFY 847 files (0.1s)
────────────────────────────────────────────────────────
tier 1 12 RESTRICTED
tier 2 89 SENSITIVE
tier 3 746 INTERNAL
total 2.4s

When --output is specified, the full classification results are written as JSON — one entry per file with sensitivity tier, category, reason, and review flag.


Terminal window
# Classify a directory
fialr classify ~/Documents
# Write classification results to file
fialr classify ~/Documents -o classifications.json
# Use custom sensitivity rules
fialr classify ~/Documents --sensitivity-rules ./my-rules.yaml