@ory/claude-code 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,19 +20,24 @@ Inside Claude Code:
20
20
  /plugin install ory-agent-plugin@ory
21
21
  ```
22
22
 
23
- Skills, slash commands, hooks, and the Ory MCP server are now registered. Verify with `/plugin list`.
23
+ Then confirm everything landed:
24
+
25
+ ```bash
26
+ npx -y -p @ory/claude-code ory-claude status
27
+ ```
28
+
29
+ `status` is the single source of truth — it prints configuration, user and agent identity, per-tool permission coverage, hook + skill registration, and a tail of recent debug logs. Unconfigured fields show inline as `(unset)`.
24
30
 
25
31
  <details>
26
32
  <summary>Alternative install path (no Claude Code session required)</summary>
27
33
 
28
34
  ```bash
29
- # Direct installer — registers the marketplace and installs the plugin via the claude CLI.
30
35
  npx -y -p @ory/claude-code ory-claude install # current project
31
36
  npx -y -p @ory/claude-code ory-claude install --global # all projects (user scope)
32
37
  npx -y -p @ory/claude-code ory-claude uninstall
33
38
  ```
34
39
 
35
- The installer requires the `claude` CLI on `PATH`. After it finishes, run `ory-claude status` to confirm the plugin is registered.
40
+ The installer requires the `claude` CLI on `PATH`.
36
41
 
37
42
  </details>
38
43
 
@@ -52,13 +57,13 @@ From any project where you'd like Ory authentication, inside Claude Code:
52
57
 
53
58
  3. **Sign in.** Start your app, visit the login page Claude 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.
54
59
 
55
- 4. **Turn on Ory login for the Claude session itself.** *(Optional but recommended.)* Out of the box the plugin only governs your *app*. To also attach an Ory identity to *Claude's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — set:
60
+ 4. **Turn on Ory login for the Claude session itself.** *(Optional but recommended.)* Out of the box the plugin only governs your *app*. To also attach an Ory identity to *Claude's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — opt in to the user-login flow:
56
61
 
57
62
  ```bash
58
- export ORY_AUTH_GATE=1
63
+ export ORY_USER_LOGIN=1
59
64
  ```
60
65
 
61
- Then restart Claude. On next session start, Claude 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.
66
+ User login is off by default. With it on, the next Claude 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.
62
67
 
63
68
  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.
64
69
 
@@ -114,7 +119,7 @@ Without any configuration the plugin still loads cleanly and runs in **pass-thro
114
119
 
115
120
  Once the plugin is pointed at an Ory project (local or hosted), Claude's session and every tool call can be governed by Ory.
116
121
 
117
- - **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `ORY_AUTH_GATE=1` is set. The Claude 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. Sub-agents launched by the `Task` tool each receive their own typed identity.
122
+ - **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 Claude 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. Sub-agents launched by the `Task` tool each receive their own typed identity.
118
123
  - **Authorization.** Before any tool runs, the plugin checks [Ory Permissions](https://www.ory.sh/docs/keto) (Zanzibar-style relations) against the user's subject and blocks the call on `deny`. MCP tool calls additionally get a server-level check.
119
124
  - **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 (and agent → subagent) delegation chain is written to Ory as relations so *"agent X acting on behalf of user Y"* stays queryable after tokens expire.
120
125
 
@@ -124,10 +129,10 @@ The plugin is **fail-open** on its own infrastructure failures (network errors,
124
129
 
125
130
  With an Ory project configured, the plugin runs in **observe mode** by default: every tool call is checked against Ory Permissions, 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. (Without a project configured, the plugin is in pass-through mode — no checks run at all.)
126
131
 
127
- 1. **Turn on the user gate.** In your shell:
132
+ 1. **Turn on user login.** It's off by default. In your shell:
128
133
 
129
134
  ```bash
130
- export ORY_AUTH_GATE=1
135
+ export ORY_USER_LOGIN=1
131
136
  ```
132
137
 
133
138
  The next Claude session opens a browser for PKCE login. Subsequent sessions reuse the persisted token until it expires.
@@ -1,8 +1,8 @@
1
1
  import { OryAgentClient, ensureUserAuthenticated, ensureAgentIdentity, ensureSubAgentIdentity } from "@ory/argus";
2
2
  import type { ClaudeCodeHookInput, ClaudeCodeHookOutput } 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
  /** Test injection point for the sub-agent identity resolver. */
package/dist/handlers.js CHANGED
@@ -60,10 +60,10 @@ async function handleSessionStart(input, client, deps) {
60
60
  client.tracer.record("session.start", "ok", {
61
61
  attributes: { model: input.model, source: input.source },
62
62
  });
63
- // Run the user auth gate (interactive PKCE on first session, refresh
64
- // when needed). When ORY_AUTH_GATE is unset this is a no-op and we
63
+ // Run the user login (interactive PKCE on first session, refresh
64
+ // when needed). When ORY_USER_LOGIN is unset this is a no-op and we
65
65
  // fall through to the legacy verify path below.
66
- const userGate = deps.authGate ?? argus_1.ensureUserAuthenticated;
66
+ const userGate = deps.userLogin ?? argus_1.ensureUserAuthenticated;
67
67
  const decision = await userGate(client, {
68
68
  binName: "ory-claude",
69
69
  harness: "claude-code",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/claude-code",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "Ory plugin for Claude Code: 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://github.com/ory/claude-plugins/tree/master/plugins/ory-agent-plugin",
@@ -75,7 +75,7 @@
75
75
  "!dist/**/*.tsbuildinfo"
76
76
  ],
77
77
  "dependencies": {
78
- "@ory/argus": "0.6.1"
78
+ "@ory/argus": "0.7.0"
79
79
  },
80
80
  "engines": {
81
81
  "node": ">=22"