📦 Portkey Guardrails — 实用工具

v1.0.0

用于 OpenClaw: 5 configurable rules block prompt injection, redact PII, flag off-scope responses, enforce agent budgets, 和...

0· 93·0 当前·0 累计
nissan 头像by @nissan (Nissan Dookeran)
0
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
high confidence
The package mostly implements local guardrail rules, but the hook dynamically imports an external workspace module that is not included in the package and some metadata (ollama required) and wiring are inconsistent — this mismatch could cause the hook to load code outside the skill or behave differently than described.
评估建议
Do not enable this hook in production without further checks. Specifically: 1) Verify where the handler will import runPreDispatchGuards/runPostDispatchGuards — inspect the host workspace path projects/portkey-gateway-integration/implementation/guardrails/index.ts the handler tries to load; if that file does not exist in your workspace, the handler as-written will fail to load the guardrail module or may import unintended code if a different project provides that path. 2) Confirm the external mo...
详细分析 ▾
用途与能力
The skill's stated purpose is to run five local guardrail rules offline (no external service). The repository includes rule implementations for G-01..G-05, and no credentials are requested. However, the hook's handler is written to dynamically import a guardrails implementation from projects/portkey-gateway-integration/implementation/guardrails/index.ts (outside the packaged rules). That import target is not present in the package manifest, creating an incoherence between the claimed self-contained implementation and what the hook actually tries to load. Also, the registry metadata lists 'ollama' as a required binary even though the SKILL.md and code describe Ollama as optional (semantic cache only).
指令范围
The hook handler extracts many context fields, sets process.env.OPENCLAW_WORKSPACE_ROOT (if unset), and then performs a dynamic import of a workspace-relative path. Dynamic import of an external workspace path means the hook may execute code that lives outside the skill bundle (the skill expects runPreDispatchGuards/runPostDispatchGuards to exist in that external module). The included rule files (rules/*.ts) appear to implement the rules but are not wired into handler.ts — the handler will not use them unless the external index re-exports or assembles them. This mismatch could cause unexpected behavior or execution of host workspace code. The handler also reads and relies on agent-local files (BUDGET.json) and documents audit logs under agents/<agentId>/guardrails-audit.md; those file accesses are coherent with the stated budget/audit features, but you should confirm file paths and permissions are acceptable for your environment.
安装机制
No install spec / downloads are present; the skill is instruction-only plus shipped source files. Nothing is fetched from external URLs during install, so there is no high-risk installer observed. Runtime, however, may dynamically import files from the workspace as noted above (not an installer risk but an execution-time risk).
凭证需求
The skill declares no required environment variables or credentials, which matches the 'no external service / no API key' claim. Minor incoherence: metadata requires the 'ollama' binary, but the SKILL.md and code say Ollama is optional (semantic cache Phase 3). Requiring Ollama as mandatory is disproportionate if you intend to run the guardrails offline. The handler also sets OPENCLAW_WORKSPACE_ROOT if unset, which modifies process-level environment state (potentially affecting other hooks/processes).
持久化与权限
The skill does not request 'always: true' and allows normal autonomous invocation. However, the handler's dynamic import of a workspace-relative path can cause the hook to execute code from elsewhere in the host workspace, which increases its effective privilege/persistence because it can piggyback on code outside the skill bundle. The handler also writes environment state (OPENCLAW_WORKSPACE_ROOT) if unset. These behaviors are not inherently malicious but raise privilege and scope concerns and should be audited before enabling in production.
SKILL.md:22
Prompt-injection style instruction pattern detected.
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install portkey-guardrails
镜像加速npx clawhub@latest install portkey-guardrails --registry https://cn.longxiaskill.com
数据来源ClawHub ↗ · 中文优化:龙虾技能库