@coffre/conformance 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +7 -7
- package/package.json +4 -4
- package/src/checks/mcp.ts +9 -8
package/dist/main.js
CHANGED
|
@@ -1270,7 +1270,7 @@ async function mcpRead(deployment, people, canaries) {
|
|
|
1270
1270
|
const listed = await modern(deployment, access, "tools/list");
|
|
1271
1271
|
const result = listed.body.result;
|
|
1272
1272
|
const names = result?.tools?.map((tool) => tool.name) ?? [];
|
|
1273
|
-
expect(names.includes("list_secrets") && names.includes("run_with_secrets") && result?.cacheScope === "
|
|
1273
|
+
expect(names.includes("list_secrets") && names.includes("run_with_secrets") && !names.includes("admit_member") && result?.cacheScope === "private" && typeof result.ttlMs === "number" && result.ttlMs <= 6e5, "tools/list does not list the reader's tools alone, cached for them only and briefly", listed.body);
|
|
1274
1274
|
const callTool = async (tool, args) => {
|
|
1275
1275
|
const { response, body } = await modern(deployment, access, "tools/call", {
|
|
1276
1276
|
name: tool,
|
|
@@ -1541,8 +1541,8 @@ async function mcpValues(deployment, people, canaries) {
|
|
|
1541
1541
|
};
|
|
1542
1542
|
const dev = valuesIn(canaries, DEV);
|
|
1543
1543
|
const reading = (await redeem(deployment, clientId, await connect(deployment, reader, clientId))).access_token;
|
|
1544
|
-
const stepUp = await call(reading, "
|
|
1545
|
-
expect(stepUp.status === 403 && stepUp.challenge.includes("scope=\"read reveal\""), `
|
|
1544
|
+
const stepUp = await call(reading, "reveal_secret_values", { path: DEV });
|
|
1545
|
+
expect(stepUp.status === 403 && stepUp.challenge.includes("scope=\"read reveal\""), `reveal_secret_values with Read answered ${stepUp.status}, not a step-up`, stepUp.challenge);
|
|
1546
1546
|
const show = await call(reading, "show_secret_value", { secret: `${DEV}/API_KEY` });
|
|
1547
1547
|
const id = show.result?.structuredContent?.approval?.id;
|
|
1548
1548
|
expect(show.result?.structuredContent?.status === "pending" && id !== void 0, "show_secret_value did not open an approval", show.result);
|
|
@@ -1557,10 +1557,10 @@ async function mcpValues(deployment, people, canaries) {
|
|
|
1557
1557
|
const readLeaks = Object.entries(canaries).filter(([, value]) => answers.some((answer) => answer.includes(value))).map(([path]) => path);
|
|
1558
1558
|
expect(readLeaks.length === 0, "a Read answer held a value", readLeaks);
|
|
1559
1559
|
const revealing = (await redeem(deployment, clientId, await connect(deployment, reader, clientId, "read reveal"))).access_token;
|
|
1560
|
-
const read = await call(revealing, "
|
|
1561
|
-
expect(JSON.stringify(read.result?.structuredContent?.values) === JSON.stringify(dev), `
|
|
1562
|
-
expect(read.result?.content?.[0]?.text?.startsWith("These values are now part of this conversation") === true, "
|
|
1563
|
-
const prod = await call(revealing, "
|
|
1560
|
+
const read = await call(revealing, "reveal_secret_values", { path: DEV });
|
|
1561
|
+
expect(JSON.stringify(read.result?.structuredContent?.values) === JSON.stringify(dev), `reveal_secret_values on ${DEV} did not answer its values`);
|
|
1562
|
+
expect(read.result?.content?.[0]?.text?.startsWith("These values are now part of this conversation") === true, "reveal_secret_values does not warn first", read.result?.content);
|
|
1563
|
+
const prod = await call(revealing, "reveal_secret_values", { path: PROD });
|
|
1564
1564
|
expect(prod.result?.isError === true && !JSON.stringify(prod.result).includes(canaries[`${PROD}/API_KEY`]), `the reader read ${PROD} through MCP`, prod.result);
|
|
1565
1565
|
return `Read stepped up for values and showed ${DEV}/API_KEY to ${reader.email} on coffre's page only; Reveal values answered ${DEV}'s values, warning first, and refused ${PROD}`;
|
|
1566
1566
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffre/conformance",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Checks a coffre deployment from outside: what it must never do, whatever code it runs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"jose": "6.2.3",
|
|
33
33
|
"pg": "8.16.3",
|
|
34
|
-
"@coffre/cli": "0.4.
|
|
35
|
-
"@coffre/db": "0.4.
|
|
34
|
+
"@coffre/cli": "0.4.4",
|
|
35
|
+
"@coffre/db": "0.4.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "26.1.1",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"tsdown": "0.23.0",
|
|
42
42
|
"typescript": "5.9.3",
|
|
43
43
|
"vite": "8.1.5",
|
|
44
|
-
"@coffre/client": "0.4.
|
|
44
|
+
"@coffre/client": "0.4.4"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "tsdown",
|
package/src/checks/mcp.ts
CHANGED
|
@@ -262,8 +262,9 @@ export async function mcpRead(deployment: Deployment, people: People, canaries:
|
|
|
262
262
|
const listed = await modern(deployment, access, 'tools/list');
|
|
263
263
|
const result = listed.body.result as { tools?: { name: string; annotations?: { readOnlyHint?: boolean } }[]; cacheScope?: string; ttlMs?: number } | undefined;
|
|
264
264
|
const names = result?.tools?.map((tool) => tool.name) ?? [];
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
// The reader's list: their role's tools, and none of an instance owner's; theirs alone to cache, and not for long, so a role's change shows.
|
|
266
|
+
expect(names.includes('list_secrets') && names.includes('run_with_secrets') && !names.includes('admit_member') && result?.cacheScope === 'private' && typeof result.ttlMs === 'number' && result.ttlMs <= 600_000,
|
|
267
|
+
"tools/list does not list the reader's tools alone, cached for them only and briefly", listed.body);
|
|
267
268
|
const callTool = async (tool: string, args: Record<string, unknown>) => {
|
|
268
269
|
const { response, body } = await modern(deployment, access, 'tools/call', { name: tool, arguments: args }, tool);
|
|
269
270
|
answers.push(JSON.stringify(body));
|
|
@@ -467,8 +468,8 @@ export async function mcpValues(deployment: Deployment, people: People, canaries
|
|
|
467
468
|
|
|
468
469
|
// Read: no value to the model, but one shown to the person on coffre's page.
|
|
469
470
|
const reading = (await redeem(deployment, clientId, await connect(deployment, reader, clientId))).access_token;
|
|
470
|
-
const stepUp = await call(reading, '
|
|
471
|
-
expect(stepUp.status === 403 && stepUp.challenge.includes('scope="read reveal"'), `
|
|
471
|
+
const stepUp = await call(reading, 'reveal_secret_values', { path: DEV });
|
|
472
|
+
expect(stepUp.status === 403 && stepUp.challenge.includes('scope="read reveal"'), `reveal_secret_values with Read answered ${stepUp.status}, not a step-up`, stepUp.challenge);
|
|
472
473
|
const show = await call(reading, 'show_secret_value', { secret: `${DEV}/API_KEY` });
|
|
473
474
|
const id = show.result?.structuredContent?.approval?.id;
|
|
474
475
|
expect(show.result?.structuredContent?.status === 'pending' && id !== undefined, 'show_secret_value did not open an approval', show.result);
|
|
@@ -483,10 +484,10 @@ export async function mcpValues(deployment: Deployment, people: People, canaries
|
|
|
483
484
|
|
|
484
485
|
// Reveal values: the values the person may read, and no others.
|
|
485
486
|
const revealing = (await redeem(deployment, clientId, await connect(deployment, reader, clientId, 'read reveal'))).access_token;
|
|
486
|
-
const read = await call(revealing, '
|
|
487
|
-
expect(JSON.stringify(read.result?.structuredContent?.values) === JSON.stringify(dev), `
|
|
488
|
-
expect(read.result?.content?.[0]?.text?.startsWith('These values are now part of this conversation') === true, '
|
|
489
|
-
const prod = await call(revealing, '
|
|
487
|
+
const read = await call(revealing, 'reveal_secret_values', { path: DEV });
|
|
488
|
+
expect(JSON.stringify(read.result?.structuredContent?.values) === JSON.stringify(dev), `reveal_secret_values on ${DEV} did not answer its values`);
|
|
489
|
+
expect(read.result?.content?.[0]?.text?.startsWith('These values are now part of this conversation') === true, 'reveal_secret_values does not warn first', read.result?.content);
|
|
490
|
+
const prod = await call(revealing, 'reveal_secret_values', { path: PROD });
|
|
490
491
|
expect(prod.result?.isError === true && !JSON.stringify(prod.result).includes(canaries[`${PROD}/API_KEY`]!), `the reader read ${PROD} through MCP`, prod.result);
|
|
491
492
|
return `Read stepped up for values and showed ${DEV}/API_KEY to ${reader.email} on coffre's page only; Reveal values answered ${DEV}'s values, warning first, and refused ${PROD}`;
|
|
492
493
|
}
|