@ory/codex 0.6.1 → 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
@@ -20,16 +20,14 @@ npx @ory/codex install # registers the Ory marketplace + plugin with `codex`
20
20
  npx @ory/codex uninstall # removes both
21
21
  ```
22
22
 
23
- Under the hood the installer runs `codex plugin marketplace add <local-dir>` and `codex plugin add ory-codex@ory`, so the plugin is owned by Codex's plugin system — same as every other Codex marketplace plugin. Skills, slash commands, hooks, and the Ory MCP server are all part of the plugin payload. Re-running `install` is idempotent and refreshes the rendered skills + commands from the latest template.
24
-
25
- Verify the install with Codex's native tooling:
23
+ Then confirm everything landed:
26
24
 
27
25
  ```bash
28
- codex plugin list # shows ory-codex@ory installed + enabled
29
- codex mcp list # shows the bundled `ory` MCP server
30
- codex doctor # surfaces any config or MCP resolvability issues
26
+ npx -y -p @ory/codex ory-codex status
31
27
  ```
32
28
 
29
+ `status` is the single source of truth — it prints configuration, user and agent identity, per-tool permission coverage, plugin + skill registration, and a tail of recent debug logs. Unconfigured fields show inline as `(unset)`.
30
+
33
31
  ## Quickstart (≈ 3 minutes)
34
32
 
35
33
  From any project where you'd like Ory authentication, inside Codex:
@@ -44,13 +42,13 @@ From any project where you'd like Ory authentication, inside Codex:
44
42
 
45
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.
46
44
 
47
- 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:
48
46
 
49
47
  ```bash
50
- export ORY_AUTH_GATE=1
48
+ export ORY_USER_LOGIN=1
51
49
  ```
52
50
 
53
- 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.
54
52
 
55
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.
56
54
 
@@ -109,7 +107,7 @@ Without configuration the plugin still loads cleanly and runs in **pass-through
109
107
 
110
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.
111
109
 
112
- - **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.
113
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.
114
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.
115
113
 
@@ -119,10 +117,10 @@ The plugin is **fail-open** on its own infrastructure failures (network errors,
119
117
 
120
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.
121
119
 
122
- 1. **Turn on the user gate.** In your shell:
120
+ 1. **Turn on user login.** It's off by default. In your shell:
123
121
 
124
122
  ```bash
125
- export ORY_AUTH_GATE=1
123
+ export ORY_USER_LOGIN=1
126
124
  ```
127
125
 
128
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.1",
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.1"
69
+ "@ory/argus": "0.7.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=22"