Skip to content

Commit b48eba4

Browse files
committed
chore(ory-claude): release v0.4.0
1 parent b1a2de6 commit b48eba4

4 files changed

Lines changed: 38 additions & 29 deletions

File tree

plugins/ory-agent-plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ory-agent-plugin",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Ory plugin for Claude Code: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
55
"author": {
66
"name": "Ory",

plugins/ory-agent-plugin/.mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"command": "npx",
66
"args": [
77
"-y",
8-
"@ory/mcp-server@0.3.0"
8+
"@ory/mcp-server@0.4.0"
99
]
1010
}
1111
}

plugins/ory-agent-plugin/README.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,30 @@ The installer requires the `claude` CLI on `PATH`. After it finishes, run `ory-c
3636

3737
</details>
3838

39-
## Quickstart (≈ 3 minutes)
39+
## Quickstart
4040

4141
From any project where you'd like Ory authentication, inside Claude Code:
4242

43-
1. **Start a local Ory instance.** Ask Claude *"start the local Ory stack"* or run the slash command:
43+
1. **Start a local Ory instance.** *(~1 min. Requires Docker running.)* Ask Claude *"start the local Ory stack"* or run the slash command:
4444

4545
```
4646
/ory-agent-plugin:local-up
4747
```
4848

4949
A banner prints the seeded test user's email and password. Note them — you'll log in with them in step 3.
5050

51-
2. **Scaffold Ory into your project.** Ask Claude *"add Ory auth to this app"*. The `ory-auth-setup` skill takes over: it installs Ory Elements, wires the SDK, generates the login / registration / recovery / verification / settings pages, and sets up session middleware. It targets the local stack from step 1, so no signup or API key is needed.
51+
2. **Scaffold Ory into your project.** *(~5–10 min, depending on your project.)* Ask Claude *"add Ory auth to this app"*. The `ory-auth-setup` skill takes over: it installs Ory Elements, wires the SDK, generates the login / registration / recovery / verification / settings pages, and sets up session middleware. It targets the local stack from step 1, so no signup or API key is needed.
5252

5353
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.
5454

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:
56+
57+
```bash
58+
export ORY_AUTH_GATE=1
59+
```
60+
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.
62+
5563
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.
5664

5765
## What's included
@@ -64,11 +72,11 @@ Each skill is a vetted, end-to-end playbook. Skills are model-invoked — ask Cl
6472
- **`ory-login-flow`** *(e.g. "add login and registration pages with Ory Elements")* — login, registration, recovery, verification, and settings pages with Ory Elements. Next.js App Router and React SPA variants.
6573
- **`ory-social-login`** *(e.g. "add Google sign-in via Ory")* — Google, GitHub, Apple, Microsoft, Discord, and other OIDC providers with Jsonnet data mappers.
6674
- **`ory-local-dev`** *(e.g. "run the local Ory stack")* — drive the local Ory stack from within Claude to prototype and test without a remote project.
67-
- **`ory-permissions-onboarding`** *(e.g. "grant me use on the Bash tool")* — walk through writing the Ory Permissions tuples that let the plugin enforce per-tool access.
75+
- **`ory-permissions-onboarding`** *(e.g. "grant me use on the Bash tool")* — walk through writing the Ory Permissions that let the plugin enforce per-tool access.
6876

6977
### Ory MCP server
7078

71-
Bundled and registered automatically. Exposes the Ory CLI and the Ory Network REST API as MCP tools so Claude can manage identities, OAuth2 clients, projects, permission tuples, and configuration without ever leaving the chat. Useful for seeding test data, verifying a scaffolded integration, or running one-off admin tasks.
79+
Bundled and registered automatically. Exposes the Ory CLI and the Ory Network REST API as MCP tools so Claude can manage identities, OAuth2 clients, projects, permissions, and configuration without ever leaving the chat. Useful for seeding test data, verifying a scaffolded integration, or running one-off admin tasks.
7280

7381
### Local Ory stack
7482

@@ -80,37 +88,38 @@ Bundled and registered automatically. Exposes the Ory CLI and the Ory Network RE
8088
`local-up` brings up Ory Identities, OAuth2, and Permissions, plus a login UI on `:3000` and Jaeger on `:16686`, all reachable through `http://localhost:4000`. A test user identity is seeded and the credentials are printed for you. Use it to:
8189

8290
- **Learn Ory hands-on** without signing up for a hosted project.
83-
- **Prototype** flows (login, social, MFA, recovery, permission tuples) against a real Ory backend.
91+
- **Prototype** flows (login, social, MFA, recovery, permissions) against a real Ory backend.
8492
- **Test** an auth integration end-to-end before pushing anything to a real environment.
8593
- **Develop** your application against the same identity, OAuth2, and permission surfaces you'll ship with.
8694

8795
## Pointing at a real Ory project
8896

