Skip to content

Isolate problem IDs from agent runtime artifacts - #909

Merged
munimthahmid merged 2 commits into
mainfrom
fix/problem-id-isolation
Jun 25, 2026
Merged

munimthahmid merged 2 commits into
mainfrom
fix/problem-id-isolation

Conversation

@munimthahmid

Copy link
Copy Markdown
Collaborator

Fixes #905

This patch prevents evaluated agents from seeing the real benchmark problem ID during a run.

Changes:

  • Replaces the real problem ID with an opaque ID such as anon_... during agent execution.
  • Stores live artifacts under a temporary .runtime/.../anon_... path.
  • Creates the real semantic result path only after the agent has stopped.
  • Restores the real problem ID in final artifact filenames and structured CSV/JSON fields.
  • Before publishing, verifies that temporary artifacts do not contain the real problem ID. If they do, publication fails and the artifacts are retained for investigation.
  • Repairs container-created file ownership before publishing so the host can process the results.

Validation:

  • Ran end-to-end canaries on Claude Code and Codex.
  • The real problem ID was absent from the live agent environment, /logs path, driver logs, and session artifacts.
  • Final semantic CSV/JSON outputs contained the real problem ID as expected.

Another potential issue I noticed

  • Mounting the full host ~/.codex directory into agent containers may expose historical sessions, logs, previous problem IDs etc. It is currently mounted for every agent, not only Codex. For Codex subscription authentication, we could instead create a private per-run Codex home containing only a copy of auth.json, mount it only into the Codex container, securely preserve any refreshed credentials if necessary, and remove the temporary directory after the run. API-key-based Codex runs and other agents would not need this mount.

/validate-problem skip

@munimthahmid
munimthahmid requested a review from Saadmrp1038 June 24, 2026 22:51
@tianyin
tianyin self-requested a review June 24, 2026 23:27
@tianyin

tianyin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This is a very important and timely fix! Thank you @munimthahmid !

I skim the code and it looks fine.

And, given that you are the one who reported it, you probably have the right setup to validate it.

Feel free to merge it. I approved.

@tianyin tianyin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tianyin

tianyin commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Another potential issue I noticed

the bigger question is whether there are other side channels but I guess the question is unanswerable and we will have to fix whenever we see.

@tianyin

tianyin commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@munimthahmid Feel free to merge it if you think it's ready.

@Saadmrp1038

Saadmrp1038 commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

@munimthahmid why not use a deterministic string to number conversion? Some kind of cryptography algo maybe.

@munimthahmid
munimthahmid merged commit 4c99425 into main Jun 25, 2026
5 checks passed
@munimthahmid
munimthahmid deleted the fix/problem-id-isolation branch June 25, 2026 06:02
@munimthahmid

Copy link
Copy Markdown
Collaborator Author

@Saadmrp1038 Sorry, I missed the comment before merging :).
The runtime ID doesn’t need to encode the real problem ID because the host already keeps the mapping and restores it after the run. We could use keyed deterministic encryption, but I feel that would add key management without providing a benefit over a fresh random ID.

@Saadmrp1038

Saadmrp1038 commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

I see. That's fine then.

Mounting the full host ~/.codex directory into agent containers may expose historical sessions, logs, previous problem IDs etc.

Can you review this in the tlaps-bench PR please. I was thinking of just copying what we do there :3

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.

Benchmark problem ID leaks into agent container through environment variables and /logs

3 participants