{"_id":"@amanda-lakera/openclaw-plugin-lakera-guard","_rev":"2-e2b677e44cf55515a50518574c1f4df2","name":"@amanda-lakera/openclaw-plugin-lakera-guard","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@amanda-lakera/openclaw-plugin-lakera-guard","version":"0.1.0","_id":"@amanda-lakera/openclaw-plugin-lakera-guard@0.1.0","maintainers":[{"name":"amanda-lakera","email":"amanda.eliasson@lakera.ai"}],"homepage":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard#readme","bugs":{"url":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard/issues"},"dist":{"shasum":"f0ad4f01fef75997e20e96bb49366f1476319228","tarball":"https://registry.npmjs.org/@amanda-lakera/openclaw-plugin-lakera-guard/-/openclaw-plugin-lakera-guard-0.1.0.tgz","fileCount":6,"integrity":"sha512-z+rIfpHhkKDdW2HxRjceYXGohAEQV/EJqRAmlUvQOn8NORUEFgOaGipzvzwFkyovkaoL83i5ZzaW1DFK7m8eQg==","signatures":[{"sig":"MEQCIEzbhJezNUr5M4Ns/RVyT/7A/znxqSZWwTJFkWJwJBpxAiALVCtG63ifKM6dtO3rr2+ZO4FNcUC3Z1ffdYUVSAEvpg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11552},"main":"index.ts","type":"module","_from":"file:amanda-lakera-openclaw-plugin-lakera-guard-0.1.0.tgz","scripts":{"test":"vitest run","test:watch":"vitest"},"_npmUser":{"name":"amanda-lakera","email":"amanda.eliasson@lakera.ai"},"openclaw":{"extensions":["./index.ts"]},"_resolved":"/private/var/folders/0w/hkv8jxlj0hs9r44dw0558tqc0000gn/T/4e186a89d022cd0ef2270152d64a8c70/amanda-lakera-openclaw-plugin-lakera-guard-0.1.0.tgz","_integrity":"sha512-z+rIfpHhkKDdW2HxRjceYXGohAEQV/EJqRAmlUvQOn8NORUEFgOaGipzvzwFkyovkaoL83i5ZzaW1DFK7m8eQg==","repository":{"url":"git+ssh://git@github.com/amanda-lakera/openclaw-plugin-lakera-guard.git","type":"git"},"_npmVersion":"10.9.2","description":"OpenClaw plugin: screen tool calls with Lakera Guard and block if flagged","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/openclaw-plugin-lakera-guard_0.1.0_1770385667209_0.7725960802196001","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@amanda-lakera/openclaw-plugin-lakera-guard","version":"0.1.1","description":"OpenClaw plugin: screen tool calls with Lakera Guard and block if flagged","type":"module","main":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/amanda-lakera/openclaw-plugin-lakera-guard.git"},"scripts":{"test":"vitest run","test:watch":"vitest"},"devDependencies":{"vitest":"^2.1.0"},"openclaw":{"extensions":["./index.ts"]},"_id":"@amanda-lakera/openclaw-plugin-lakera-guard@0.1.1","gitHead":"447486ea57675b7b1bacc556005f31ad4390a359","bugs":{"url":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard/issues"},"homepage":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard#readme","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-pbduARNYVbRrzZkyzGzm7oMyu7QxjvEPqYhNMFmJ9XmM4jkXQboqy9zWMC+oQpc/DbwIeKHDm/K4SFOs9j4vBw==","shasum":"2cec35a71dd76b2043763271d6a22a7cd12624bd","tarball":"https://registry.npmjs.org/@amanda-lakera/openclaw-plugin-lakera-guard/-/openclaw-plugin-lakera-guard-0.1.1.tgz","fileCount":6,"unpackedSize":11637,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDYhUgVeXv7kzvH+2Z8pfDhGNqQfwGgD+1t7rCUsg1A7gIgNoyhOwFP/KHRB79foUrC0z9SrRfe4U8HKTBz3Q4rYh0="}]},"_npmUser":{"name":"amanda-lakera","email":"amanda.eliasson@lakera.ai"},"directories":{},"maintainers":[{"name":"amanda-lakera","email":"amanda.eliasson@lakera.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openclaw-plugin-lakera-guard_0.1.1_1770388510116_0.39323133907671015"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-06T13:47:47.132Z","modified":"2026-02-06T14:35:10.358Z","0.1.0":"2026-02-06T13:47:47.334Z","0.1.1":"2026-02-06T14:35:10.251Z"},"bugs":{"url":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard/issues"},"homepage":"https://github.com/amanda-lakera/openclaw-plugin-lakera-guard#readme","repository":{"type":"git","url":"git+ssh://git@github.com/amanda-lakera/openclaw-plugin-lakera-guard.git"},"description":"OpenClaw plugin: screen tool calls with Lakera Guard and block if flagged","maintainers":[{"name":"amanda-lakera","email":"amanda.eliasson@lakera.ai"}],"readme":"# Lakera Guard OpenClaw Plugin\n\nScreens every tool call with [Lakera Guard](https://www.lakera.ai/) and blocks execution when content is flagged.\n\n## Install\n\nFrom this repo ([amanda-lakera/openclaw-plugin-lakera-guard](https://github.com/amanda-lakera/openclaw-plugin-lakera-guard)):\n\n```bash\ngit clone git@github.com:amanda-lakera/openclaw-plugin-lakera-guard.git\nopenclaw plugins install -l ./openclaw-plugin-lakera-guard\n```\n\nOr from npm:\n\n```bash\nopenclaw plugins install @amanda-lakera/openclaw-plugin-lakera-guard\n```\n\n## Configure\n\nSet your Lakera API key and optional project ID under the plugin config:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"openclaw-plugin-lakera-guard\": {\n        \"enabled\": true,\n        \"config\": {\n          \"apiKey\": \"your-lakera-api-key\",\n          \"projectId\": \"your-project-id\",\n          \"timeoutMs\": 5000\n        }\n      }\n    }\n  }\n}\n```\n\n- **apiKey** (required): From [Lakera Dashboard](https://platform.lakera.ai/).\n- **projectId** (optional): Lakera project for policy; omit to use default policy.\n- **timeoutMs** (optional): Request timeout; default 5000.\n\nRestart the OpenClaw gateway after enabling or changing config.\n\n## Behavior\n\n- Before each tool runs, the plugin sends the tool name and parameters to `https://api.lakera.ai/v2/guard` in OpenAI chat completions format.\n- If the response has `flagged: true`, the tool call is blocked and the user sees a block reason.\n- If the Guard request fails (network/API error), the tool is **not** blocked (fail-open). Edit the plugin to block on error for fail-closed.\n\n## Testing\n\n### Unit tests (no API key needed)\n\nFrom the plugin directory:\n\n```bash\npnpm install\npnpm test\n```\n\nTests mock the Lakera API and assert that the plugin sends the correct assistant `tool_calls` payload and blocks (or allows) based on the `flagged` response.\n\n### Manual test with OpenClaw\n\n1. Install and enable the plugin in OpenClaw (see Install and Configure above), then restart the gateway.\n2. Trigger a tool call, e.g. run the agent and ask for something that uses a tool:\n   ```bash\n   openclaw agent --message \"What's the weather in London?\"\n   ```\n3. In the [Lakera Dashboard](https://platform.lakera.ai/) you can inspect requests and flagging. To verify blocking: use a test policy that flags a specific tool or argument pattern, or call the Guard API directly with a known-bad payload and confirm the same call is blocked when triggered via OpenClaw.\n\n## Publishing\n\nFrom the plugin directory, after [logging in to npm](https://docs.npmjs.com/cli/v8/commands/npm-login) (`npm login` or `pnpm login`):\n\n```bash\npnpm publish --access public\n```\n\nScoped packages (`@amanda-lakera/...`) are private by default; `--access public` makes this package installable by anyone.\n","readmeFilename":"README.md"}