Security and Diagnostics

MarkCharm Team

September 8, 2026

1 Security Features

MarkCharm includes built-in security mechanisms to protect against common document compilation risks.

1.1 Safe Mode

The --safe flag blocks:

1.2 Diagnostic System

The compiler emits structured diagnostics following the MCE-* (errors) and MCW-* (warnings) code system.

1.2.1 Common Diagnostic Codes

Code Severity Description
MCE-FIG-001 Error Figure source file not found
MCE-REF-001 Error Undefined cross-reference target
MCW-REF-002 Warning Numeric ref used on unnumbered target
MCW-SYN-002 Warning LaTeX hallucination detected
MCW-FIG-001 Warning Captioned block missing reference anchor
MCW-SEC-001 Warning Media path escapes document directory

1.3 Validation Workflow

To validate a document without compiling:

markcharm main.mc --check --error-format llm

To validate an entire directory:

markcharm check-dir . --error-format llm

To explain a specific diagnostic code:

markcharm explain MCE-FIG-001

1.4 Content Redaction

The \censor{} command redacts sensitive content, replacing it with a black bar in the output while preserving the original text in the source file.