Skip to content

fix(agents): scrub home paths from recorded fixtures - #217

Open
Shruti070107 wants to merge 4 commits into
secfoo-com:mainfrom
Shruti070107:fix/record-agent-home-path-116
Open

Shruti070107 wants to merge 4 commits into
secfoo-com:mainfrom
Shruti070107:fix/record-agent-home-path-116

Conversation

@Shruti070107

Copy link
Copy Markdown
Contributor

Follow-up to the merge comment on #214: keep the recording machine's home directory out of public fixtures.

What changed

  • scripts/record_agent.py now replaces Path.home() with ~ before writing the fixture and before the credential check. It covers raw Windows paths, JSON-escaped paths, the POSIX spellings Copilot prints (/Users/<name>, /home/<name>), and the twice-escaped form that appears inside the JSONL stored in stdout/stderr.
  • Rewrote the four Copilot 1.0.117 recordings so they no longer contain C:\Users\<name> or /Users/<name>.
  • Added tests/test_agents/test_record_agent.py with scrubber unit tests and a regression check that all four fixtures stay free of home paths.

This is only the first follow-up. PR #207 can still be re-recorded with this shared recorder separately; I did not touch that branch here.

Verification

  • python -m pytest -q tests/test_agents/test_record_agent.py tests/test_agents/test_copilot.py tests/test_agents/test_copilot_recordings.py → 20 passed.
  • python -m ruff check . → clean.
  • git diff --check → clean.

The recorder now replaces the operator's home directory with ~ in raw, JSON-escaped, and nested-JSONL forms before writing and before the credential check. Rewrite the four Copilot 1.0.117 recordings so public fixtures no longer contain the recording machine's username.
@Shruti070107
Shruti070107 requested a review from vsn411 as a code owner November 29, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant