Stop leaking absolute artifact paths in chain API responses - #16
Open
Lvvphole wants to merge 1 commit into
Open
Conversation
HandlerResult.artifacts_created (and evidence_refs) are populated with
Artifact.path — an absolute host filesystem path — which surfaced through
GET /runs/{id}/chain/results and POST /runs/{id}/chain/execute, exposing
server filesystem layout to API callers.
Strip those path-bearing handler fields from the chain API responses via a
small _result_response() serializer used by both endpoints. The internal
runs.snapshot keeps the full result for audit, and (once evidence
persistence lands) the evidence_artifacts table is the durable artifact
record. No authority change: this only narrows output — no merge/deploy/
bypass surface is added.
Test: the execute and results responses contain neither the artifacts_root
path nor the artifacts_created/evidence_refs keys.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015R7wjqoCZDF1pqNp8AiUJ6
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.
Problem
HandlerResult.artifacts_created(andevidence_refs) are populated withArtifact.path— an absolute host filesystem path (e.g./tmp/.../art/run-x/run-x-a1/repo_tree.log). Those fields surface throughPOST /runs/{id}/chain/executeandGET /runs/{id}/chain/results, exposing server filesystem layout to API callers. This is the same information-disclosure class as the earlierworkspace_idfix, in a different field.It's pre-existing (predates Epic 6) and was surfaced while writing the evidence-persistence tests — kept as its own focused PR rather than folded into the Epic 6 work.
Fix
Strip the path-bearing handler fields from the two chain API responses via a small
_result_response()serializer used by both endpoints:runs.snapshotstill stores the full result for audit. (When evidence persistence lands, theevidence_artifactstable is the durable artifact record.)ChainExecutionResult(verified —routes_runs.pyexposes neitherchain_execution_resultnorhandler_results).final_status,verifier_decision,gate_results, etc. are unaffected.Tests (274 passed, 9 skipped — Postgres-gated)
New
test_api_responses_do_not_leak_artifact_paths: the execute and results responses contain neither theartifacts_rootpath nor theartifacts_created/evidence_refskeys. No existing test relied on those fields being exposed.🤖 Generated with Claude Code
Generated by Claude Code