## TL;DR

Huge SARIF reports overflow the agent's context. Do not feed the raw report; aggregate it into counts by rule and path, then give the agent the summary plus samples.

## Error

```text
agent failed to parse the gitleaks report: sarif too large, context overflow error
```

## Steps

1. Confirm size is the issue: the report parses fine with tools but not in context. Expected: size, not corruption.
2. Aggregate the SARIF into a compact summary: findings per rule, per path, top examples. Expected: a summary that fits.
3. Feed the agent the summary plus a bounded sample of full findings. Expected: the agent can reason.
4. Let the agent request specific slices (one rule, one directory) on demand. Expected: drill-down without overload.
5. Stream future reports through the summarizer by default. Expected: no more overflows.

## When to use

- Agents choking on large SARIF reports.
- Building report-consuming agents.

## When not to use

- Malformed SARIF (fix the report).
- Small reports (feed directly).

## Tool compatibility

- SARIF reports; summarization pipelines.

## Variant phrasings

### sarif too large for agent

Summarize first.

### context overflow on report

Aggregate.

## Why it happens

SARIF is verbose; a large repo's full report is megabytes, far beyond context windows.

## Edge cases

- Summaries must preserve enough detail to act; counts alone are not triageable.
- Sampling must be deterministic for reproducible runs.
- The full report stays on disk for the agent to query by slice.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_yDH_HSYfpRyjtSCPhpKmtg