89-
The Quickstart uses the local stack. If you have a hosted [Ory Network](https://console.ory.sh) project, point the plugin at it:
97+
The Quickstart uses the local stack. If you have a hosted [Ory Network](https://console.ory.sh) project, point the plugin at it. A project URL is enough — the agent identity is created automatically via OAuth2 Dynamic Client Registration on first run:
9098

9199
```bash
92100
npx -y -p @ory/claude-code ory-claude configure \
93-
--project-url https://<id>.projects.oryapis.com \
94-
--api-key ory_pat_...
101+
--project-url https://<id>.projects.oryapis.com
95102
```
96103

97-
Config is saved to `~/.config/ory-agent-plugins/config.json` and shared across every Ory agent plugin on the machine.
104+
Pass `--api-key ory_pat_...` only if you want to override the auto-registered agent identity with a static personal access token (operator override; rarely needed).
105+
106+
Config is saved to `~/.config/ory-agent-plugins/config.json` and shared across every Ory agent plugin on the machine. The same settings can be supplied via environment variables (`ORY_PROJECT_URL`, `ORY_AGENT_API_KEY`) — env vars take precedence over the config file when both are set, which is what most CI / scripted setups want.
98107

99-
Without configuration the plugin still loads cleanly and runs in **pass-through mode**: skills and commands work, but nothing is blocked. You can stay in pass-through mode indefinitely if you only want the DX features.
108+
Without any configuration the plugin still loads cleanly and runs in **pass-through mode**: skills, slash commands, and audit logging work, but no permission checks run, so nothing is ever blocked. You can stay in pass-through mode indefinitely if you only want the DX features.
100109

101110
## Agent security
102111

103112
Once the plugin is pointed at an Ory project (local or hosted), Claude's session and every tool call can be governed by Ory.
104113

105114
- **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.
106-
- **Authorization.** Before any tool runs, the plugin checks [Ory Permissions](https://www.ory.sh/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.
107-
- **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 relation tuples so *"agent X acting on behalf of user Y"* stays queryable after tokens expire.
115+
- **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.
116+
- **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.
108117

109-
The plugin is **fail-open** on its own infrastructure failures (network errors, rate limits, missing config), so enforcement is only as strong as your tuples — grant explicit `invoke` relations for the tools each user should be able to run.
118+
The plugin is **fail-open** on its own infrastructure failures (network errors, rate limits, missing config), so enforcement is only as strong as your permission grants — grant explicit `use` on the tools each user should be able to run.
110119

111120
### Enable enforcement
112121

113-
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.
122+
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.)
114123

115124
1. **Turn on the user gate.** In your shell:
116125

@@ -120,7 +129,7 @@ After install the plugin runs in **observe mode**: every tool call is checked ag
120129

121130
The next Claude session opens a browser for PKCE login. Subsequent sessions reuse the persisted token until it expires.
122131

123-
2. **Bootstrap tuples for the built-in tools.** One idempotent command grants the current user `use` on every tool Claude ships with (Read, Write, Bash, …):
132+
2. **Bootstrap permissions for the built-in tools.** One idempotent command grants the current user `use` on every tool Claude ships with (Read, Write, Bash, …):
124133

125134
```bash
126135
npx -y -p @ory/claude-code ory-claude permissions bootstrap
@@ -134,7 +143,7 @@ After install the plugin runs in **observe mode**: every tool call is checked ag
134143
npx -y -p @ory/claude-code ory-claude permissions status
135144
```
136145

137-
Add tuples for any MCP server tools or custom commands by hand, or via the Ory MCP server from inside Claude (*"grant me use on the Bash tool"*).
146+
Add permissions for any MCP server tools or custom commands by hand, or via the Ory MCP server from inside Claude (*"grant me use on the Bash tool"*).
138147

139148
4. **Promote to enforce.** Once the observe-mode logs look right, switch over:
140149

@@ -158,7 +167,7 @@ npx -y -p @ory/claude-code ory-claude status
158167
Highlights:
159168

160169
- `agent status` — show the current persisted DCR identity for the agent.
161-
- `permissions observe` / `permissions enforce` — switch between "log denies, allow through" (the install default) and "block denies." `permissions bootstrap` writes `use` tuples for the harness's built-in tools so the promotion path doesn't require hand-writing relationships.
170+
- `permissions observe` / `permissions enforce` — switch between "log denies, allow through" (the install default) and "block denies." `permissions bootstrap` writes `use` permissions for the harness's built-in tools so the promotion path doesn't require hand-writing relations.
162171
- `configure --audit-only` — kill switch that disables Ory entirely (no auth, no permission checks; only audit logging of tool invocations). For phased rollouts, prefer `permissions observe` over `--audit-only`.
163172
- `local seed` / `local env` — reseed the test user, or print env vars for pointing other tools at the local stack.
164173

plugins/ory-agent-plugin/hooks/hooks.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
10+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
1111
}
1212
]
1313
}
@@ -18,7 +18,7 @@
1818
"hooks": [
1919
{
2020
"type": "command",
21-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
21+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
2222
}
2323
]
2424
}
@@ -29,7 +29,7 @@
2929
"hooks": [
3030
{
3131
"type": "command",
32-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
32+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
3333
}
3434
]
3535
}
@@ -40,7 +40,7 @@
4040
"hooks": [
4141
{
4242
"type": "command",
43-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
43+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
4444
}
4545
]
4646
}
@@ -51,7 +51,7 @@
5151
"hooks": [
5252
{
5353
"type": "command",
54-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
54+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
5555
}
5656
]
5757
}
@@ -62,7 +62,7 @@
6262
"hooks": [
6363
{
6464
"type": "command",
65-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
65+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
6666
}
6767
]
6868
}
@@ -73,7 +73,7 @@
7373
"hooks": [
7474
{
7575
"type": "command",
76-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
76+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
7777
}
7878
]
7979
}
@@ -84,7 +84,7 @@
8484
"hooks": [
8585
{
8686
"type": "command",
87-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
87+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
8888
}
8989
]
9090
}
@@ -95,7 +95,7 @@
9595
"hooks": [
9696
{
9797
"type": "command",
98-
"command": "npx -y -p @ory/claude-code@0.3.0 ory-claude-hook"
98+
"command": "npx -y -p @ory/claude-code@0.4.0 ory-claude-hook"
9999
}
100100
]
101101
}

0 commit comments

Comments
 (0)