---
title: "Mercury Agent Gives Open-Source AI a Permission Layer Before It Acts"
subtitle: "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."
url: "https://alphasignal.ai/news/mercury-agent-gives-open-source-ai-a-permission-layer-before-it-acts"
author: "AlphaSignal Newsroom"
author_url: "https://alphasignal.ai/editorial-team"
company: "AlphaSignal"
company_url: "https://alphasignal.ai/company/alphasignal"
published: "2026-06-18T10:58:42.000Z"
updated: "2026-06-18T19:45:21.595Z"
type: "Repo"
topics:
  - "Agents"
  - "Open Source"
subtopics:
  - "Agent Frameworks"
  - "Memory"
  - "Tool Use"
upvotes: 13
source_url: "https://github.com/cosmicstack-labs/mercury-agent"
comments: 0
truncated: true
---

# 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](https://github.com/cosmicstack-labs/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`

_Preview only. Full text requires an AlphaSignal Pro account._

## Sources

- [cosmicstack-labs/mercury-agent — GitHub](https://github.com/cosmicstack-labs/mercury-agent)
- [Mercury Agent — Official Site](https://mercuryagent.sh)
- [Mercury Agent — ARCHITECTURE.md](https://github.com/cosmicstack-labs/mercury-agent/blob/main/ARCHITECTURE.md)
- [Mercury Agent — DeepWiki Overview](https://deepwiki.com/cosmicstack-labs/mercury-agent)
- [Sub-Agents (Multi-Agent Mode) — Mercury Docs](https://mercury.cosmicstack.org/docs/integrations/sub-agents)
