Secure Data Analyst Skill Suite
Latest: v1.5.0
- Raised the minimum MGC version to 1.6.0+ across the skill.
- Added chain mode for distributing one sealed workflow to multiple nodes as independent sub-packages, with recipient verification guidance and documented constraints.
- Removed
skill-card.md.
Overview
Secure Data Analyst Skill Suite is a documentation skill suite built on MGC Blackbox 1.6.0+ that helps data analysts securely manage, on the local machine:
- Sensitive credentials
- User-owned scripts and workflows
- Workflow / skill-package sealed-authorization collaboration
- Analysis frameworks and knowledge
This suite uses a hybrid design:
- Skill prompts (under
prompts/): four core capabilities — credential management, workflow management, sealed-collaboration, knowledge management - Agent system-prompt template (
agent_system_prompt.md): builds a Data Analyst Agent that obeys strict security boundaries
All sensitive operations require explicit user authorization. This suite provides no automated data-access capability.
Scenarios
This suite is suitable for:
- In-house enterprise data analysis
- Scenarios requiring sensitive-data protection
- Secure sharing of scripts / workflows in team collaboration
- Safe use of vendor scripts
- Building a secure Data Analyst Agent
- Building a knowledge accumulation system (can pair with a Self-Improving Agent)
Prerequisites
- Install MGC Blackbox (≥ 1.6.0):
text pip install mgc-blackbox>=1.6.0 - Start the MGC service:
WebUI:text mgchttp://127.0.0.1:57218API:http://127.0.0.1:57219 - Available MCP tools (12):
mgc_save,mgc_save_file,mgc_get,mgc_run,mgc_find,mgc_list,mgc_seal,mgc_seal_package,mgc_package,mgc_delete,mgc_open_webui,mgc_skill - Token file:
~/.mgc/database/mgc_black_box/.mgc_token
Version requirement: the receiving node must run MGC 1.5.4+. Earlier versions cannot unseal a sealed package that carries link authorization, and will fail with a link-authorization error. Workflow auto-recognition: a workflow package carrying an
ext08call graph requires the receiver to run MGC 1.5.2+. Older versions can still import the package, but cross-script calls will not be routed through sealed execution, and MGC returns aTARGET_NODE_MAY_NOT_SUPPORT_AUTO_WORKFLOWwarning. Sandbox mode (1.4.9+): when running inside a sandbox agent (Trae Work / WorkBuddy), install MGC into the system environment — otherwise MCP tool calls may be blocked. In that case, call the FastAPI directly.
Core capabilities
1. Credential management (credential_management.md)
Securely manage sensitive credentials such as database keys and API tokens.
Scenarios
- Need to connect to databases or external services
- Scripts need safe access to credentials
- Team members share database/service access rights (not the data itself)
- Team members share analysis methods and scripts across the team and outside (via workflow sealed authorization)
What it provides
- Local encrypted storage
- AI never sees credential content
- Scripts can call credentials with zero exposure
- All accesses require user authorization
How the agent uses it
After user authorization, the agent reads credentials but never sees plaintext.
2. Workflow management (script_management.md)
Manage user-owned query / clean / analyze scripts — both single-script and workflow-folder modes.
Scenarios
- User wants to apply their own scripts or workflows
- Scripts need safe access to credentials
- Multi-script workflows need auto-recognition of import / subprocess call relationships (1.5.1+, including 1.5.4 cross-folder recognition)
- Workflows need cross-team collaboration (sealed)
- Need to build a complete data-analysis chain (query → clean → analyze)
What it provides
- Single-script encrypted storage (
mgc_save) - Workflow-folder encrypted storage with auto-recognition of import / subprocess (
mgc_save_file) - AI never sees script content
- Scripts call credentials with zero exposure
- Supports single-script sealing (
mgc_seal) and workflow sealing (mgc_seal_package) - All applications require user authorization
How the agent uses it
After user authorization, the agent runs scripts or workflows through MGC. In workflow mode, MGC auto-recognizes the import chain — no manual parameter chaining needed.
3. Sealed-authorization collaboration (collaboration_management.md)
Seal-authorize workflows and skill packages to other nodes, enabling "usable but not readable, runnable but not resellable" cross-team / cross-organization collaboration.
Scenarios
- Data team seals an analysis workflow to a business team (run only, no source access)
- Vendor analyst seals an analysis solution to a client
- Cross-department sharing of analysis methodologies while protecting core logic
- Independent license per client
- Public distribution of a general-purpose analysis workflow (free mode)
- Splitting one workflow across multiple nodes, each receiving only its own scripts (chain mode)
What it provides
- Workflow sealing (
mgc_seal_package): seal the entire workflow in one call; the script portion is double-layer encrypted - Skill-package sealing: seal a complete skill package (with SKILL.md); receiving AI can read the instructions but cannot see source code
- Node binding (p2p mode): the key is bound to the target node's RSA public key, so the package cannot be re-sealed for a third party
- Free mode (free mode): omit
ext04— no public-key exchange needed, and any 1.5.4+ node can import and run it - Link authorization: the sealed package binds the source node and the sealing mode; tampering with
ext07/ext09makes it unsealable - One-key-per-node: each client receives an independent key
- No cloud: all encryption / decryption / execution happens locally
- Multi-node distribution (chain mode, 1.6.0+): pass a targets array as
ext04tomgc_seal_package; one seal produces one independent sub-package per target node plusdistribution_index.jsonfor dispatch and verification - Under chain mode,
filescarries scripts only; data and credentials stay in each node's local MGC and are read at run time through the REST API
How the agent uses it
After user authorization, the agent performs the sealing operation. The sealed package is delivered by the user manually — the agent does not participate in transport.
4. Knowledge management (knowledge_management.md)
Manage knowledge assets: analysis frameworks, prompt templates, methodologies, business rules, and more.
Scenarios
- Build standardized analysis frameworks
- Reuse prompt templates
- Share analysis methods across the team
- Build a knowledge accumulation system
- Pair with a Self-Improving Agent for automatic knowledge capture
What it provides
- Encrypted storage of knowledge content
- Agent reads knowledge with explicit user authorization
- Knowledge sealed collaboration supported
- Used to build analysis-report structure
How the agent uses it
After user authorization, the agent reads knowledge and uses it to guide analysis structure or generate prompts.
1.5.4 Sealing Security Model
Double-layer encryption structure
Since 1.5.4 every sealing goes through the double-layer chain:
Layer 1: content = AES-256-CBC(script body, one-time AES_KEY_4)
Layer 2: AES_KEY_4 = RSA-2048 encryption (p2p: target node public key / free mode: shared default public key)
Layer 3: ext03 = AES-256-GCM(Layer-2 result, key = SHA256(ext07)[:32], AAD = ext09)
The Layer-3 key is derived from ext07 (source node public key), and ext09 (sealing mode) is bound as the AAD — this is where link authorization comes from.
Three sealing modes
Whether ext04 is passed — and in which shape — determines the sealing mode:
| p2p mode (default) | free mode | chain mode (1.6.0+) | |
|---|---|---|---|
| How to seal | Pass ext04=<target node multi-line PEM> | Omit ext04 | Pass ext04=<JSON array of targets> |
| Resulting ext09 value | p2p mode | free mode | chain mode |
| Sub-packages produced | 1 | 1 | N (one per target) |
| Who can unseal and run it | Only the node holding the matching private key | Any MGC 1.5.4+ node | Each target's own node only |
| Is the source script readable | No | No (decrypted in memory only) | No |
| Does it need public-key exchange | Yes | No | Yes — collect every target's node_pub first |
| Extra artifact | — | — | distribution_index.json |
| Best for | Per-customer authorization, confidential delivery | Public distribution, skill marketplaces, general install packages | Multi-node collaboration, task splitting across nodes |
Free mode suits "give the general-purpose analysis tool to everyone". It is not suitable when authorization must be differentiated per customer. The parameter name must be
ext04. Writing it asnode_pub/target_pub/public_keyetc. immediately raisesUNKNOWN_PARAM— there is no silent downgrade.
chain mode in practice
Targets array (scripts only — data and credentials must not be included):
[
{"node_pub": "<node A PEM>", "files": ["run_query.py", "shared_helper.py"]},
{"node_pub": "<node B PEM>", "files": ["run_analyze.py", "shared_helper.py"]}
]
mgc_seal_package(
info_owner="monthly_sales_analysis",
diff_2="monthly_sales_analysis",
ext04="@/abs/path/chain_targets.json", # or json.dumps(targets)
output_dir="./delivery",
)
Output layout:
./delivery/monthly_sales_analysis__monthly_sales_analysis/
├── distribution_index.json # package_index / dir_name / package_file_name / granted_files / sha256
├── task_package_01/ # node A only
│ └── ...__01.mgc_file
└── task_package_02/ # node B only
└── ...__02.mgc_file
Each receiver imports only its own .mgc_file, verifies granted_files against the task card, and then runs it. distribution_index.json records every sub-package's sha256, so integrity can be checked both before dispatch and after download.
chain-mode hard constraints:
- Flat directory only: the sealed import hook resolves cross-script imports at the same level. Convert
helpers/query.pyintoquery.py(andfrom query import ...) before sealing. filesmust exactly matchdiff_3: runmgc_findaftermgc_save_fileto confirm.- Scripts only in
files: CSV / JSON / config files are plaintext inside the package. Keep data and credentials in each node's local MGC and read them from within the script. UNSEAL_FAILEDat run time means the sub-package was sent to the wrong node or the.mgc_filewas renamed.
Link authorization
Every sealed artifact produced in 1.5.4 carries the source node identity (ext07) and the sealing mode (ext09). On unsealing, MGC validates them in order:
- Derive the outer key
SHA256(ext07)[:32]fromext07 - Use
ext09as the AAD to verify ciphertext integrity - On failure →
UNSEAL_FAILED
Therefore any change to ext07 or ext09 (even adding a single space) makes the artifact unsealable.
Hands-on verification
The following steps can be completed on a single machine, no second node required. Verifying with a single-script capsule is the most direct route — the capsule is a self-describing JSON file, so fields are easy to edit:
# 1. Seal a single script to produce a self-describing capsule
sealed = mgc_seal(
info_owner="my_script",
output_dir="/tmp/probe",
)
# → /tmp/probe/my_script_<YYYYMMDD_HHMMSS>/sealed_capsule.json
# 2. Tamper with ext09: add a trailing space to the ext09 value in the capsule JSON, save as tampered.json
# 3. Import the tampered artifact and run it
mgc_save_file(path="/tmp/probe/tampered.json", info_owner="probe_tampered")
mgc_run(info_owner="probe_tampered", diff_3="my_script")
Observed result:
Error: UNSEAL_FAILED
→ Hint: Double-layer unseal failed: AES-GCM auth tag mismatch:
source_node_pub (ext07) or mode (ext09) tampered, or wrong key.
For a workflow package (.mgc_file), ext09 lives in the record inside the package's MGCFILE.json — a zip entry, so the same tamper test requires unzipping, editing, and re-packing. The mechanism is identical; only the carrier differs.
Decrypting with a mismatched private key yields Double-layer unseal failed: Incorrect decryption — this is exactly the node-binding effect of p2p mode.
ext07is a plaintext identifier in the artifact, not a signature. It provides tamper detection and key binding; it does not replace identity verification. The receiver should still verify the source node public key through a trusted channel.
Security boundary
This suite provides
- Local encrypted credential storage
- Zero-exposure application of user-owned scripts
- Workflow auto-recognition and sealed routing (including cross-folder subprocess calls)
- Sealed-authorization collaboration for workflows / skill packages (p2p mode, free mode, and chain mode for multi-node distribution)
- Verifiable artifact integrity thanks to link authorization and
distribution_index.jsonsha256 - Knowledge encryption management
This suite does NOT provide
- Automated data access
- Automated cleaning or analysis
- Automated transport
- Script generation or modification
All scripts must be user-provided and comply with organizational policy.
Scope of the guarantee: MGC protects content confidentiality. After unsealing, the script runs with the permissions of the user running it; which commands it invokes, which files it reads or writes, and which network endpoints it reaches are all outside MGC's control — those behaviors are the script author's responsibility.
File structure
data-analyst-secure-suite/
├── SKILL.md # main document (this file)
├── README.md # detailed usage guide
├── manifest.json # skill metadata
├── agent_system_prompt.md # Agent system-prompt template
└── prompts/
├── credential_management.md # credential management
├── script_management.md # workflow & script management
├── collaboration_management.md # sealed collaboration
└── knowledge_management.md # knowledge management
Usage modes
Mode 1 — Skill mode
The AI can read the four core prompts under prompts/:
| Document | When to use | Triggered by |
|---|---|---|
credential_management.md | Need to store or access credentials | user or agent |
script_management.md | Need to store or run a script/workflow | user or agent |
collaboration_management.md | Need to seal a workflow / skill package to another node | user or agent |
knowledge_management.md | Need to store or read knowledge | user or agent |
The AI cites the matching document on user request and asks for authorization before every sensitive operation.
Mode 2 — Agent template mode
Set agent_system_prompt.md as the system prompt for an AI Agent.
The agent will automatically enforce:
- Request user authorization before every sensitive operation
- Only apply scripts or workflows through MGC Blackbox
- Never view script content or credentials
- Never automate workflow execution
- Never auto-select a script name (
info_ownermust be supplied by the user)
After authorization, the agent may cite documents under prompts/ as workflow guidance.
MCP tools reference
| Tool | Description | Authorization required |
|---|---|---|
mgc_save | Store credentials, single scripts, prompts | yes |
mgc_save_file | Store workflow folders (auto-recognize import / subprocess); import .mgc_file sealed packages | yes |
mgc_get | Retrieve a value / fetch node_pub / read a file inside a package | yes |
mgc_run | Run a script or workflow (black-box) | yes |
mgc_find | Fuzzy-search entries by name (does not accept info_type) | optional |
mgc_list | List stored entries | optional |
mgc_seal | Seal a single script (produces a self-describing capsule file) | yes |
mgc_seal_package | Seal an entire workflow folder (produces .mgc_file + README); pass a targets array as ext04 for chain-mode multi-node distribution | yes |
mgc_package | Plaintext export of a folder (archive within the same trust zone) | yes |
mgc_delete | Delete stored records (folder deletion requires a second user confirmation) | yes |
mgc_open_webui | Open MGC WebUI | no |
mgc_skill | Read the official MGC skill documentation | no |
Security notes
- Zero exposure: scripts and credentials execute locally; the AI receives only run status
- Encrypted storage: all content encrypted at rest
- No plaintext leak: the AI never sees script or credential content
- Auto-recognized workflows: import / from-import / relative-path / subprocess call chains auto-routed; nothing lands on disk; 1.5.4 adds cross-folder subprocess call support
- Sealed workflows / skill packages: entire workflow or skill package sealed to the target node in one call; node-bound; cannot be resold
- Free mode available: omit
ext04for free mode — any 1.5.4+ node can import and run it, and the source code remains unreadable - Link authorization: a sealed package whose
ext07/ext09was tampered with cannot be unsealed, so artifact integrity is verifiable - Deletion requires confirmation: when
mgc_deleteremoves folder-level records, the user must explicitly approve first — only then may the caller passconfirm_folder_delete="true" - Chain mode (1.6.0+): one seal produces N independent sub-packages, each unsealable only by its target node;
distribution_index.jsonrecordsgranted_filesandsha256, and unsealing failure at run time surfaces asUNSEAL_FAILED - Encryption boundary: MGC encrypts script files only. CSV / JSON / config files are plaintext inside a sealed package — therefore
filesmust carry scripts only, while data and credentials stay in local MGC
Contact
Reminder: This suite is for secure workflow management. All sensitive operations must have explicit user authorization. All scripts are user-owned; all execution happens locally through MGC Blackbox.
