fix: persist bounded execute_code result bodies - #77
Open
Tom-StrategicAutomation wants to merge 1 commit into
Open
fix: persist bounded execute_code result bodies#77Tom-StrategicAutomation wants to merge 1 commit into
Tom-StrategicAutomation wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resultrecord in each completedexecute_codeaudit manifest.32768bytes), reusing the executor's existingPREVIEW_BYTESbudget so audit bodies cannot grow without limit.The additive manifest structure is:
{ "result": { "parsed_as_json": true, "representation_type": "json", "original_size_bytes": 123, "stored_size_bytes": 101, "max_stored_size_bytes": 32768, "truncated": false, "value": "..." } }JSON values are canonicalized with sorted keys and compact, ASCII-safe encoding. Non-JSON output remains text. Redaction runs before deterministic UTF-8 truncation, and no unbounded raw result is copied elsewhere in the manifest.
Redaction policy
password,passwd,secret,token,access_token,refresh_token,api_key,apikey,authorization,cookie,set-cookie, andprivate_key.:/=assignments.sk-, GitHubgh*_, and Slackxox*-token forms.Integrity
Tests
uv run pytest -q tests/guard/gates/test_terminal_policy.py -k execute_code— 29 passed, 66 deselected in 4.31s.uv run pytest— 496 passed in 57.58s.uv run ruff check .— All checks passed.uv run ruff format --check .— 106 files already formatted.uv run python scripts/violin_guard.py check-release— all release checks passed, including its internal Ruff and test-suite gates.git diff --checkandgit diff --check dev...HEAD— passed.All Python verification ran on Linux in the official
ghcr.io/astral-sh/uv:python3.11-trixie-slimcontainer.Closes #12