Skip to main content

Using the Export

Two practical ways to work with the exported data: building fine-tuning datasets and auditing compliance violations.

Supervised Fine-Tuning Dataset

Filter executions.jsonl for high-quality conversations and reformat them for your training pipeline:

Example
import json
with open("executions.jsonl") as f:
executions = [json.loads(line) for line in f if line.strip()]
def passed(report, dimension):
"""True only if every scored turn for this dimension passed."""
decisions = [o["decision"] for o in report.get("outcomes", [])
if o["type"] == dimension and o["decision"] is not None]
return bool(decisions) and all(decisions)
dataset = []
for e in executions:
report = e.get("report") or {}
if (
passed(report, "completion")
and passed(report, "validity")
and passed(report, "factuality")
and e.get("conversation")
):
dataset.append({
"messages": [
{"role": m["role"], "content": m["content"]}
for m in e["conversation"]
]
})
with open("sft_dataset.jsonl", "w") as out:
out.writelines(json.dumps(row) + "\n" for row in dataset)

Offline Compliance Analysis

Combine the principles and report fields to identify which principles were violated and at what severity:

Example
import json
with open("executions.jsonl") as f:
executions = [json.loads(line) for line in f if line.strip()]
for e in executions:
report = e.get("report") or {}
# Worst compliance severity across all turns (0 = no violation).
severity = max(
(o.get("severity", 0) for o in report.get("outcomes", [])
if o["type"] == "compliance"),
default=0,
)
if severity > 0:
print(f"Execution {e['id']}, severity {severity}")
# Drill into per-principle assessments for the offending turns.
for c in report.get("classifications", []):
if c["type"] != "compliance":
continue
for a in c.get("assessments", []):
if not a["decision"]:
print(f" Principle {a['principle_id']}: {a['explanation']}")