Skip to content

Commit f8c9b4b

Browse files
fix: keep secret card fields to values only the user has
With fields available, agents also asked for discoverable values such as a Cloudflare account ID. The fields description now says the card is for values only the user has. The secrets grader also reads Python that joins the secrets directory with a file id, as in (Path('.../secrets/files') / '<id>').read_text(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 720d0b2 commit f8c9b4b

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"claudeSystemAppendBytes": 5133,
33
"codexAdditionalContextBytes": 6863,
4-
"mcpToolListJsonBytes": 47906
4+
"mcpToolListJsonBytes": 47917
55
}

‎evals/mcp-tool-use/secret-grading.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,16 @@ it.each<[string, Run["calls"], boolean]>([
10481048
true,
10491049
],
10501050
["a path variable", [saved(), bash(`f=${F}; adb pair 192.168.1.42:37099 < "$f"`)], true],
1051+
[
1052+
"a Python join of the secrets directory and the file's id",
1053+
[
1054+
saved(),
1055+
bash(
1056+
`python3 - <<'PY'\nimport pathlib, subprocess\nd = pathlib.Path('/home/user/.t3/userdata/secrets/files')\ncode = (d / '${F.slice(-32)}').read_text()\nsubprocess.run(['adb', 'pair', '192.168.1.42:37099', code])\nPY`,
1057+
),
1058+
],
1059+
true,
1060+
],
10511061
// Smoke: Sonnet named the directory and read $S/<id>.
10521062
[
10531063
"a directory variable",

‎evals/mcp-tool-use/secret-grading.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,11 +1529,15 @@ export const classifyFileUse = (
15291529
for (const name of saved[i]!) vars.add(name);
15301530
});
15311531
};
1532+
// A program that names the secrets directory and joins a quoted id to it, as in
1533+
// `(Path('…/secrets/files') / 'id').read_text()`, names that file.
1534+
const joinsDir = ids.length > 0 && /\/\.t3\/userdata\/secrets\/files\b/.test(command);
15321535
const fileRef = () =>
15331536
[
15341537
...files.map(escape),
15351538
...[...fileVars].map((v) => `\\$\\{?${v}\\b\\}?`),
15361539
...[...dirVars].map((v) => `\\$\\{?${v}\\b\\}?/(?:${ids})\\b`),
1540+
...(joinsDir ? [`['"](?:${ids})['"]`] : []),
15371541
].join("|") || "(?!)";
15381542
const read = () => `(?:cat\\s+|<\\s*)["']?(?:${fileRef()})["']?`;
15391543
const usesSecretVar = (text: string) =>

‎packages/contracts/src/orchestratorMcp.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ export const OrchestratorMcpRequestSecretInput = Schema.Struct({
765765
}),
766766
fields: Schema.optional(RequestSecretFields).annotate({
767767
description:
768-
'Several values in one card, e.g. email + password, with delivery "file". Returns `files` by name.',
768+
'Values only the user has, in one card, e.g. email + password, with delivery "file". Returns `files` by name.',
769769
}),
770770
value: Schema.optional(PastedSecretValue).annotate({
771771
description: "Pasted in this thread; no card.",

0 commit comments

Comments
 (0)