registry  /  @alfe.ai/gateway  /  0.2.0

@alfe.ai/gateway@0.2.0

Alfe local gateway daemon — persistent control plane for agent integrations

AI Security Review

scanned 5d ago · by lpm-firewall-ai

No confirmed malicious attack surface. The package is a local Alfe gateway daemon with high-privilege, user-invoked control-plane features that match its README and CLI purpose.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
User runs alfe-gateway daemon/start/install or authenticated Alfe cloud sends daemon commands after configuration.
Impact
Can manage Alfe runtimes, integrations, MCP servers, and service persistence when explicitly started/configured.
Mechanism
Authenticated local daemon, WebSocket command bridge, service installer, runtime/MCP manager.
Rationale
Static inspection shows powerful daemon, persistence, WebSocket, child-process, and dynamic-import capabilities, but they are documented, user-triggered or authenticated service features with no lifecycle execution, hidden payload fetch/decode/execute, or unrelated exfiltration. Scanner labels appear noisy because the eval matches are bundled libraries and the persistence/network behavior is package-aligned.
Evidence
package.jsonREADME.mddist/bin/gateway.jsdist/src/index.jsdist/health.jsdist/upgrade.jsdist/runtime-upgrade.jsdist/logger.js~/.alfe/config.toml~/.alfe/gateway.sock~/.alfe/gateway.pid~/.alfe/logs/gateway.log~/Library/LaunchAgents/ai.alfe.gateway.plist~/.config/systemd/user/alfe-gateway.service/etc/systemd/system/alfe-gateway.service
Network endpoints2
wss://gateway.alfe.ai/ws127.0.0.1

Decision evidence

public snapshot
AI called this Clean at 86.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • dist/health.js accepts authenticated cloud COMMAND messages for daemon.update/runtime.update/restart and registered integration commands.
  • dist/health.js can write launchd/systemd units only via CLI install command.
  • dist/health.js exposes local IPC methods to add/remove MCP servers and call MCP tools.
  • dist/health.js can spawn openclaw/hermes runtimes and run npm install during explicit update commands.
Evidence against
  • package.json has no install/preinstall/postinstall lifecycle hooks.
  • dist/bin/gateway.js only dispatches user CLI commands; no import-time daemon start.
  • dist/health.js network use is aligned with documented Alfe API/WebSocket gateway behavior.
  • Scanner eval hits are vendored dependency code such as zod/es-errors, not remote decode/execute logic.
  • Persistence writes are explicit alfe-gateway install/start behavior documented in README.md.
  • No credential harvesting beyond reading configured Alfe API key for authenticated service operation.
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 6 file(s), 711 KB of source, external domains: 127.0.0.1, adaptivecards.io, aws.amazon.com, dotenvx.com, github.com, json-schema.org, www.apple.com, www.google.com, your-log-dashboard-url.com

Source & flagged code

6 flagged · loading source
dist/health.jsView file
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util"; ... L12: import { parse } from "smol-toml"; L13: import WebSocket from "ws"; L14: import { createConnection, createServer } from "node:net"; ... L327: } L328: const body = await res.json(); L329: if (!res.ok) return { ... L360: ok: true, L361: data: result.body.data L362: };
Critical
Remote Asset Decode Execute

Source fetches a remote non-code asset, decodes its contents, and dynamically executes the decoded payload.

dist/health.jsView on unpkg · L3
Trigger-reachable chain: manifest.main -> dist/src/index.js -> dist/health.js Reachable file contains a blocking source-risk pattern.
Critical
Trigger Reachable Dangerous Capability

A package entrypoint or install-time lifecycle script reaches a source file with blocking dangerous behavior.

dist/health.jsView on unpkg
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util";
High
Child Process

Package source references child process execution.

dist/health.jsView on unpkg · L3
864try { L865: new Function(""); L866: return true;
High
Eval

Package source references dynamic code evaluation.

dist/health.jsView on unpkg · L864
58}) : target, mod)); L59: var __require = /* @__PURE__ */ createRequire(import.meta.url); L60: //#endregion
Medium
Dynamic Require

Package source references dynamic require/import behavior.

dist/health.jsView on unpkg · L58
3import { mkdir, readFile, rename, stat, unlink, writeFile } from "node:fs/promises"; L4: import { execFile, execSync, spawn } from "node:child_process"; L5: import { promisify } from "node:util"; ... L12: import { parse } from "smol-toml"; L13: import WebSocket from "ws"; L14: import { createConnection, createServer } from "node:net"; ... L327: } L328: const body = await res.json(); L329: if (!res.ok) return { ... L360: ok: true, L361: data: result.body.data L362: };
Medium
Install Persistence

Source writes installer persistence such as shell profile or service configuration.

dist/health.jsView on unpkg · L3

Findings

2 Critical3 High5 Medium5 Low
CriticalRemote Asset Decode Executedist/health.js
CriticalTrigger Reachable Dangerous Capabilitydist/health.js
HighChild Processdist/health.js
HighShell
HighEvaldist/health.js
MediumDynamic Requiredist/health.js
MediumNetwork
MediumEnvironment Vars
MediumInstall Persistencedist/health.js
MediumStructural Risk Force Deep Review
LowScripts Present
LowFilesystem
LowHigh Entropy Strings
LowUrl Strings
LowNo License