app.enrich() in your evals file:
Return type
Enrichments return a flat key-value map:Context
Enrichments receive the sameEvalContext as evals:
| Field | Type | Description |
|---|---|---|
entries | object[] | Raw JSONL entries (session + subagents) |
stats | EvalLogStats | Computed stats |
projectName | string | Project name |
sessionId | string | Session ID |
source | string | "session" or "agent-{id}" |
Examples
Session overview
Token and cost breakdown
Conditional enrichment
Usecondition to skip an enrichment when it doesn’t apply. Skipped enrichments show as “skipped” in the UI.
Subagent metadata
Options
| Option | Type | Default | Description |
|---|---|---|---|
condition | ConditionFunction | - | Per-enrichment gate. Returns false → skipped. Throws → errored. |
scope | 'session' | 'subagent' | 'both' | 'session' | Whether to run at session level, subagent level, or both |
subagentType | string | - | Only run for subagents of this type (e.g. 'Explore') |

