Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Trailofbits Fickling Analysis Result Serialization

From Leeroopedia
Revision as of 18:09, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Trailofbits_Fickling_Analysis_Result_Serialization.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Security, Reporting, Data_Serialization
Last Updated 2026-02-14 14:00 GMT

Overview

A result formatting mechanism that converts pickle safety analysis findings into structured data formats (dict/JSON and human-readable string) for consumption by downstream tools and human reviewers.

Description

After running safety analysis on a pickle file, the results must be communicated to either humans (via formatted text) or machines (via JSON/dict). Analysis Result Serialization provides two complementary outputs:

  • to_string(): Newline-joined messages for results meeting a minimum severity threshold, suitable for terminal output or log files
  • to_dict(): Structured dictionary with severity name, analysis message text, and detailed per-analysis trigger information, suitable for JSON serialization and API responses

Both methods accept a verbosity parameter that filters results by minimum severity, allowing users to suppress low-priority findings.

Usage

Use this principle when integrating pickle safety scanning into CI/CD pipelines (JSON output for machine parsing), CLI tools (string output for terminal display), or monitoring dashboards (dict output for structured logging).

Theoretical Basis

# Pseudocode: Dual output formatting
def to_string(results, min_severity):
    return "\n".join(
        result.message for result in results
        if result.severity >= min_severity
    )

def to_dict(results, min_severity):
    return {
        "severity": max_severity.name,
        "analysis": to_string(results, min_severity),
        "detailed_results": {r.analysis_name: r.trigger for r in results}
    }

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment