triton-operator-precision-eval

Warn

Audited by Gen Agent Trust Hub on Sep 20, 2026

Risk Level: MEDIUMDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [DYNAMIC_EXECUTION]: The script examples/generate_layer_norm_report.py and the utility file scripts/test_common.py utilize the eval() function to dynamically resolve PyTorch data types from strings (e.g., eval('torch.' + dtype)). While the current implementation checks the dtype variable against a whitelist of supported strings before execution, the use of eval() for dynamic property access is a risky coding pattern that could allow for arbitrary code execution if the validation logic is bypassed or if malicious strings are introduced into the variable.
  • [INDIRECT_PROMPT_INJECTION]: The generate_report function in examples/generate_layer_norm_report.py captures and writes raw exception messages to the generated report file (specifically result['error'][:100]). Because these error messages can originate from hardware operations or kernel failures that might be influenced by external data or manipulated operators, this creates an injection surface. If an agent subsequently reads these reports, it could be exposed to malicious instructions embedded within the captured error output.
  • Ingestion points: Exception messages captured during the execution of triton_layer_norm and torch_layer_norm in examples/generate_layer_norm_report.py.
  • Boundary markers: None; error messages are written directly into the text blocks of the report.
  • Capability inventory: File writing (open with 'w' mode), execution of Triton kernels via triton.jit, and PyTorch operations on NPU hardware.
  • Sanitization: None; the error message is simply truncated to 100 characters before being written to the report.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 20, 2026, 01:44 PM