@ory/codex 0.6.2 → 0.7.0

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/README.md CHANGED
@@ -42,13 +42,13 @@ From any project where you'd like Ory authentication, inside Codex:
42
42
 
43
43
  3. **Sign in.** Start your app, visit the login page Codex added, and sign in with the seeded credentials. You now have a real Ory session backed by a real Ory stack — locally, offline, with zero configuration.
44
44
 
45
- 4. **Turn on Ory login for the Codex session itself.** *(Optional but recommended.)* Out of the box the plugin only governs your *app*. To also attach an Ory identity to *Codex's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — set:
45
+ 4. **Turn on Ory login for the Codex session itself.** *(Optional but recommended.)* Out of the box the plugin only governs your *app*. To also attach an Ory identity to *Codex's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — opt in to the user-login flow:
46
46
 
47
47
  ```bash
48
- export ORY_AUTH_GATE=1
48
+ export ORY_USER_LOGIN=1
49
49
  ```
50
50
 
51
- Then restart Codex. On next session start, Codex opens an Ory login in your browser; sign in with the same seeded credentials from step 1. This is what makes `permissions enforce` (see [Agent security](#agent-security)) deny on the right identity later.
51
+ User login is off by default. With it on, the next Codex session opens an Ory login in your browser; sign in with the same seeded credentials from step 1, and the token is reused on subsequent sessions until it expires. This is what makes `permissions enforce` (see [Agent security](#agent-security)) deny on the right identity later.
52
52
 
53
53
  That's the full Ory DX path. Stop here if you're just evaluating the plugin. Continue to [Agent security](#agent-security) when you're ready to enforce.
54
54
 
@@ -107,7 +107,7 @@ Without configuration the plugin still loads cleanly and runs in **pass-through
107
107
 
108
108
  Once the plugin is pointed at an Ory project (local or hosted), Codex's session and every tool call can be governed by Ory.
109
109
 
110
- - **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `ORY_AUTH_GATE=1` is set. The Codex process (the **agent**) gets its own OAuth2 identity, self-registered via [Dynamic Client Registration (RFC 7591)](https://datatracker.ietf.org/doc/html/rfc7591) on first run.
110
+ - **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when user login is enabled (`ORY_USER_LOGIN=1`, off by default — browser PKCE flow on first session, persisted token thereafter). The Codex process (the **agent**) gets its own OAuth2 identity, self-registered via [Dynamic Client Registration (RFC 7591)](https://datatracker.ietf.org/doc/html/rfc7591) on first run.
111
111
  - **Authorization.** Before any tool runs, the plugin checks [Ory Permissions](https://www.ory.com/docs/keto) (Zanzibar-style relation tuples) against the user's subject and blocks the call on `deny`. MCP tool calls additionally get a server-level check.
112
112
  - **Audit.** Every decision (allow, deny, fallback) is recorded as a structured trace span: NDJSON file output and/or OTLP/HTTP export to Jaeger, Honeycomb, Grafana, and similar collectors. The user → agent delegation is written to Ory as a relation tuple so *"agent X acting on behalf of user Y"* stays queryable after tokens expire.
113
113
 
@@ -117,10 +117,10 @@ The plugin is **fail-open** on its own infrastructure failures (network errors,
117
117
 
118
118
  After install the plugin runs in **observe mode**: every tool call is checked against Ory Permissions, but a deny is recorded as a `permission.observe_deny` audit span and the tool runs anyway. This lets you see what *would* be blocked before turning on hard blocking.
119
119
 
120
- 1. **Turn on the user gate.** In your shell:
120
+ 1. **Turn on user login.** It's off by default. In your shell:
121
121
 
122
122
  ```bash
123
- export ORY_AUTH_GATE=1
123
+ export ORY_USER_LOGIN=1
124
124
  ```
125
125
 
126
126
  The next Codex session opens a browser for PKCE login. Subsequent sessions reuse the persisted token until it expires.
package/dist/cli/setup.js CHANGED
@@ -257,8 +257,8 @@ function printNextSteps() {
257
257
  console.log("");
258
258
  console.log(" 2. Or spin up the local Ory stack from inside Codex (`/skills` -> `ory-local-up`).");
259
259
  console.log("");
260
- console.log(" 3. Turn on the interactive user login gate (opt-in):");
261
- console.log(" export ORY_AUTH_GATE=1");
260
+ console.log(" 3. Turn on the interactive user login (opt-in):");
261
+ console.log(" export ORY_USER_LOGIN=1");
262
262
  console.log(" Without this, Codex runs without a human Ory identity attached to the");
263
263
  console.log(" session and permission checks fall back to a session:<id> subject.");
264
264
  console.log("");
@@ -1,8 +1,8 @@
1
1
  import { OryAgentClient, ensureUserAuthenticated, ensureAgentIdentity } from "@ory/argus";
2
2
  import type { CodexHookInput, CodexHookOutput } from "./types.js";
3
3
  export interface HandleHookEventDeps {
4
- /** Test injection point for the user auth gate. */
5
- authGate?: typeof ensureUserAuthenticated;
4
+ /** Test injection point for the user login flow. */
5
+ userLogin?: typeof ensureUserAuthenticated;
6
6
  /** Test injection point for the agent identity gate. */
7
7
  agentGate?: typeof ensureAgentIdentity;
8
8
  }
package/dist/handlers.js CHANGED
@@ -58,7 +58,7 @@ async function handleSessionStart(input, client, deps) {
58
58
  client.tracer.record("session.start", "ok", {
59
59
  attributes: { model: input.model },
60
60
  });
61
- const userGate = deps.authGate ?? argus_1.ensureUserAuthenticated;
61
+ const userGate = deps.userLogin ?? argus_1.ensureUserAuthenticated;
62
62
  const decision = await userGate(client, {
63
63
  binName: "ory-codex",
64
64
  harness: "codex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/codex",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
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.6.2"
69
+ "@ory/argus": "0.7.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=22"