registry  /  @letta-ai/letta-code  /  0.27.19

@letta-ai/letta-code@0.27.19

Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.

AI Security Review

scanned 3d ago · by lpm-firewall-ai

No confirmed malicious attack surface is established. The package has high-privilege AI-agent CLI capabilities and an install hook, but inspected behavior is aligned with a Letta Code CLI and user-invoked setup/runtime features.

Static reason
High-risk behavior combination matched malicious policy.
Trigger
npm install runs postinstall; user runs letta CLI for runtime features
Impact
Installs patched UI dependency files and operates a networked Letta agent CLI; no unconsented exfiltration or destructive behavior confirmed
Mechanism
vendor patching and interactive AI-agent CLI operations
Rationale
Static source inspection shows risky primitives, but they are package-aligned for an AI-agent terminal CLI and activated by install patching or user-invoked commands. No concrete malicious exfiltration, persistence, destructive action, or unconsented AI-agent control-surface mutation was found.
Evidence
package.jsonscripts/postinstall-patches.jsletta.jsskills/initializing-memory/scripts/view-session.shskills/initializing-memory/scripts/list-sessions.shvendor/ink/build/components/App.jsvendor/ink/build/hooks/use-input.jsvendor/ink/build/devtools.jsvendor/ink/build/log-update.jsvendor/ink/build/wrap-text.jsvendor/ink-text-input/build/index.js
Network endpoints5
api.letta.comapi.github.com/repos/sharkdp/fd/releases/latestgithub.com/sharkdp/fd/releases/download/raw.githubusercontent.com/letta-ai/agent-file/clawhub.ai/api/v1

Decision evidence

public snapshot
AI called this Clean at 86.0% confidence as Benign with medium false-positive risk.
Evidence for block
  • package.json postinstall runs scripts/postinstall-patches.js and chmods node-pty helper
  • scripts/postinstall-patches.js overwrites installed ink/ink-text-input files from bundled vendor copies and may rewrite letta.js shebang
  • letta.js can write user settings/keybindings and download fd from GitHub during user-invoked CLI runtime
Evidence against
  • package.json bin points to letta.js, a large bundled CLI for Letta agents; no obfuscated install payload found
  • postinstall-patches.js only copies local vendor UI patches, checks bun --version, and changes local CLI shebang
  • Network use in letta.js is product-aligned: Letta API, GitHub skill/agent/fd downloads, ClawHub skill registry, local WebSocket server
  • Credential handling is for LETTA_API_KEY/refresh tokens and local/keychain storage, not broad env harvesting or exfiltration
  • skills/initializing-memory scripts only inspect local Claude/Codex session files when explicitly run
  • No dependency confusion, destructive install behavior, persistence, or reviewer/prompt manipulation observed
Behavioral surface
Source
ChildProcessCryptoEnvironmentVarsFilesystemNetworkShellWebSocket
Supply chain
HighEntropyStringsObfuscatedUrlStrings
ManifestNo manifest risk signals triggered.
scanned 34 file(s), 480 KB of source, external domains: api.github.com, api.letta.com, app.letta.com, docs.expo.dev, github.com
Oversized source lightweight scan
letta.js32.7 MB file, sampled 256 KB
FilesystemChildProcessEnvironmentVarsCryptoHighEntropyStringsUrlStringsapi.letta.comapp.letta.comdocs.expo.dev

Source & flagged code

5 flagged · loading source
package.jsonView file
scripts.postinstall = node scripts/postinstall-patches.js || echo letta: vendor patches skipped && node -e "try{require('fs').chmodSync(require('path').join(require.resolve('node-pty/package.json'),'../...
Critical
Red Install Lifecycle Script

Install-time lifecycle script matches a deterministic static-gate block pattern.

package.jsonView on unpkg
scripts.postinstall = node scripts/postinstall-patches.js || echo letta: vendor patches skipped && node -e "try{require('fs').chmodSync(require('path').join(require.resolve('node-pty/package.json'),'../...
High
Install Time Lifecycle Scripts

Package defines install-time lifecycle scripts.

package.jsonView on unpkg
skills/initializing-memory/scripts/list-sessions.shView file
path = skills/initializing-memory/scripts/list-sessions.sh kind = build_helper sizeBytes = 3510 magicHex = [redacted]
Medium
Ships Build Helper

Package ships non-JavaScript build or shell helper files.

skills/initializing-memory/scripts/list-sessions.shView on unpkg
letta.jsView file
path = letta.js kind = oversized_source_file sizeBytes = 34288735 magicHex = [redacted]
High
Oversized Source File

Package contains source files above the static scanner size ceiling.

letta.jsView on unpkg
path = letta.js kind = oversized_cli_entrypoint sizeBytes = 34288735 magicHex = [redacted]
Medium
Oversized Cli Entrypoint

Package contains an oversized executable-looking CLI entrypoint.

letta.jsView on unpkg

Findings

1 Critical2 High5 Medium6 Low
CriticalRed Install Lifecycle Scriptpackage.json
HighInstall Time Lifecycle Scriptspackage.json
HighOversized Source Fileletta.js
MediumNetwork
MediumEnvironment Vars
MediumShips Build Helperskills/initializing-memory/scripts/list-sessions.sh
MediumOversized Cli Entrypointletta.js
MediumStructural Risk Force Deep Review
LowNon Install Lifecycle Scripts
LowScripts Present
LowFilesystem
LowObfuscated
LowHigh Entropy Strings
LowUrl Strings