@ory/openclaw 0.1.1 → 0.1.3
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 +92 -27
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
[Ory](https://ory.com) bundled into [OpenClaw](https://github.com/openclaw/openclaw): skills that scaffold Ory authentication into your codebase, a local Ory stack you can spin up in one command, and (when pointed at an Ory project) authentication, authorization, and audit for every tool OpenClaw runs.
|
|
4
4
|
|
|
5
|
+
You don't need an Ory account or any prior Ory experience to start.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- [OpenClaw](https://github.com/openclaw/openclaw) installed and configured
|
|
10
|
+
- Node.js **≥ 24**
|
|
11
|
+
- [Docker](https://docs.docker.com/get-docker/) (only needed for the local Ory stack)
|
|
12
|
+
- macOS or Linux. Windows works via WSL2.
|
|
13
|
+
|
|
5
14
|
## Install
|
|
6
15
|
|
|
7
|
-
OpenClaw loads in-process plugins registered in `.openclaw/config.json`.
|
|
16
|
+
OpenClaw loads in-process plugins registered in `.openclaw/config.json`. No prior `npm install` required:
|
|
8
17
|
|
|
9
18
|
```bash
|
|
10
19
|
npx @ory/openclaw install # registers in .openclaw/config.json
|
|
@@ -12,28 +21,40 @@ npx @ory/openclaw install --project-dir <path>
|
|
|
12
21
|
npx @ory/openclaw uninstall
|
|
13
22
|
```
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
That's it — the Ory plugin, the Ory MCP server, and the Ory skill catalog (`.openclaw/skills/`, registered under `skills.load.extraDirs`) are now wired into your OpenClaw config non-destructively.
|
|
16
25
|
|
|
17
|
-
##
|
|
26
|
+
## Quickstart (≈ 3 minutes)
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
From any project where you'd like Ory authentication, inside OpenClaw:
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
1. **Start a local Ory instance.** Ask OpenClaw *"start the local Ory stack"* or invoke the `ory-local-up` skill from the skill picker.
|
|
31
|
+
|
|
32
|
+
A banner prints the seeded test user's email and password. Note them — you'll log in with them in step 3.
|
|
33
|
+
|
|
34
|
+
2. **Scaffold Ory into your project.** Ask OpenClaw *"add Ory auth to this app"* or invoke the `ory-auth-setup` skill.
|
|
22
35
|
|
|
23
|
-
|
|
36
|
+
OpenClaw 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.
|
|
24
37
|
|
|
25
|
-
|
|
26
|
-
- **`ory-login-flow`**: login, registration, recovery, verification, and settings pages with Ory Elements. Next.js App Router and React SPA variants.
|
|
27
|
-
- **`ory-social-login`**: Google, GitHub, Apple, Microsoft, Discord, and other OIDC providers with Jsonnet data mappers.
|
|
28
|
-
- **`ory-local-dev`**: drive the local Ory stack (below) from within OpenClaw to prototype and test against without a remote project.
|
|
38
|
+
3. **Sign in.** Start your app, visit the login page OpenClaw 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.
|
|
29
39
|
|
|
30
|
-
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
## What's included
|
|
43
|
+
|
|
44
|
+
### Skills for scaffolding Ory into your application
|
|
45
|
+
|
|
46
|
+
Each skill is a vetted, end-to-end playbook. Ask OpenClaw in natural language or invoke a skill directly:
|
|
47
|
+
|
|
48
|
+
- **`ory-auth-setup`** — full project setup. Install the Ory CLI, create an Ory Network project (or use the local one), add Ory Elements, configure the SDK, build the auth pages, wire session middleware.
|
|
49
|
+
- **`ory-login-flow`** — login, registration, recovery, verification, and settings pages with Ory Elements. Next.js App Router and React SPA variants.
|
|
50
|
+
- **`ory-social-login`** — Google, GitHub, Apple, Microsoft, Discord, and other OIDC providers with Jsonnet data mappers.
|
|
51
|
+
- **`ory-local-dev`** — drive the local Ory stack from within OpenClaw to prototype and test without a remote project.
|
|
31
52
|
|
|
32
53
|
### Ory MCP server
|
|
33
54
|
|
|
34
|
-
Bundled and registered automatically.
|
|
55
|
+
Bundled and registered automatically. Exposes the Ory CLI and the Ory Network REST API as MCP tools so OpenClaw 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.
|
|
35
56
|
|
|
36
|
-
### Local Ory stack
|
|
57
|
+
### Local Ory stack
|
|
37
58
|
|
|
38
59
|
From OpenClaw's skill picker:
|
|
39
60
|
|
|
@@ -44,34 +65,62 @@ ory-local-down # tear it all down
|
|
|
44
65
|
|
|
45
66
|
Or via the CLI: `npx -y -p @ory/openclaw ory-openclaw local up | down`.
|
|
46
67
|
|
|
47
|
-
`local
|
|
68
|
+
`ory-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:
|
|
48
69
|
|
|
49
70
|
- **Learn Ory hands-on** without signing up for a hosted project.
|
|
50
|
-
- **Prototype** flows (login, social, MFA, recovery, permission tuples) against a real Ory backend
|
|
71
|
+
- **Prototype** flows (login, social, MFA, recovery, permission tuples) against a real Ory backend.
|
|
51
72
|
- **Test** an auth integration end-to-end before pushing anything to a real environment.
|
|
52
73
|
- **Develop** your application against the same identity, OAuth2, and permission surfaces you'll ship with.
|
|
53
74
|
|
|
54
|
-
|
|
75
|
+
## Pointing at a real Ory project
|
|
55
76
|
|
|
56
|
-
|
|
77
|
+
The Quickstart uses the local stack. If you have a hosted [Ory Network](https://console.ory.sh) project, point the plugin at it:
|
|
57
78
|
|
|
58
79
|
```bash
|
|
59
|
-
npx -y -p @ory/openclaw ory-openclaw configure
|
|
80
|
+
npx -y -p @ory/openclaw ory-openclaw configure \
|
|
81
|
+
--project-url https://<id>.projects.oryapis.com \
|
|
82
|
+
--api-key ory_pat_...
|
|
60
83
|
```
|
|
61
84
|
|
|
62
|
-
Config is saved to `~/.config/ory-agent-plugins/config.json` and shared across every Ory agent plugin on the machine.
|
|
85
|
+
Config is saved to `~/.config/ory-agent-plugins/config.json` and shared across every Ory agent plugin on the machine.
|
|
86
|
+
|
|
87
|
+
Without configuration the plugin still loads cleanly and runs in **pass-through mode**: skills work, but nothing is blocked. You can stay in pass-through mode indefinitely if you only want the DX features.
|
|
63
88
|
|
|
64
|
-
## Agent security
|
|
89
|
+
## Agent security
|
|
65
90
|
|
|
66
|
-
Once the plugin is pointed at an Ory project (local or hosted), OpenClaw's session and every tool call
|
|
91
|
+
Once the plugin is pointed at an Ory project (local or hosted), OpenClaw's session and every tool call can be governed by Ory.
|
|
67
92
|
|
|
68
|
-
- **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `ORY_AUTH_GATE=1
|
|
69
|
-
- **Authorization.** Before any tool runs, the plugin checks Ory Permissions against the user's subject and blocks the
|
|
70
|
-
- **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
|
|
93
|
+
- **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `ORY_AUTH_GATE=1` is set. The OpenClaw 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.
|
|
94
|
+
- **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.
|
|
95
|
+
- **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.
|
|
71
96
|
|
|
72
|
-
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
|
|
97
|
+
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.
|
|
73
98
|
|
|
74
|
-
|
|
99
|
+
### Enable enforcement
|
|
100
|
+
|
|
101
|
+
1. **Turn on the user gate.** In your shell:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
export ORY_AUTH_GATE=1
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The next OpenClaw session refreshes or prompts for PKCE login. Subsequent sessions reuse the persisted token until it expires.
|
|
108
|
+
|
|
109
|
+
2. **Grant yourself permission to use a tool.** Use the Ory MCP server from inside OpenClaw (*"grant me invoke on the Bash tool"*) or the CLI directly:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
ory create relationship \
|
|
113
|
+
--namespace AgentTools \
|
|
114
|
+
--object Bash \
|
|
115
|
+
--relation invoke \
|
|
116
|
+
--subject-id <your-user-subject-id>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Your subject id is printed at the start of every OpenClaw session when `ORY_AGENT_DEBUG=true`.
|
|
120
|
+
|
|
121
|
+
3. **See a denial.** Pick a tool you didn't grant (or remove the tuple) and ask OpenClaw to use it. The hook blocks the call and OpenClaw shows the denial reason. The decision is recorded as a `tool.block` trace span.
|
|
122
|
+
|
|
123
|
+
## CLI reference
|
|
75
124
|
|
|
76
125
|
```
|
|
77
126
|
npx -y -p @ory/openclaw ory-openclaw install | uninstall [--project-dir <path>]
|
|
@@ -82,9 +131,25 @@ npx -y -p @ory/openclaw ory-openclaw watch [<trace-f
|
|
|
82
131
|
npx -y -p @ory/openclaw ory-openclaw status [--project-dir <path>]
|
|
83
132
|
```
|
|
84
133
|
|
|
134
|
+
Highlights:
|
|
135
|
+
|
|
136
|
+
- `agent status` — show the current persisted DCR identity for the agent.
|
|
137
|
+
- `configure --audit-only` — record decisions without blocking; useful for a phased rollout.
|
|
138
|
+
- `local seed` / `local env` — reseed the test user, or print env vars for pointing other tools at the local stack.
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
- **`ory-local-up` fails.** Make sure Docker is running and ports `3000`, `4000`, `4100`, and `16686` are free.
|
|
143
|
+
- **PKCE login loops.** Clear persisted state with `npx -y -p @ory/openclaw ory-openclaw agent unregister` and retry.
|
|
144
|
+
- **`npx` fetches an old version.** Force a fresh fetch: `npx -y -p @ory/openclaw@latest ory-openclaw …`.
|
|
145
|
+
- **Need more signal.** Set `ORY_AGENT_DEBUG=true` and `ORY_AGENT_LOG_FILE=/tmp/ory.log` to capture structured logs.
|
|
146
|
+
|
|
85
147
|
## Links
|
|
86
148
|
|
|
87
|
-
- [
|
|
149
|
+
- [Ory documentation](https://www.ory.com/docs/)
|
|
150
|
+
- [Ory Network console](https://console.ory.sh)
|
|
151
|
+
- [Ory Elements](https://github.com/ory/elements)
|
|
152
|
+
- [OpenClaw documentation](https://github.com/openclaw/openclaw)
|
|
88
153
|
|
|
89
154
|
## License
|
|
90
155
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/openclaw",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Ory plugin for OpenClaw: 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",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"!dist/**/*.tsbuildinfo"
|
|
66
66
|
],
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@ory/argus": "0.1.
|
|
68
|
+
"@ory/argus": "0.1.3"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=24"
|