@ory/openclaw 0.2.1 → 0.4.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
@@ -37,6 +37,14 @@ From any project where you'd like Ory authentication, inside OpenClaw:
37
37
 
38
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.
39
39
 
40
+ 4. **Turn on Ory login for the OpenClaw session itself.** *(Optional but recommended.)* Out of the box the plugin only governs your *app*. To also attach an Ory identity to *OpenClaw's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — set:
41
+
42
+ ```bash
43
+ export ORY_AUTH_GATE=1
44
+ ```
45
+
46
+ Then restart OpenClaw. On next session start, OpenClaw 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. (Note: OpenClaw's session-start primitive can't hard-block, so the gate runs in advisory mode — auth still happens and the audit trail is correct, but the session always proceeds.)
47
+
40
48
  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
49
 
42
50
  ## What's included
package/dist/cli/main.js CHANGED
@@ -79,7 +79,10 @@ function main() {
79
79
  });
80
80
  break;
81
81
  case "status":
82
- status(args);
82
+ status(args).then(() => process.exit(0), (err) => {
83
+ console.error(err.message ?? err);
84
+ process.exit(1);
85
+ });
83
86
  break;
84
87
  case "local":
85
88
  (0, argus_1.runLocalCommand)("ory-openclaw", args).catch((err) => {
@@ -157,36 +160,25 @@ function uninstall(args) {
157
160
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
158
161
  console.log(`Ory plugin and skills removed from ${configPath}`);
159
162
  }
160
- function status(args) {
163
+ async function status(args) {
161
164
  const projectDir = parseProjectDir(args);
162
165
  const configPath = getOpenClawConfigPath(projectDir);
163
- console.log("Ory Agent Plugin Status (OpenClaw)");
164
- console.log("===================================");
165
- console.log("");
166
- // OpenClaw-specific: check plugin registration
167
- const config = (0, argus_1.readJsonFile)(configPath);
168
- const plugins = (config.plugins ?? []);
169
- const registered = plugins.includes(PLUGIN_MODULE);
170
- console.log("Plugin Registration:");
171
- console.log(` Config file: ${configPath}`);
172
- console.log(` Plugin registered: ${registered ? "yes" : "NO"}`);
173
- if (registered) {
174
- console.log(` Module: ${PLUGIN_MODULE}`);
175
- }
176
- // Shared Ory config
177
- console.log("");
178
- console.log("Ory Configuration:");
179
- const resolved = (0, argus_1.resolveConfig)();
180
- const oryConfigPath = (0, argus_1.getConfigPath)();
181
- console.log(` Config file: ${oryConfigPath}`);
182
- console.log(` Project URL: ${resolved.projectUrl ?? "NOT SET"} [source: ${resolved.projectUrlSource}]`);
183
- console.log(` API Key: ${resolved.apiKey ? "(set)" : "NOT SET"} [source: ${resolved.apiKeySource}]`);
184
- console.log("");
185
- console.log("OpenClaw Integration:");
186
- console.log(" Blocking support: YES (before_tool_call can deny tool execution)");
187
- console.log(" Hooks registered: session_start, before_tool_call, after_tool_call");
188
- (0, argus_1.printEnvironment)();
189
- (0, argus_1.printLogTail)();
166
+ await (0, argus_1.runStatusCommand)("ory-openclaw", "openclaw", {
167
+ title: "OpenClaw",
168
+ printPluginSection: () => {
169
+ const config = (0, argus_1.readJsonFile)(configPath);
170
+ const plugins = (config.plugins ?? []);
171
+ const registered = plugins.includes(PLUGIN_MODULE);
172
+ console.log("Hooks & plugin:");
173
+ console.log(` Config file: ${configPath}`);
174
+ console.log(` Plugin registered: ${registered ? "yes" : "NO"}`);
175
+ if (registered) {
176
+ console.log(` Module: ${PLUGIN_MODULE}`);
177
+ }
178
+ console.log(` Blocking support: yes (before_tool_call can deny tool execution)`);
179
+ console.log(` Hooks registered: session_start, before_tool_call, after_tool_call`);
180
+ },
181
+ });
190
182
  }
191
183
  function help() {
192
184
  console.log(`
package/dist/plugin.js CHANGED
@@ -229,23 +229,27 @@ function createBeforeToolCallHandler(client) {
229
229
  object: mcpTool.serverName,
230
230
  relation: "use",
231
231
  subjectId,
232
+ ...("subjectSet" in subject ? { subjectSet: subject.subjectSet } : {}),
232
233
  spanAttributes: mcpAttrs,
233
234
  });
235
+ const decisionAttrs = decision.spanAttributes;
234
236
  if (decision.kind === "allow") {
235
- client.tracer.record("tool.invoke", "ok", { attributes: mcpAttrs });
237
+ client.tracer.record("tool.invoke", "ok", {
238
+ attributes: { ...mcpAttrs, ...decisionAttrs },
239
+ });
236
240
  return;
237
241
  }
238
242
  if (decision.kind === "observe") {
239
243
  client.tracer.record("tool.block", "denied", {
240
- attributes: { ...mcpAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
244
+ attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
241
245
  });
242
246
  client.tracer.record("tool.invoke", "ok", {
243
- attributes: { ...mcpAttrs, allowed: false, observed: true },
247
+ attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, observed: true },
244
248
  });
245
249
  return;
246
250
  }
247
251
  client.tracer.record("tool.block", "denied", {
248
- attributes: { ...mcpAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
252
+ attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
249
253
  });
250
254
  const blockReason = (0, argus_1.formatDenialMessage)({
251
255
  tool: ctx.toolId,
@@ -266,21 +270,24 @@ function createBeforeToolCallHandler(client) {
266
270
  return;
267
271
  }
268
272
  const attrs = { toolName: ctx.toolId, ...inputSummary };
273
+ const decisionAttrs = decision.spanAttributes;
269
274
  if (decision.kind === "allow") {
270
- client.tracer.record("tool.invoke", "ok", { attributes: { ...attrs, allowed: true } });
275
+ client.tracer.record("tool.invoke", "ok", {
276
+ attributes: { ...attrs, ...decisionAttrs, allowed: true },
277
+ });
271
278
  return;
272
279
  }
273
280
  if (decision.kind === "observe") {
274
281
  client.tracer.record("tool.block", "denied", {
275
- attributes: { ...attrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
282
+ attributes: { ...attrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
276
283
  });
277
284
  client.tracer.record("tool.invoke", "ok", {
278
- attributes: { ...attrs, allowed: false, observed: true },
285
+ attributes: { ...attrs, ...decisionAttrs, allowed: false, observed: true },
279
286
  });
280
287
  return;
281
288
  }
282
289
  client.tracer.record("tool.block", "denied", {
283
- attributes: { ...attrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
290
+ attributes: { ...attrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
284
291
  });
285
292
  const blockReason = (0, argus_1.formatDenialMessage)({
286
293
  tool: ctx.toolId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/openclaw",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
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,10 +65,10 @@
65
65
  "!dist/**/*.tsbuildinfo"
66
66
  ],
67
67
  "dependencies": {
68
- "@ory/argus": "0.2.1"
68
+ "@ory/argus": "0.4.0"
69
69
  },
70
70
  "engines": {
71
- "node": ">=24"
71
+ "node": ">=22"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc",