Reject oversized reviewed terminal input (#41159)

## Why

Reviewing a shortened `write_stdin` action while sending the complete input could allow unreviewed bytes to reach an escalated terminal.

## What changed

- Require the fully formatted action and approval reason to fit within 8,000 bytes.
- Reject truncated or oversized actions before requesting approval or writing any bytes to the terminal.
- Document the reviewed stdin size limit in the app-server protocol.

## Testing

Add an integration test that uses JSON escaping to push a formatted action over the limit and verifies that it is neither offered for approval nor executed, while a subsequent valid write still succeeds.

GitOrigin-RevId: f6c96a78a65a136366c8119a7d242dfc2ec05fe6
This commit is contained in:
jif authored and copyberry committed 2026-08-27 14:54:13 +00:00
1 parent 453a9bcc69
commit bce96bcb43
6 files changed
+147 -4

No files matched your search

+1 -2
View File
@@ -244,8 +244,7 @@ impl GuardianRejectionCircuitBreaker {
}
}
#[cfg(test)]
use approval_request::format_guardian_action_pretty;
pub(crate) use approval_request::format_guardian_action_pretty;
#[cfg(test)]
use approval_request::guardian_assessment_action;
#[cfg(test)]