@ory/codex 0.8.1 → 0.8.2

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.
Files changed (2) hide show
  1. package/dist/handlers.js +29 -2
  2. package/package.json +2 -2
package/dist/handlers.js CHANGED
@@ -218,7 +218,18 @@ async function handlePreToolUse(input, client) {
218
218
  };
219
219
  }
220
220
  const namespace = resolveNamespace();
221
- const decision = await (0, argus_1.checkAndDecide)(client, { namespace, object: toolName, relation: "use", ...subject }, { spanAttributes: { toolName } });
221
+ const outcome = await (0, argus_1.gateToolCall)(client, {
222
+ harness: "codex",
223
+ toolName,
224
+ check: { namespace, object: toolName, relation: "use", ...subject },
225
+ spanAttributes: { toolName },
226
+ });
227
+ // Interactive tools (operator-extensible via ORY_INTERACTIVE_TOOLS):
228
+ // pass through with the user.interaction span already recorded.
229
+ if (outcome.kind === "interactive") {
230
+ return {};
231
+ }
232
+ const decision = outcome;
222
233
  if (decision.kind === "fail_open") {
223
234
  return handlePermissionError(decision.error, toolName, client);
224
235
  }
@@ -294,6 +305,13 @@ async function handlePermissionRequest(input, client) {
294
305
  if ((0, argus_1.resolveConfig)().auditOnly) {
295
306
  return permissionRequestFallback("Audit-only mode — deferring to user");
296
307
  }
308
+ // Interactive tools: defer to the user instead of pre-answering.
309
+ if ((0, argus_1.isInteractiveTool)("codex", toolName)) {
310
+ client.tracer.record("user.interaction", "ok", {
311
+ attributes: { harness: "codex", toolName, kind: "permission-request" },
312
+ });
313
+ return permissionRequestFallback("Interactive tool — deferring to user");
314
+ }
297
315
  const subject = (0, argus_1.resolveUserSubject)(client, `session:${input.session_id}`);
298
316
  const subjectId = (0, argus_1.subjectLabel)(subject);
299
317
  const mcpTool = (0, argus_1.parseMcpToolGeneric)(toolName);
@@ -318,7 +336,16 @@ async function handlePermissionRequest(input, client) {
318
336
  : "Ory MCP server permission granted");
319
337
  }
320
338
  const namespace = resolveNamespace();
321
- const decision = await (0, argus_1.checkAndDecide)(client, { namespace, object: toolName, relation: "use", ...subject }, { spanAttributes: { toolName } });
339
+ const outcome = await (0, argus_1.gateToolCall)(client, {
340
+ harness: "codex",
341
+ toolName,
342
+ check: { namespace, object: toolName, relation: "use", ...subject },
343
+ spanAttributes: { toolName },
344
+ });
345
+ if (outcome.kind === "interactive") {
346
+ return permissionRequestFallback("Interactive tool — deferring to user");
347
+ }
348
+ const decision = outcome;
322
349
  if (decision.kind === "fail_open") {
323
350
  const code = decision.error.code;
324
351
  const reason = code === "network_error" || code === "rate_limited"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/codex",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Ory plugin for Codex: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://ory.com",
@@ -66,7 +66,7 @@
66
66
  "marketplace"
67
67
  ],
68
68
  "dependencies": {
69
- "@ory/argus": "0.8.1"
69
+ "@ory/argus": "0.8.2"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=22"