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

@defend-tech/opencode-optima@0.1.112

> 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 was established by source inspection. The package is an opencode plugin/CLI with explicit project setup, integration, and QA automation functions, including powerful user-invoked browser scripting.

Static reason
One or more suspicious static signals were detected.
Trigger
Explicit import by opencode plugin runtime or user running optima-sanitize-host / plugin tools
Impact
Can modify project/opencode files and contact configured ClickUp/GitHub/local browser endpoints when the corresponding tools are invoked; no evidence of unconsented install/import-time abuse.
Mechanism
user-invoked opencode workflow automation and integrations
Rationale
Static source inspection shows powerful but package-aligned opencode automation, browser QA, and third-party integration features activated by explicit CLI/tool use rather than lifecycle or import-time behavior. I did not find concrete credential theft, hidden exfiltration, persistence, destructive behavior, or unconsented AI-agent control-surface mutation.
Evidence
package.jsonscripts/optima-sanitize-host.jsdist/index.jsdist/sanitize_cli.js.opencode/agent/*.md.opencode/plugin/optima/state.json.optima/**AGENTS.mdREADME.mddocs/**codemap.yml
Network endpoints5
api.clickup.com/api/v2api.github.com127.0.0.1:3001127.0.0.1:9223chatgpt.com/

Decision evidence

public snapshot
AI called this Clean at 82.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • package.json exposes main dist/index.js and bin dist/sanitize_cli.js but has no install/preinstall/postinstall hooks.
  • dist/index.js contains user-invoked tools that write opencode agents/config and project documentation files.
  • dist/index.js includes ClickUp/GitHub API clients and browser automation endpoints, gated behind configured tool calls.
  • dist/index.js uses dynamic Function for QA browser/CDP commands, a dangerous capability when invoked with user-supplied command JSON.
Evidence against
  • No lifecycle hook or import-time execution found in package.json.
  • scripts/optima-sanitize-host.js only imports dist/sanitize_cli.js main when run explicitly as a script.
  • Network endpoints are package-aligned integrations: api.clickup.com, api.github.com, localhost/127.0.0.1 CDP/opencode, chatgpt.com start URL.
  • No credential harvesting or broad env/file exfiltration pattern found; token-like fields are redacted in webhook audit artifacts.
  • Child process use appears limited to explicit git/host sanitization helper flows, not install-time execution.
  • File writes are explicit project/tool outputs such as .opencode agent config, docs, logs, screenshots, and locks.
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 3 file(s), 1.51 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
9380import path5 from "node:path"; L9381: import { execFileSync } from "node:child_process"; L9382: function toGitPath(worktree, targetPath) {
High
Child Process

Package source references child process execution.

dist/index.jsView on unpkg · L9380
14711if (!script.trim()) return { ok: false, error: "script_required" }; L14712: const fn = new Function("page", "context", "browser", "artifactsDir", `return (async () => { L14713: ${script} ... L14719: } L14720: async function withQaBrowser({ provider = DEFAULT_QA_PROVIDER, cdpUrl = "", clickupTaskId = "", startUrl = "https://chatgpt.com/" } = {}, callback) { L14721: const chromium = await loadPlaywrightChromium(); L14722: const browser = await chromium.connectOverCDP(normalizeCdpUrl(cdpUrl), { L14723: timeout: Number(process.env.OPTIMA_QA_PLAYWRIGHT_CONNECT_TIMEOUT_MS || DEFAULT_QA_PLAYWRIGHT_CONNECT_TIMEOUT_MS) L14724: });
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 · L14711
14159const browser = {}; L14160: const fn = new Function("cdp", "target", "artifactsDir", "command", "page", "context", "browser", `return (async () => { L14161: ${script}
Low
Eval

Package source references a known benign dynamic code generation pattern.

dist/index.jsView on unpkg · L14159
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