fastgrc-openclaw
v1.0.36
Published
FastGRC agent compliance plugin for OpenClaw — evaluates every tool call against your policy before it executes
Downloads
4,513
Maintainers
Readme
fastgrc-openclaw
FastGRC compliance plugin for OpenClaw. Evaluates every agent tool call against your policy before it executes — blocking, flagging, or logging violations in real time.
Install
npm install fastgrc-openclawSetup (2 lines)
// openclaw.config.ts
import { FastGRCPlugin } from 'fastgrc-openclaw';
export default {
plugins: [
FastGRCPlugin({
apiKey: process.env.FASTGRC_API_KEY, // fgrc_k1_...
}),
],
};Set your environment variable:
FASTGRC_API_KEY=fgrc_k1_your_key_hereGet your API key at fastgrc.ai/connect?source=openclaw — free, no credit card.
Options
FastGRCPlugin({
apiKey: string; // Required. Your FastGRC API key.
policyId?: string; // Optional. Target a specific policy. Omit for org-wide default.
onBlock?: 'throw' // (default) Throw FastGRCBlockedError — OpenClaw surfaces it as an agent error
| 'warn' // console.warn and allow through
| 'silent'; // Allow through silently
timeoutMs?: number; // Max ms to wait for FastGRC API. Default: 3000. Fail-open on timeout.
baseUrl?: string; // Override FastGRC base URL. Default: https://app.fastgrc.ai
})How it works
The plugin registers a before_tool_call hook. For every tool invocation:
- Calls
POST /api/v1/policy-router/evaluatewith the tool name and arguments - On
decision: block→ throwsFastGRCBlockedError(OpenClaw surfaces this as an agent error with explanation) - On
decision: require_approval→ throwsFastGRCApprovalRequiredErrorwith a link to your dashboard - On
decision: allow | uncertain→ passes through silently - On timeout or network error → fail-open (allows through, logs a warning) — FastGRC never breaks your agent due to infra issues
Error types
import { FastGRCBlockedError, FastGRCApprovalRequiredError } from 'fastgrc-openclaw';
// Catch in your agent error handler:
if (err instanceof FastGRCBlockedError) {
console.log(err.matchedRule); // Which policy rule triggered
console.log(err.reasoning); // Human-readable explanation
console.log(err.policyId); // Policy that made the decision
}
if (err instanceof FastGRCApprovalRequiredError) {
console.log(err.dashboardUrl); // Link to approve in FastGRC dashboard
}Policy modes
Policies start in Observability Mode — violations are logged but never blocked. Switch to enforcement from your FastGRC dashboard when ready.
