Mercury Agent Gives Open-Source AI a Permission Layer Before It Acts

Mercury Agent is an open-source, permission-first AI agent with multi-agent orchestration, a Second Brain memory system, and 40+ hardened tools that runs 24/7 from your terminal or chat apps.

·
·
·
Mercury Agent Gives Open-Source AI a Permission Layer Before It ActsPRO
  • Mercury Agent is an open-source, MIT-licensed AI agent with permission-hardened tools, token budgets, and multi-agent orchestration. GitHub
  • Every shell command and file write goes through a strict permission system; dangerous commands like sudo and rm -rf / are permanently blocked.
  • A Second Brain memory system uses SQLite with full-text search, split into conscious (working context) and subconscious (long-term recall) layers.
  • Autopilot detects agent loops by analyzing parameter diversity and success rates, stopping stuck execution paths automatically.
  • Runs across 6 channels (CLI, Web, Telegram, Discord, Slack, Signal) and supports 8+ LLM providers with automatic fallback. Docs
  • Install in one command: npm i -g @cosmicstack/mercury-agent && mercury; 126+ community skills available at skills.mercuryagent.sh.

Mercury Agent is a new open-source AI agent framework built around one idea most agent tools ignore: control. While tools like Open Interpreter and Claude Code can read your files, run shell commands, and fetch URLs, they typically do it quietly. Mercury asks first, tracks every token it spends, and never executes a dangerous command, no matter what the model decides.

The problem it's solving

Mercury is designed to run 24/7 as a persistent background process. Unlike stateless chatbots, it is an orchestrator built on a design philosophy of sovereignty and transparency: your agent's personality is defined by Markdown files you own, its actions are constrained by a blocklist-aware shell, and its resource consumption is capped by a daily token budget.

The core frustration it addresses is the gap between what agentic AI can do and what you actually want it to do unsupervised. Most frameworks give you capability; Mercury gives you capability with a leash you control.

How it works under the hood

The core agentic loop is managed by the Agent class using the Vercel AI SDK. It handles multi-step generateText calls, tool execution feedback, and lifecycle state management across states like unborn → birthing → idle → thinking → responding. The loop runs up to 25 steps, with graduated escalation if the agent gets stuck.

The permission model is where Mercury gets serious. Every tool call passes through a PermissionManager before it executes:

  • Filesystem scoping: Paths without scope get no access. The user can grant one-time (y), permanent (always), or deny (n) access. Grants are saved to ~/.mercury/permissions.yaml.
  • Shell blocklist: Commands like sudo *, rm -rf /, mkfs, fork bombs, shutdown, and reboot are blocked and never executed.
  • Auto-approved reads: Safe commands like ls, cat, pwd, and git status never prompt.
  • Approval queue: Risky writes like npm publish

Pro article

This story is for Pro members

You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.

Trending
  • No trending articles

Comments

avatar

Next Reads