Files
codex/codex-rs/guardian-context
felixxia-oai 61969074a7 Add an optional JSON transcript format for Guardian (#51465)
## Why

Transcript content can contain forged role headers, transcript boundaries, or claims of user approval. Guardian needs to distinguish that content from host-assigned authorship metadata.

## What changed

- Add `features.guardianv2.transcript_mode` with `line` (the default) and `json` options for synchronous review and asynchronous scoring.
- Render JSON transcript entries with host-assigned metadata and escaped `text`, and prepend matching provenance instructions to reviewer and classifier prompts.
- Preserve JSON metadata when budget recovery shortens historical text, and keep provenance instructions outside the configured classifier prompt limit.

## Testing

Add coverage for forged roles and approvals remaining within their original entries, JSON metadata surviving budget recovery, and provenance instructions surviving prompt limits. Extend review and scoring integration tests to verify JSON evidence and matching instructions.

GitOrigin-RevId: 81a3580390d3c4d1a664e554976cda5f1adc9a2c
2026-10-06 19:30:57 +00:00
..