fastgrc-openclaw 1.0.1 → 1.0.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/dist/bin.js CHANGED
@@ -99,7 +99,7 @@ async function main() {
99
99
  if (!result) {
100
100
  process.exit(0);
101
101
  }
102
- const { decision, reasoning, policyContext } = result;
102
+ const { decision, reasoning, policyContext, reasonTags } = result;
103
103
  const matchedRule = policyContext?.matchedRule;
104
104
  if (decision === "block") {
105
105
  const msg = matchedRule ? `FastGRC blocked: [${matchedRule}] ${reasoning}` : `FastGRC blocked: ${reasoning}`;
@@ -115,6 +115,10 @@ Review at: ${baseUrl}/dashboard/agent-policies
115
115
  );
116
116
  process.exit(2);
117
117
  }
118
+ if (Array.isArray(reasonTags) && reasonTags.includes("override_block_active")) {
119
+ const msg = matchedRule ? `[FastGRC] Observability mode \u2014 would have blocked: [${matchedRule}] ${reasoning}` : `[FastGRC] Observability mode \u2014 would have blocked: ${reasoning}`;
120
+ process.stderr.write(msg + "\n");
121
+ }
118
122
  process.exit(0);
119
123
  }
120
124
  main().catch((err) => {
package/dist/bin.mjs CHANGED
@@ -98,7 +98,7 @@ async function main() {
98
98
  if (!result) {
99
99
  process.exit(0);
100
100
  }
101
- const { decision, reasoning, policyContext } = result;
101
+ const { decision, reasoning, policyContext, reasonTags } = result;
102
102
  const matchedRule = policyContext?.matchedRule;
103
103
  if (decision === "block") {
104
104
  const msg = matchedRule ? `FastGRC blocked: [${matchedRule}] ${reasoning}` : `FastGRC blocked: ${reasoning}`;
@@ -114,6 +114,10 @@ Review at: ${baseUrl}/dashboard/agent-policies
114
114
  );
115
115
  process.exit(2);
116
116
  }
117
+ if (Array.isArray(reasonTags) && reasonTags.includes("override_block_active")) {
118
+ const msg = matchedRule ? `[FastGRC] Observability mode \u2014 would have blocked: [${matchedRule}] ${reasoning}` : `[FastGRC] Observability mode \u2014 would have blocked: ${reasoning}`;
119
+ process.stderr.write(msg + "\n");
120
+ }
117
121
  process.exit(0);
118
122
  }
119
123
  main().catch((err) => {
package/dist/index.d.mts CHANGED
@@ -53,6 +53,7 @@ interface EvaluateResponse {
53
53
  decision: 'allow' | 'block' | 'verify' | 'uncertain' | 'require_approval';
54
54
  confidence: number;
55
55
  reasoning: string;
56
+ reasonTags?: string[];
56
57
  policyContext?: {
57
58
  policyId?: string;
58
59
  matchedRule?: string;
package/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ interface EvaluateResponse {
53
53
  decision: 'allow' | 'block' | 'verify' | 'uncertain' | 'require_approval';
54
54
  confidence: number;
55
55
  reasoning: string;
56
+ reasonTags?: string[];
56
57
  policyContext?: {
57
58
  policyId?: string;
58
59
  matchedRule?: string;
package/dist/index.js CHANGED
@@ -106,6 +106,11 @@ function FastGRCPlugin(options) {
106
106
  timeoutMs = DEFAULT_TIMEOUT_MS,
107
107
  baseUrl = DEFAULT_BASE_URL
108
108
  } = options;
109
+ if (!apiKey) {
110
+ console.warn(
111
+ '[fastgrc] FastGRCPlugin: apiKey is not set \u2014 all tool calls will proceed unchecked.\nHardcode the key in openclaw.config.ts: FastGRCPlugin({ apiKey: "fgrc_k1_..." })\nNote: process.env.FASTGRC_API_KEY is only available when OpenClaw inherits your shell environment.'
112
+ );
113
+ }
109
114
  const dashboardUrl = `${baseUrl.replace(/\/$/, "")}/dashboard/agent-policies`;
110
115
  return {
111
116
  name: "fastgrc",
@@ -123,7 +128,7 @@ function FastGRCPlugin(options) {
123
128
  timeoutMs
124
129
  });
125
130
  if (!result) return { block: false };
126
- const { decision, reasoning, policyContext } = result;
131
+ const { decision, reasoning, policyContext, reasonTags } = result;
127
132
  const matchedRule = policyContext?.matchedRule ?? "policy rule";
128
133
  if (decision === "block") {
129
134
  return { block: true, reason: `[${matchedRule}] ${reasoning}` };
@@ -134,6 +139,10 @@ function FastGRCPlugin(options) {
134
139
  reason: `${reasoning} \u2014 review at ${dashboardUrl}`
135
140
  };
136
141
  }
142
+ if (Array.isArray(reasonTags) && reasonTags.includes("override_block_active")) {
143
+ const msg = policyContext?.matchedRule ? `[FastGRC] Observability mode \u2014 would have blocked: [${policyContext.matchedRule}] ${reasoning}` : `[FastGRC] Observability mode \u2014 would have blocked: ${reasoning}`;
144
+ console.warn(msg);
145
+ }
137
146
  return { block: false };
138
147
  }
139
148
  }
package/dist/index.mjs CHANGED
@@ -79,6 +79,11 @@ function FastGRCPlugin(options) {
79
79
  timeoutMs = DEFAULT_TIMEOUT_MS,
80
80
  baseUrl = DEFAULT_BASE_URL
81
81
  } = options;
82
+ if (!apiKey) {
83
+ console.warn(
84
+ '[fastgrc] FastGRCPlugin: apiKey is not set \u2014 all tool calls will proceed unchecked.\nHardcode the key in openclaw.config.ts: FastGRCPlugin({ apiKey: "fgrc_k1_..." })\nNote: process.env.FASTGRC_API_KEY is only available when OpenClaw inherits your shell environment.'
85
+ );
86
+ }
82
87
  const dashboardUrl = `${baseUrl.replace(/\/$/, "")}/dashboard/agent-policies`;
83
88
  return {
84
89
  name: "fastgrc",
@@ -96,7 +101,7 @@ function FastGRCPlugin(options) {
96
101
  timeoutMs
97
102
  });
98
103
  if (!result) return { block: false };
99
- const { decision, reasoning, policyContext } = result;
104
+ const { decision, reasoning, policyContext, reasonTags } = result;
100
105
  const matchedRule = policyContext?.matchedRule ?? "policy rule";
101
106
  if (decision === "block") {
102
107
  return { block: true, reason: `[${matchedRule}] ${reasoning}` };
@@ -107,6 +112,10 @@ function FastGRCPlugin(options) {
107
112
  reason: `${reasoning} \u2014 review at ${dashboardUrl}`
108
113
  };
109
114
  }
115
+ if (Array.isArray(reasonTags) && reasonTags.includes("override_block_active")) {
116
+ const msg = policyContext?.matchedRule ? `[FastGRC] Observability mode \u2014 would have blocked: [${policyContext.matchedRule}] ${reasoning}` : `[FastGRC] Observability mode \u2014 would have blocked: ${reasoning}`;
117
+ console.warn(msg);
118
+ }
110
119
  return { block: false };
111
120
  }
112
121
  }
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
- {
2
- "name": "fastgrc-openclaw",
3
- "version": "1.0.1",
4
- "description": "FastGRC agent compliance plugin for OpenClaw — evaluates every tool call against your policy before it executes",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
13
- }
14
- },
15
- "bin": {
16
- "fastgrc-hook": "./dist/bin.js"
17
- },
18
- "files": [
19
- "dist",
20
- "README.md"
21
- ],
22
- "scripts": {
23
- "build": "tsup && node -e \"require('fs').chmodSync('dist/bin.js', '755')\"",
24
- "dev": "tsup --watch",
25
- "typecheck": "tsc --noEmit"
26
- },
27
- "keywords": [
28
- "fastgrc",
29
- "openclaw",
30
- "ai-agent",
31
- "compliance",
32
- "policy",
33
- "security"
34
- ],
35
- "author": "FastGRC <support@fastgrc.ai>",
36
- "license": "MIT",
37
- "devDependencies": {
38
- "tsup": "^8.0.0",
39
- "typescript": "^5.0.0"
40
- },
41
- "engines": {
42
- "node": ">=18"
43
- }
44
- }
1
+ {
2
+ "name": "fastgrc-openclaw",
3
+ "version": "1.0.3",
4
+ "description": "FastGRC agent compliance plugin for OpenClaw — evaluates every tool call against your policy before it executes",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "fastgrc-hook": "./dist/bin.js"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsup && node -e \"require('fs').chmodSync('dist/bin.js', '755')\"",
24
+ "dev": "tsup --watch",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "keywords": [
28
+ "fastgrc",
29
+ "openclaw",
30
+ "ai-agent",
31
+ "compliance",
32
+ "policy",
33
+ "security"
34
+ ],
35
+ "author": "FastGRC <support@fastgrc.ai>",
36
+ "license": "MIT",
37
+ "devDependencies": {
38
+ "tsup": "^8.0.0",
39
+ "typescript": "^5.0.0"
40
+ },
41
+ "engines": {
42
+ "node": ">=18"
43
+ }
44
+ }