registry  /  @alfe.ai/gateway  /  0.2.4

@alfe.ai/gateway@0.2.4

Alfe local gateway daemon — persistent control plane for agent integrations

AI Security Review

scanned 2d ago · by lpm-firewall-ai

Review flagged AI-agent configuration or capability changes. This remains warn-only unless evidence shows foreign-agent hijack through preinstall/install/postinstall, hidden persistence, exfiltration, remote code execution, or other concrete malicious behavior.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
User runs alfe-gateway daemon/start/install or imports exported daemon helpers.
Impact
Alfe cloud commands can update/restart the daemon/runtime, change runtime config, dispatch integration handlers, and mediate MCP tools for a configured agent.
Mechanism
Persistent agent gateway with cloud WebSocket commands, runtime spawning/upgrades, MCP/tool mediation, and optional user service install.
Rationale
Static inspection shows a powerful but package-aligned agent gateway: remote command handling, runtime process management, MCP mediation, and optional service persistence are activated by explicit daemon/install commands rather than npm lifecycle hooks. Because these capabilities can materially affect AI-agent control surfaces and execute updates/config changes, warn rather than mark clean, but there is no concrete malicious delivery behavior to block publishing.
Evidence
package.jsondist/bin/gateway.jsdist/health.jsdist/upgrade.jsdist/runtime-upgrade.jsdist/logger.jsREADME.md~/.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~/.alfe/.openclaw-mirror-migrated~/.openclaw/devices/pending.json
Network endpoints3
wss://gateway.alfe.ai/ws${apiEndpoint}/agents/me/workspace${apiEndpoint}/templates/:key/files

Decision evidence

public snapshot
AI called this Suspicious at 86.0% confidence as Dangerous Capability with medium false-positive risk.
Evidence for warning
  • dist/health.js starts a persistent Alfe daemon with WebSocket cloud control and local IPC when CLI user runs daemon/start/install.
  • dist/health.js handles cloud commands for daemon.update, runtime.update/restart, alfe.config_set, and integration command dispatch.
  • dist/health.js can spawn openclaw/hermes runtimes and run npm install -g for CLI/runtime upgrades after cloud command.
  • dist/health.js exposes MCP add/call/remove operations through the daemon IPC and bundler.
  • dist/health.js user-invoked install writes launchd/systemd service files for persistence.
Evidence against
  • package.json has no npm lifecycle hooks, so no install-time execution was found.
  • dist/bin/gateway.js requires explicit CLI commands; default usage only prints help.
  • Service persistence is behind explicit alfe-gateway install, not package install/import.
  • Network endpoints derive from Alfe config/token or gateway.alfe.ai and are package-aligned.
  • No credential harvesting beyond reading the Alfe API key/config needed for the gateway role was found.
  • Scanner eval hit appears to be bundled library feature detection, not decoded remote payload execution.
Behavioral surface
Source
ChildProcessCryptoDynamicRequireEnvironmentVarsEvalFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsUrlStrings
Manifest
NoLicense
scanned 6 file(s), 718 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
870try { L871: new Function(""); L872: return true;
High
Eval

Package source references dynamic code evaluation.

dist/health.jsView on unpkg · L870
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