A secure multi‑agent execution engine for zero‑exposure automation. Store, execute, and delegate scripts or credentials locally with full encryption, sealed distribution, and argparse‑driven structured execution.
安全
Multi-Agent Safe-Cooperation (Single Device)
试用A single-device multi-Agent task chain collaboration methodology based on MGC. Through Master Agent orchestration, Script Agent scripting, and Executor Agent execution, achieves zero-exposure security collaboration for sensitive resources. Adapted to MGC 1.4.10.
它能做什么
A single-device multi-Agent task chain collaboration methodology based on MGC. Through Master Agent orchestration, Script Agent scripting, and Executor Agent execution, achieves zero-exposure security collaboration for sensitive resources. Adapted to MGC 1.4.10.
技能文档
Multi-Agent Safe-Cooperation (Single Device)
One-Line Description
A single-device multi-Agent task chain collaboration methodology based on MGC. Through Master Agent orchestration, Script Agent scripting, and Executor Agent execution, achieves zero-exposure security collaboration for sensitive resources.
Problem Solved
| Pain Point | Solution |
|---|---|
| Multiple Agents sharing environment, keys easily leaked | Store keys in MGC, agents execute without exposure |
| Script content exposed to all Agents | Store scripts in MGC, zero exposure during execution |
| Lack of task collaboration methodology | Master Agent task chain orchestration template |
| Sub-Agent unauthorized access to sensitive resources | Executor Agent prompt constraints |
Core Concepts
MGC's Role in Collaboration
MGC is the local sensitive resource hosting and execution layer (skill_spec.md §1):
- User stores keys and scripts via WebUI (browser or
mgc_open_webui) - Script Agent writes scripts and stores them in MGC via
mgc_save(MGC 1.4.10 auto-parsesargparsedefaults intoext02) - Master Agent orchestrates the task chain, specifies call timing; can execute directly when sub-Agents fail or with user authorization
- Executor Agent only calls
mgc_run, never touches keys or scripts
Four Roles
| Role | Responsibility | Capabilities |
|---|---|---|
| User | Store keys/scripts, issue commands | WebUI / mgc_open_webui |
| Master Agent | Task decomposition, orchestration, execute on authorization/sub-Agent failure | mgc_list, mgc_find, mgc_run |
| Script Agent | Write scripts, store in MGC | mgc_save, mgc_list, mgc_find |
| Executor Agent | Complete non-sensitive tasks | mgc_run, mgc_list, mgc_find |
Note:
mgc_getretrieves plaintext and is a sensitive operation requiring user authorization; Script Agent typically does not need it.
Collaboration Flow
User ──Store Keys/Scripts (WebUI)──> MGC
│
▼
User ──Issue Command──> Master Agent
│
├──Decompose Task Chain
│
▼
┌───────┴───────┐
▼ ▼
Script Agent Executor Agent
(Write Scripts) (Execute Tasks)
│ │
▼ ▼
mgc_save mgc_run
│ │
└───────┬───────┘
▼
MGC Execution
(Return pid+status)
Quick Start
Prerequisites
- Install MGC v1.4.9+ (1.4.10 recommended):
pip install mgc-blackbox>=1.4.9 - Start MGC:
mgc(API port 57219, WebUI port 57218) - Configure MCP (add to AI client):
{ "mcpServers": { "mgc-blackbox": { "command": "mgc", "args": ["--mcp"], "env": { "PYTHONIOENCODING": "utf-8" } } } } - Store sensitive resources via WebUI or
mgc_open_webui: API keys, database credentials, business scripts - Load prompt templates into each Agent
Sandbox mode (1.4.9+): When running inside a sandbox Agent (Trae Work / Workbuddy), install MGC in the system environment; otherwise MCP operations may be limited — in that case, call FastAPI directly.
Step 1: Configure Master Agent
Load prompts/master_agent.md into the Master Agent's system prompt.
Step 2: Configure Script Agent
Load prompts/script_agent.md.
Step 3: Configure Executor Agent
Load prompts/executor_agent.md.
Step 4: Start Collaboration
After user issues a command, the Master Agent automatically decomposes the task chain and coordinates sub-Agents.
Prompt Templates
| File | Purpose |
|---|---|
| prompts/master_agent.md | Master Agent: task decomposition, orchestration, mgc_find lookup |
| prompts/script_agent.md | Script Agent: mgc_save to store scripts, mgc_find for collision check |
| prompts/executor_agent.md | Executor Agent: mgc_run to execute scripts |
| prompts/cooperation_best_practice.md | Best-practice document, auto-maintained by Master Agent |
MGC Tool Usage
mgc_save (Used by Script Agent)
# Store script (ext01 required; ext02 optional — MGC 1.4.10 auto-parses argparse defaults)
mgc_save(
info_type="script",
info_owner="Data Query Script",
ext01="python",
content="""import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--query', default='default')
args = parser.parse_args()
print(args.query)"""
)
mgc_find (1.4.10 new, fuzzy search)
Used to fuzzy-match entries by info_owner / diff fields. Never returns content plaintext.
# Find scripts whose owner contains "query"
scripts = mgc_find(info_owner="query", match_mode="substring", limit=50)
# match_mode: substring (%x%) / prefix (x%) / suffix (%x) / exact (x)
mgc_run (Used by Executor Agent, 1.4.7+ blackbox execution)
⚠️ Important (1.4.10 contract):
ext02must be a JSON array string, matching the script'sargparseargv list. Dict-style{"k":"v"}is no longer accepted and triggers HTTP 422.Auto-parsing: After Script Agent stores a script, MGC auto-fills
ext02fromargparsedefaults. Executor Agent can omitext02to use defaults.
import json
# Recommended: build JSON array string with json.dumps
params = ["--query", "2026-08-08"]
result = mgc_run(
info_type="script", # required, type is script
info_owner="Data Query Script", # required, script name
diff_1="v1", # required to uniquely identify when multiple entries share the owner
ext02=json.dumps(params) # optional JSON array string: '["--query", "2026-08-08"]'
)
# Returns: {"pid": 12345, "status": "started"}
# Note: mgc_run does not return stdout; for results, the script should write to a file and print the path
mgc_list (All Agents, exact match)
Note:
mgc_listonly lists entry metadata. Since 1.4.10 prefermgc_findfor fuzzy lookup.
scripts = mgc_list(info_type="script")
mgc_open_webui (User)
Used to have AI open MGC WebUI for users to store sensitive resources.
mgc_open_webui()
ext02 Auto-Parsing (1.4.10 Important Change)
Since MGC 1.4.10, when storing a script it auto-parses argparse literal defaults and stores them as a JSON array string in ext02:
# After Script Agent's mgc_save, MGC auto-fills ext02:
# '["--start", "2026-08-08", "--verbose"]'
# Executor Agent can omit ext02 to use defaults
mgc_run(info_owner="my_script", diff_1="my_script")
# Or override at runtime
mgc_run(
info_owner="my_script",
diff_1="my_script",
ext02='["--start", "2026-12-25"]'
)
Dynamic defaults are not supported (e.g. datetime.now(), os.path.expanduser("~"), f-strings). MGC returns dynamic_args_detected warning and asks you to set ext02 manually. Script Agent should always use literal defaults.
Security Boundaries
What This Skill Provides
- Collaboration methodology framework
- Prompt templates
- MGC tool usage specifications
What This Skill Does NOT Provide
- MGC permission enforcement (relies on prompt constraints)
- Automatic key management
- Agent identity authentication
⚠️ Important Reminders
- All sensitive resources must be stored by users via MGC WebUI
- Executor Agent can only call
mgc_run; must never read script content - Master Agent must clearly inform sub-Agents of call timing and script location
- After sensitive operation results return, Master Agent is responsible for updating task status and coordinating sub-Agent collaboration
ext02must be a JSON array string (e.g.["--flag","value"]); never use dict-style
FAQ
| Question | Answer |
|---|---|
| Will information stored in MGC sync to cloud? | MGC is a local tool with no active network capability |
| What are MGC's main capabilities? | After installing MGC, click the MGC Skills button (1.4.7+) in the WebUI top bar |
| Can sub-Agents bypass MGC? | Prompt constraints cannot fully prevent; ensure sub-Agents cannot access local script files |
| How to isolate scripts for different tasks? | Use info_owner naming, e.g., TaskA_QueryScript, TaskB_PublishScript |
| How does Master Agent know what scripts are available? | Use mgc_find (fuzzy) or mgc_list (exact), or have Script Agent report |
mgc_run returns HTTP 422, what to do? | ext02 must be a JSON array string; use json.dumps(["--flag","value"]) |
How to handle dynamic_args_detected warning? | Use literal defaults (not datetime.now() etc.) or pass ext02 manually |
| MCP unavailable in sandbox mode? | Install MGC in system environment, or call FastAPI directly at /api/mgc/sensitive/run |
Related Resources
- MGC Core Repository: https://github.com/zkeviny/MGC-Blackbox
- MGC Installation:
pip install mgc-blackbox>=1.4.9 - WebUI: http://127.0.0.1:57218
- API: http://127.0.0.1:57219
- MGC API Auth Token:
~/.mgc/database/mgc_black_box/.mgc_token - Feedback: mirgincipher@outlook.com
Changelog
v1.1.0
- Upgraded to adapt to MGC 1.4.10
- Fixed
mgc_runext02signature: must be a JSON array string - Added
mgc_findfuzzy search tool - Documented
ext02auto-parsing (1.4.10) - Documented that
mgc_runreturns only pid+status (no stdout) - Added 1.4.9 sandbox mode note
- Updated MGC main skill doc reference to WebUI "MGC Skills" button
v1.0.0
- Initial release
- Provides Master / Script / Executor Agent prompt templates
- Includes complete collaboration flow documentation
相关技能
Zero‑exposure script execution using MGC Blackbox. Store scripts encrypted, execute in blackbox, AI sees no plaintext. Supports MCP (mgc_run) / API / WebUI execution, internal credential calls, and script sealing. Includes MGC 1.4.9 temporary workaround guidelines. This skill only executes scripts w
A documentation‑only meta‑skill that teaches AI agents how to generate secure, zero‑exposure skills using MGC Blackbox 1.4.10. Credentials are stored encrypted; local scripts read them via HTTP API at runtime, while AI agents never touch plaintext.
A comprehensive governance system for managing agent roles, responsibilities, handoff policies, and conflict resolution in multi-agent environments
Coordinate deep, source-verifiable research projects in OpenClaw using AgentSkills-compatible folders, local artifact tracking, and explicit evidence ledgers...
把原始多 Agent 框架升级为 Claude Code 风格的工程化系统:记忆检索、角色协同、强证据验收、命令前置安全审计。