经 AI Skill Hub 精选评估,代码注入防护 获评「强烈推荐」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
代码注入防护 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
代码注入防护 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g opencode-injection-guard # 方式二:npx 直接运行(无需安装) npx opencode-injection-guard --help # 方式三:项目依赖安装 npm install opencode-injection-guard # 方式四:从源码运行 git clone https://github.com/remorses/opencode-injection-guard cd opencode-injection-guard npm install npm start
# 命令行使用
opencode-injection-guard --help
# 基本用法
opencode-injection-guard [options] <input>
# Node.js 代码中使用
const opencode_injection_guard = require('opencode-injection-guard');
const result = await opencode_injection_guard.run(options);
console.log(result);
# opencode-injection-guard 配置说明 # 查看配置选项 opencode-injection-guard --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export OPENCODE_INJECTION_GUARD_CONFIG="/path/to/config.yml"
Open-source prompt injection detection for OpenCode. Works with any model -- not locked to OpenAI.
An alternative to OpenAI Guardrails that runs as an OpenCode plugin, using a cheap/fast LLM as a judge to detect prompt injection in tool call outputs before they reach the main agent.
npm install opencode-injection-guard
Add to your opencode.json:
{
"plugin": ["opencode-injection-guard"]
}
You can import the plugin directly for use in custom OpenCode setups:
import { injectionGuard } from 'opencode-injection-guard'
The export is a standard OpenCode Plugin function.
.opencode/injection-guard.json:
{
"scanPatterns": ["bash:*", "webfetch:*"]
}
All fields are optional except scanPatterns:
| Field | Default | Description |
|---|---|---|
model | Auto-detected | Judge model in provider/model format |
confidenceThreshold | 0.7 | Minimum confidence (0.0-1.0) to block |
includeReasoning | false | Include explanation in the block message |
maxOutputLength | 8000 | Max chars of tool output sent to judge |
scanPatterns | [] (none) | Which tool calls to scan. You must set this. |
When both a config file and the environment variable exist, the environment variable wins for any field it sets. Unset fields fall back to the file, then to defaults.
OPENCODE_INJECTION_GUARD env var (highest priority)
|
.opencode/injection-guard.json (file, found via find-up)
|
hardcoded defaults (lowest priority)
该工具未明确声明开源协议,商业使用前请联系原作者确认授权范围,避免侵权风险。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
AI Skill Hub 点评:代码注入防护 的核心功能完整,质量优秀。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | opencode-injection-guard |
| Topics | 安全LLM工作流 |
| GitHub | https://github.com/remorses/opencode-injection-guard |
| 语言 | TypeScript |
收录时间:2026-06-09 · 更新时间:2026-06-09 · License:未公布 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端