Teaching Code Agents to Ask Without Leaking Private Code
Organizations: Singapore Management University · University of Alberta · Alberta Machine Intelligence Institute (Amii) · Columbia University ·
Abstract
Local coding agents can extend their reach by consulting a stronger cloud model. Such consultations, however, often expose the repository's private identifiers, file paths, and source code. Host-side masking hides recognized identifiers but leaves the surrounding code and the agent's phrasing unchanged, while training for less disclosure risks suppressing consultation or producing questions too vague to answer. We propose utility-verified abstraction (UVA), which teaches the agent to describe private entities by their role and type while retaining the technical details an expert needs. From solved repair trajectories, we rewrite each question into this form and keep the rewrite only if it discloses fewer private entities and the repair, replayed from the same execution state with the repair trajectories. Across two benchmarks, the trained agent consults more often than before training. On repository-level issue repair, it solves 37.6% of issues, against 25.3% for the same model working alone, a gain from the training as a whole rather than from consultation alone. Its questions disclose 3.7-fold fewer private entities and 1.4-fold less verbatim code than the untrained agent's questions to the same expert.
Figures & tables
| SWE-bench Verified | Terminal-Bench | ||||||||
| Policy | Ask% | Ask% | |||||||
| Solo (no ask) | 25.3 | 31.4 | 0 | n/a | n/a | 20.2 | 0 | n/a | n/a |
| Natural | 24.6 | 32.4 | 4.8 | 4.42 | 8.4 | 24.7 | 7.9 | 4.18 | 4.0 |
| Privacy prompt | 23.8 | 31.2 | 1.4 | 4.64 | 9.5 | 20.2 | 7.9 | 3.17 | 2.3 |
| Host sanitizer | 25.0 | 28.6 | 4.6 | 0.97 | 6.0 | 22.5 | 5.6 | 0.71 | 3.6 |
| Ours , by cloud expert | |||||||||
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Item | Value |
|---|---|
| Student | Qwen3.5-9B ( Qwen Team, 2026 ) , sampled at temperature with thinking disabled |
| Experts | DeepSeek-V3.2 for every consulting policy; GPT-5.6 Sol and Claude Opus 4.8 for UVA only |
| Teacher | DeepSeek-V3.2, prompted as in Appendix B.2 , temperature , at most output tokens |
| Training tasks | SWE-smith ( Yang et al., 2025 ) , whose source repositories are disjoint from the of SWE-bench Verified |
| Collection | A consultation is forced at step and every steps after it, at most five per rollout, within steps; the reply enters the trajectory and the forcing instruction does not |
| Gate | Eq. 3 with on the detector-only count, the strict reduction, of Eq. 4 , and the replay from the snapshot at |
| Expert | Verified | Terminal-Bench |
|---|---|---|
| None ∗ ( Solo ) | 25.3 | 20.2 |
| None | 36.2 | 24.7 |
| DeepSeek | 37.6 | 29.2 |
| GPT-5.6 | 38.3 | 36.0 |
| Opus 4.8 | 40.6 | 43.8 |
| Natural | Host sanitizer | Ours | |
|---|---|---|---|
| Ask% | |||
| Calls per asking rollout | |||
| Consulting rollouts | |||
| Non-consulting rollouts | |||
| , consulting | |||
| , non-consulting |
| Task | sympy__sympy-20438 , “ is_subset gives wrong results”. One consultation, at step of , after the student has reproduced the failure. |
| Question | The failing test shows that ProductSet and FiniteSet with the same elements are not considered equal (b == c is False but set(b) == set(c) is True). When is_subset is called, it falls back to comparing self.intersect(other) == self, which fails for ProductSet because the intersection returns a FiniteSet . Additionally, the simplify () of Eq(b, c) fails with AttributeError: ’Complement’ object has no attribute ’equals’. What is the structural cause of this issue and how should is_subset be fixed? |
| Disclosure | , all four entities also named by the issue text; . |
| Expert reply | The structural cause is that ProductSet does not implement eq or equals to compare element-wise with FiniteSet […] Immediate step: Override is_subset in ProductSet to compare element containment without relying on intersect . |
| Outcome | The student adds that override to sympy/sets/sets.py and guards the equals call in sympy/core/relational.py , and the tests fail. The reference patch edits sympy/core/relational.py and the set-comparison handlers under sympy/sets/handlers/ , and leaves sets.py untouched. |
AI Coding Agents
AI coding agents use language models and software tools to plan, edit, test, and maintain code with varying levels of autonomy.
See all 326 papers