registry  /  @defend-tech/opencode-optima  /  0.1.110

@defend-tech/opencode-optima@0.1.110

> Don't just code with AI. Build enterprise-grade software.

AI Security Review

scanned 5d ago · by lpm-firewall-ai

No confirmed malicious attack surface. The package is an OpenCode workflow plugin with explicit tools for Optima scaffolding, ClickUp/GitHub automation, QA browser control, and host sanitation.

Static reason
One or more suspicious static signals were detected.
Trigger
User installs/enables the OpenCode plugin or explicitly runs optima-sanitize-host/tools.
Impact
Can modify .optima/OpenCode workflow files and call configured APIs during intended use, but no hidden install-time execution or unconsented exfiltration was found.
Mechanism
Configured workflow automation and local project state management.
Rationale
Static inspection shows powerful but package-aligned OpenCode/ClickUp/GitHub workflow automation, gated by plugin loading, configuration, or explicit CLI/tool invocation. There is no lifecycle execution, hidden payload fetch, credential harvesting, or unconsented install-time AI-agent control-surface mutation.
Evidence
package.jsonscripts/optima-sanitize-host.jsdist/index.jsdist/sanitize_cli.jsREADME.mddocs/setup/CONFIGURATION.md.optima/.optima/.config/optima.yaml.optima/.config/generated/agents/.optima/.config/generated/policies/.optima/tasks/current.md.optima/tasks/done.md.optima/docs/scrs/current.md.optima/docs/scrs/done.md.gitignore~/.local/share/opencode_defend/opencode/opencode.db~/.optima_sanitize_backup/
Network endpoints6
api.clickup.com/api/v2/api.github.com/127.0.0.1:3001127.0.0.1:9223127.0.0.1:9222chatgpt.com/

Decision evidence

public snapshot
AI called this Clean at 86.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • dist/index.js config hook writes OpenCode agent config and sets default_agent, but only when loaded as the declared OpenCode plugin.
  • dist/sanitize_cli.js user-invoked CLI can migrate .optima artifacts and remove local agent/policy overrides after creating a backup.
  • dist/index.js contains configured ClickUp/GitHub/OpenCode API clients and local webhook listener code.
Evidence against
  • package.json has no install/postinstall lifecycle scripts; prepack is publish-time only.
  • scripts/optima-sanitize-host.js only imports source or dist CLI and calls main when user runs the script.
  • dist/index.js network use is package-aligned: ClickUp, GitHub, local OpenCode/OpenChamber, and Chrome CDP endpoints from config.
  • dist/index.js child_process use is limited to git/systemctl helper operations; dist/sanitize_cli.js uses ssh/python3 only for explicit host sanitation workflow.
  • No credential harvesting or exfiltration flow found; configured tokens are used as API auth headers for their services.
  • Prompt/agent assets are documented product behavior rather than hidden reviewer manipulation or install-time control-surface mutation.
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 3 file(s), 1.49 MB of source, external domains: 127.0.0.1, api.clickup.com, api.github.com, chatgpt.com, git-scm.com

Source & flagged code

5 flagged · loading source
dist/index.jsView file
9316import path5 from "node:path"; L9317: import { execFileSync } from "node:child_process"; L9318: function toGitPath(worktree, targetPath) {
High
Child Process

Package source references child process execution.

dist/index.jsView on unpkg · L9316
14591if (!script.trim()) return { ok: false, error: "script_required" }; L14592: const fn = new Function("page", "context", "browser", "artifactsDir", `return (async () => { L14593: ${script} ... L14599: } L14600: async function withQaBrowser({ provider = DEFAULT_QA_PROVIDER, cdpUrl = "", clickupTaskId = "", startUrl = "https://chatgpt.com/" } = {}, callback) { L14601: const chromium = await loadPlaywrightChromium(); L14602: const browser = await chromium.connectOverCDP(normalizeCdpUrl(cdpUrl), { L14603: timeout: Number(process.env.OPTIMA_QA_PLAYWRIGHT_CONNECT_TIMEOUT_MS || DEFAULT_QA_PLAYWRIGHT_CONNECT_TIMEOUT_MS) L14604: });
High
Same File Env Network Execution

A single source file combines environment access, network access, and code or shell execution; review context before blocking.

dist/index.jsView on unpkg · L14591
14079const browser = {}; L14080: const fn = new Function("cdp", "target", "artifactsDir", "command", "page", "context", "browser", `return (async () => { L14081: ${script}
Low
Eval

Package source references a known benign dynamic code generation pattern.

dist/index.jsView on unpkg · L14079
scripts/optima-sanitize-host.jsView file
9const cliPath = fs.existsSync(sourceCli) ? sourceCli : distCli; L10: const { main } = await import(cliPath); L11:
Medium
Dynamic Require

Package source references dynamic require/import behavior.

scripts/optima-sanitize-host.jsView on unpkg · L9
dist/sanitize_cli.jsView file
2592Cross-file remote execution chain: dist/sanitize_cli.js spawns dist/index.js; helper contains network access plus dynamic code execution. L2592: if (typeof node_buffer.Buffer === "function") { L2593: return node_buffer.Buffer.from(src, "base64"); L2594: } else if (typeof atob === "function") { ... L5197: yield* this.next(token); L5198: yield* this.end(forceDoc, endOffset); L5199: } ... L5201: *next(token) { L5202: if (node_process.env.LOG_STREAM) L5203: console.dir(token, { depth: null }); ... L7491: // WTF! L7492: // https://git-scm.com/docs/gitignore L7493: // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
High
Cross File Remote Execution Context

Source spawns a local helper that also contains network and dynamic execution context; review data flow before blocking.

dist/sanitize_cli.jsView on unpkg · L2592

Findings

4 High3 Medium6 Low
HighChild Processdist/index.js
HighShell
HighSame File Env Network Executiondist/index.js
HighCross File Remote Execution Contextdist/sanitize_cli.js
MediumDynamic Requirescripts/optima-sanitize-host.js
MediumNetwork
MediumEnvironment Vars
LowScripts Present
LowEvaldist/index.js
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License