fastgrc-openclaw 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/README.md +83 -83
  2. package/package.json +17 -5
package/README.md CHANGED
@@ -1,83 +1,83 @@
1
- # fastgrc-openclaw
2
-
3
- FastGRC compliance plugin for [OpenClaw](https://openclaw.ai). Evaluates every agent tool call against your policy before it executes — blocking, flagging, or logging violations in real time.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install fastgrc-openclaw
9
- ```
10
-
11
- ## Setup (2 lines)
12
-
13
- ```typescript
14
- // openclaw.config.ts
15
- import { FastGRCPlugin } from 'fastgrc-openclaw';
16
-
17
- export default {
18
- plugins: [
19
- FastGRCPlugin({
20
- apiKey: process.env.FASTGRC_API_KEY, // fgrc_k1_...
21
- }),
22
- ],
23
- };
24
- ```
25
-
26
- Set your environment variable:
27
-
28
- ```bash
29
- FASTGRC_API_KEY=fgrc_k1_your_key_here
30
- ```
31
-
32
- Get your API key at [fastgrc.ai/connect?source=openclaw](https://fastgrc.ai/connect?source=openclaw) — free, no credit card.
33
-
34
- ## Options
35
-
36
- ```typescript
37
- FastGRCPlugin({
38
- apiKey: string; // Required. Your FastGRC API key.
39
- policyId?: string; // Optional. Target a specific policy. Omit for org-wide default.
40
- onBlock?: 'throw' // (default) Throw FastGRCBlockedError — OpenClaw surfaces it as an agent error
41
- | 'warn' // console.warn and allow through
42
- | 'silent'; // Allow through silently
43
- timeoutMs?: number; // Max ms to wait for FastGRC API. Default: 3000. Fail-open on timeout.
44
- baseUrl?: string; // Override FastGRC base URL. Default: https://app.fastgrc.ai
45
- })
46
- ```
47
-
48
- ## How it works
49
-
50
- The plugin registers a `before_tool_call` hook. For every tool invocation:
51
-
52
- 1. Calls `POST /api/v1/policy-router/evaluate` with the tool name and arguments
53
- 2. On `decision: block` → throws `FastGRCBlockedError` (OpenClaw surfaces this as an agent error with explanation)
54
- 3. On `decision: require_approval` → throws `FastGRCApprovalRequiredError` with a link to your dashboard
55
- 4. On `decision: allow | uncertain` → passes through silently
56
- 5. On timeout or network error → **fail-open** (allows through, logs a warning) — FastGRC never breaks your agent due to infra issues
57
-
58
- ## Error types
59
-
60
- ```typescript
61
- import { FastGRCBlockedError, FastGRCApprovalRequiredError } from 'fastgrc-openclaw';
62
-
63
- // Catch in your agent error handler:
64
- if (err instanceof FastGRCBlockedError) {
65
- console.log(err.matchedRule); // Which policy rule triggered
66
- console.log(err.reasoning); // Human-readable explanation
67
- console.log(err.policyId); // Policy that made the decision
68
- }
69
-
70
- if (err instanceof FastGRCApprovalRequiredError) {
71
- console.log(err.dashboardUrl); // Link to approve in FastGRC dashboard
72
- }
73
- ```
74
-
75
- ## Policy modes
76
-
77
- Policies start in **Observability Mode** — violations are logged but never blocked. Switch to enforcement from your [FastGRC dashboard](https://app.fastgrc.ai/dashboard/agent-policies) when ready.
78
-
79
- ## Links
80
-
81
- - [FastGRC docs](https://docs.fastgrc.ai/integrations/openclaw)
82
- - [Get your API key](https://fastgrc.ai/connect?source=openclaw)
83
- - [Dashboard](https://app.fastgrc.ai)
1
+ # fastgrc-openclaw
2
+
3
+ FastGRC compliance plugin for [OpenClaw](https://openclaw.ai). Evaluates every agent tool call against your policy before it executes — blocking, flagging, or logging violations in real time.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install fastgrc-openclaw
9
+ ```
10
+
11
+ ## Setup (2 lines)
12
+
13
+ ```typescript
14
+ // openclaw.config.ts
15
+ import { FastGRCPlugin } from 'fastgrc-openclaw';
16
+
17
+ export default {
18
+ plugins: [
19
+ FastGRCPlugin({
20
+ apiKey: process.env.FASTGRC_API_KEY, // fgrc_k1_...
21
+ }),
22
+ ],
23
+ };
24
+ ```
25
+
26
+ Set your environment variable:
27
+
28
+ ```bash
29
+ FASTGRC_API_KEY=fgrc_k1_your_key_here
30
+ ```
31
+
32
+ Get your API key at [fastgrc.ai/connect?source=openclaw](https://fastgrc.ai/connect?source=openclaw) — free, no credit card.
33
+
34
+ ## Options
35
+
36
+ ```typescript
37
+ FastGRCPlugin({
38
+ apiKey: string; // Required. Your FastGRC API key.
39
+ policyId?: string; // Optional. Target a specific policy. Omit for org-wide default.
40
+ onBlock?: 'throw' // (default) Throw FastGRCBlockedError — OpenClaw surfaces it as an agent error
41
+ | 'warn' // console.warn and allow through
42
+ | 'silent'; // Allow through silently
43
+ timeoutMs?: number; // Max ms to wait for FastGRC API. Default: 3000. Fail-open on timeout.
44
+ baseUrl?: string; // Override FastGRC base URL. Default: https://app.fastgrc.ai
45
+ })
46
+ ```
47
+
48
+ ## How it works
49
+
50
+ The plugin registers a `before_tool_call` hook. For every tool invocation:
51
+
52
+ 1. Calls `POST /api/v1/policy-router/evaluate` with the tool name and arguments
53
+ 2. On `decision: block` → throws `FastGRCBlockedError` (OpenClaw surfaces this as an agent error with explanation)
54
+ 3. On `decision: require_approval` → throws `FastGRCApprovalRequiredError` with a link to your dashboard
55
+ 4. On `decision: allow | uncertain` → passes through silently
56
+ 5. On timeout or network error → **fail-open** (allows through, logs a warning) — FastGRC never breaks your agent due to infra issues
57
+
58
+ ## Error types
59
+
60
+ ```typescript
61
+ import { FastGRCBlockedError, FastGRCApprovalRequiredError } from 'fastgrc-openclaw';
62
+
63
+ // Catch in your agent error handler:
64
+ if (err instanceof FastGRCBlockedError) {
65
+ console.log(err.matchedRule); // Which policy rule triggered
66
+ console.log(err.reasoning); // Human-readable explanation
67
+ console.log(err.policyId); // Policy that made the decision
68
+ }
69
+
70
+ if (err instanceof FastGRCApprovalRequiredError) {
71
+ console.log(err.dashboardUrl); // Link to approve in FastGRC dashboard
72
+ }
73
+ ```
74
+
75
+ ## Policy modes
76
+
77
+ Policies start in **Observability Mode** — violations are logged but never blocked. Switch to enforcement from your [FastGRC dashboard](https://app.fastgrc.ai/dashboard/agent-policies) when ready.
78
+
79
+ ## Links
80
+
81
+ - [FastGRC docs](https://docs.fastgrc.ai/integrations/openclaw)
82
+ - [Get your API key](https://fastgrc.ai/connect?source=openclaw)
83
+ - [Dashboard](https://app.fastgrc.ai)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastgrc-openclaw",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "FastGRC agent compliance plugin for OpenClaw — evaluates every tool call against your policy before it executes",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -15,18 +15,30 @@
15
15
  "bin": {
16
16
  "fastgrc-hook": "./dist/bin.js"
17
17
  },
18
- "files": ["dist", "README.md"],
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
19
22
  "scripts": {
20
- "build": "tsup",
23
+ "build": "tsup && node -e \"require('fs').chmodSync('dist/bin.js', '755')\"",
21
24
  "dev": "tsup --watch",
22
25
  "typecheck": "tsc --noEmit"
23
26
  },
24
- "keywords": ["fastgrc", "openclaw", "ai-agent", "compliance", "policy", "security"],
27
+ "keywords": [
28
+ "fastgrc",
29
+ "openclaw",
30
+ "ai-agent",
31
+ "compliance",
32
+ "policy",
33
+ "security"
34
+ ],
25
35
  "author": "FastGRC <support@fastgrc.ai>",
26
36
  "license": "MIT",
27
37
  "devDependencies": {
28
38
  "tsup": "^8.0.0",
29
39
  "typescript": "^5.0.0"
30
40
  },
31
- "engines": { "node": ">=18" }
41
+ "engines": {
42
+ "node": ">=18"
43
+ }
32
44
  }