limits-openclaw 0.0.12 → 0.0.13

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.
@@ -113,7 +113,7 @@ export async function runConfigureWizard() {
113
113
  console.log(" Base URL is fixed. apiToken is used for /openclaw/enforce and policy-generator tools. Run after: openclaw plugins install -l <path>\n");
114
114
  const apiToken = await ask(rl, "Organization API key (apiToken) — required for enforce and policy-generator tools", process.env.LIMITS_ENFORCER_API_TOKEN ?? "");
115
115
  const sandboxAnswer = await ask(rl, "Do you run agents inside a sandbox?", "N");
116
- const addSkillAnswer = await ask(rl, "Add limits-policy-generator skill to OpenClaw workspace?", "Y");
116
+ const addSkillAnswer = await ask(rl, "Add limits-policy-generator skill to OpenClaw workspace? (Recommended)", "Y");
117
117
  rl.close();
118
118
  if (apiToken)
119
119
  await runConfigSet("apiToken", JSON.stringify(apiToken));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "limits-openclaw",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Delegates policy enforcement to the Limits platform before and after every tool call.",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "skills",
21
22
  "openclaw.plugin.json",
22
23
  "README.md",
23
24
  "LICENSE",
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: limits-policy-generator
3
+ description: "Generate and create or update policy rules on the Limits SaaS from natural language. Use when the user asks to add, change, or create policy rules enforced by the Limits backend."
4
+ metadata: {"openclaw": {"emoji": "📜", "requires": {"config": ["plugins.entries[\"limits-openclaw\"].config.apiToken"]}}}
5
+ ---
6
+
7
+ # Limits Policy Generator
8
+
9
+ You have two tools for creating and updating policies on the Limits SaaS from natural language. They call the Limits backend so the user's enforcement rules are created or updated there (and apply to tool-call enforcement via the limits-openclaw plugin).
10
+
11
+ ## When to use this skill
12
+
13
+ Use these tools when the user says things like:
14
+
15
+ - "Create a policy that blocks all payment tools"
16
+ - "Add a rule: never run bash with rm -rf"
17
+ - "Generate a policy from this: block transactions over 500"
18
+ - "Update my policy to also block stripe_* tools"
19
+ - "I want to add a guardrail that redacts emails from tool output"
20
+ - "Change the payment limit to 700"
21
+
22
+ ## Tools available
23
+
24
+ ### `limits_generate_create_policy`
25
+
26
+ Generate a new policy from natural language and create it on the Limits backend. Use when the user wants to **add** a new policy.
27
+
28
+ ```
29
+ limits_generate_create_policy(
30
+ input="Block any tool whose name starts with stripe_ or payment_. Allow all other tools.",
31
+ mode="INSTRUCTIONS",
32
+ tools=["stripe_.*", "payment_.*"]
33
+ )
34
+ ```
35
+
36
+ - **input** (required): Natural-language description of the policy (what to block, allow, or require).
37
+ - **mode** (optional): `"INSTRUCTIONS"` | `"CONDITIONS"` | `"GUARDRAIL"`. Default is INSTRUCTIONS. Use GUARDRAIL for rules that scan tool **output** (e.g. redact PII).
38
+ - **tools** (required): Which tool calls this policy applies to. See "Where to apply" section below.
39
+
40
+ ### `limits_generate_update_policy`
41
+
42
+ Generate updates from natural language and apply them to an **existing** policy. Use when the user wants to **change** a policy they already have.
43
+
44
+ ```
45
+ limits_generate_update_policy(
46
+ policyId="uuid-of-existing-policy",
47
+ input="Also block transfer_money. Keep the existing amount limit.",
48
+ mode="INSTRUCTIONS"
49
+ )
50
+ ```
51
+
52
+ - **policyId** (required): The ID of the existing policy to update (UUID).
53
+ - **input** (required): Natural-language description of the changes or additions.
54
+ - **mode** (optional): Same as above.
55
+ - **Note:** Update does **not** change which tools the policy applies to — scope is fixed at creation time. If the user wants to change scope, they should create a new policy.
56
+
57
+ ## Where to apply (tools parameter)
58
+
59
+ The `tools` parameter on `limits_generate_create_policy` is **required** and controls which tool calls the policy is enforced on.
60
+
61
+ ### Values
62
+
63
+ | Value | Meaning |
64
+ |-------|---------|
65
+ | `["*"]` | Apply to **all** tool calls / all requests |
66
+ | `["<tool_name>"]` | Apply to the exact tool (use only names from the agent's actual tool list) |
67
+ | `["<prefix>.*"]` | Apply to all tools whose name starts with that prefix (e.g. `payment_.*`) |
68
+
69
+ Use `prefix.*` (dot-star) for prefix matching. The backend also accepts `prefix_*` and normalizes it to `prefix_.*`. **Use only tool names or prefixes that exist in the user's / agent's available tools** — do not invent names.
70
+
71
+ ### Ask-once logic (required)
72
+
73
+ **Do not call `limits_generate_create_policy` until you know scope.** If the user did not say scope, ask once.
74
+
75
+ - User says **"everywhere"**, **"all requests"**, **"globally"**, or **"all tools"** → use `["*"]` without asking.
76
+ - User **explicitly names specific tools** (e.g. "for read_file", "payment tools", "stripe_*") → use those tools without asking.
77
+ - User **does not say** "all" / "everywhere" / "globally" and **does not name any tools** (e.g. "create a policy if currency is JOD allow request", "create a policy that blocks payments") → you **must ask once** before calling the tool: _"Which tools should this policy apply to: all tool calls, or only specific tools? If specific, which tool names from your available tools?"_ Then call the tool with the user's answer.
78
+
79
+ Do not assume scope. Do not call the create-policy tool immediately when the user only describes the rule (e.g. "if currency is JOD allow") without stating where it applies. Ask once, then call.
80
+
81
+ ### Tool names: use source of truth only
82
+
83
+ When setting the `tools` parameter, use **only tool names from the agent's actual available tools** (the list of tools you have access to). Do not invent or assume tool names. If the user wants "specific tools", list the relevant tools from your real tool list and use those exact names (or prefix patterns like `name_.*` that match them). If you do not have a list of available tools, ask the user which tools should be in scope and use only names they confirm.
84
+
85
+ ## Recommended flow
86
+
87
+ 1. If the user wants a **new** policy:
88
+ - **First determine scope.** If the user did not say "all tools" / "everywhere" / "globally" and did not name specific tools, ask once: "Which tools should this apply to: all tool calls or specific tools? If specific, which ones?"
89
+ - Only then call `limits_generate_create_policy` with `input`, `tools` (from user or from their actual tool list), and optionally `mode`.
90
+ - Confirm what was created and **where it applies** (e.g. "This policy applies to all tools" or "This policy applies to [tool names]").
91
+ 2. If the user wants to **change** an existing policy:
92
+ - Use `limits_generate_update_policy` with the policy id and the change description. (You may need to list or find the policy id first if the user says "update my payment policy".)
93
+ - Remind the user that **scope (which tools the policy applies to) cannot be changed via update** — it stays as set when the policy was created.
94
+ 3. Policies on the Limits backend apply to tool-call enforcement (via limits-openclaw) for that organization.
95
+
96
+ ## Sandbox vs host
97
+
98
+ **If you are running inside a sandbox:** The `limits_generate_create_policy` and `limits_generate_update_policy` tools are only available if the gateway config allows them in the sandbox (e.g. `tools.sandbox.tools.allow` includes `"limits-openclaw"`). If those tools are not in your tool list, you cannot invoke them from this environment.
99
+
100
+ - **To run the policy tools from the sandbox:** The admin must add `limits-openclaw` to the agent allowlist and to `tools.sandbox.tools.allow` (see the limits-openclaw README). After that, you can call the tools from here.
101
+ - **If the tools are still not available:** Tell the user to run the policy command on the **host** or an agent instance that has the Limits backend wired up and the tools allowed.
102
+
103
+ ## Configuration
104
+
105
+ The plugin must be configured with:
106
+
107
+ - **baseUrl**: Base URL of the Limits API (e.g. `https://api.limits.dev`). Used for enforce and policy-generator tools.
108
+ - **apiToken**: Organization API key (Bearer) for the Limits backend. Used for enforce and policy-generator tools.
109
+
110
+ Without these, the tools will not be available or will return an error asking the user to configure them.