A secure data analysis workflow suite based on MGC Blackbox 1.6.0+, providing credential protection, zero-exposure script & workflow application, workflow / skill-package sealed-authorization collaboration, and knowledge management. Supports 1.5.4 double-layer encryption with link authorization and
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:
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 ext08 call 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 a TARGET_NODE_MAY_NOT_SUPPORT_AUTO_WORKFLOW warning.
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.
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.
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 / ext09 makes 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 ext04 to mgc_seal_package; one seal produces one independent sub-package per target node plus distribution_index.json for dispatch and verification
Under chain mode, files carries 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:
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>
Omitext04
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 as node_pub / target_pub / public_key etc. immediately raises UNKNOWN_PARAM — there is no silent downgrade.
chain mode in practice
Targets array (scripts only — data and credentials must not be included):
json
[
{"node_pub": "<node A PEM>", "files": ["run_query.py", "shared_helper.py"]},
{"node_pub": "<node B PEM>", "files": ["run_analyze.py", "shared_helper.py"]}
]
python
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:
text
./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.py into query.py (and from query import ...) before sealing.
files must exactly match diff_3: run mgc_find after mgc_save_file to 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_FAILED at run time means the sub-package was sent to the wrong node or the .mgc_file was 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] from ext07
Use ext09 as 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:
python
# 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
python
# 2. Tamper with ext09: add a trailing space to the ext09 value in the capsule JSON, save as tampered.json
python
# 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:
text
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.
ext07 is 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.json sha256
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.
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 ext04 for 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 / ext09 was tampered with cannot be unsealed, so artifact integrity is verifiable
Deletion requires confirmation: when mgc_delete removes folder-level records, the user must explicitly approve first — only then may the caller pass confirm_folder_delete="true"
Chain mode (1.6.0+): one seal produces N independent sub-packages, each unsealable only by its target node; distribution_index.json records granted_files and sha256, and unsealing failure at run time surfaces as UNSEAL_FAILED
Encryption boundary: MGC encrypts script files only. CSV / JSON / config files are plaintext inside a sealed package — therefore files must carry scripts only, while data and credentials stay in local MGC
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.