egrix 0.1.0

Find leaked credentials and suspicious network destinations in AI agent transcripts. Local, offline, redacted by default.
1
2
3
4
5
6
7
8
9
10
11
12
//! JSON output: the report as it is, minus raw values unless asked for.

use crate::model::Report;
use anyhow::Result;

pub fn render(report: &Report, reveal: bool) -> Result<String> {
    let mut report = report.clone();
    if !reveal {
        report.secrets.iter_mut().for_each(|s| s.value = None);
    }
    Ok(serde_json::to_string_pretty(&report)?)
}