latex-defense-zh

Pass

Audited by Gen Agent Trust Hub on Sep 29, 2026

Risk Level: SAFECOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill uses subprocess.run in scripts/build_deck.py to execute latexmk for compiling the generated Beamer slides into a PDF. The execution is restricted to a specific set of hardcoded arguments and targets a file generated by the script itself, significantly reducing the risk of arbitrary command injection.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted data from external LaTeX repositories (PhD/Master thesis files), which represents a potential injection vector.
  • Ingestion points: The skill ingests untrusted .tex and .aux files from a user-provided thesis directory via scripts/extract_thesis.py and scripts/tex_loader.py.
  • Boundary markers: The SKILL.md file contains a 'Safety Boundaries' section that explicitly instructs the agent to treat all thesis content as untrusted and to ignore any embedded instructions or prompts.
  • Capability inventory: The skill has the capability to write files to the local file system and execute LaTeX compilation commands using the uv run toolchain.
  • Sanitization: The scripts/build_deck.py script implements a tex_escape function that sanitizes text fields by escaping LaTeX special characters (e.g., \, {, }, $, &, #, %, _, ~, ^) before they are rendered into the final .tex template, preventing unintended command execution within the LaTeX environment.
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 29, 2026, 02:22 AM