One-liner
Seal Python small-systems / workflows into local packages — one AES key per node, no source code readable, no cloud, no exposure.
Who is this for?
| # |
Scenario |
Pain point |
| 1 |
Selling scripts / small tools — Independent developer writes a data-processing / report / scraper script, wants to sell 100 copies |
Fear of unlimited copying and reselling; a regular zip means gifting source |
| 2 |
Delivering internal small systems — Vendor hands a small system built from scripts to a client |
Client gets the source and may modify it or hand it to a third party |
| 3 |
Delivering enterprise automation — Automation consultant packages a workflow for an enterprise |
Each enterprise needs its own license; keys cannot be shared |
| 4 |
Paid knowledge products — Selling an automation method as a content product |
Let users run it, but cannot leak the core method |
Common requirement: delivery = authorization, and it must be one-key-per-node, one-node-per-key.
Three new selling points (unique to MGC 1.5.2)
Selling point 1 — Zero rewrite
Write your workflow as you would normally:
from helpers.fetch import get_weather
import config
Path(__file__).parent / "settings.json"
subprocess.run([sys.executable, "helper.py"])
MGC 1.5.2's ext08 automatically recognizes these import / relative-path / subprocess relationships. At runtime, execution is routed through sealed execution:
- ✅ Files never land on the customer's disk
- ✅ No path on the customer's machine can
cat the source directly
- ✅ No need to rewrite scripts as API-call patterns
Compared with traditional approaches: traditional schemes require you to rewrite scripts as "call by info_owner", turning 5 lines of calls into 50 lines. MGC 1.5.2 takes over for you.
Selling point 2 — One key per node
Each customer receives an independent AES key:
- The key is encrypted by the target node's RSA public key (RSA-2048)
- AES-256 encrypts each script file
- Customer node has no private key = cannot get the content
- After decrypting, the customer node cannot re-seal for a third party (the key is bound to their node)
Author node Customer node
─────────── ────────────
mgc_save_file(path="./workflow")
mgc_seal_package(ext04=customer_pub)
│
▼
encrypted package (.mgc_file)
│
└──── any channel ─────► mgc_save_file(path="./received.mgc_file")
mgc_run(...)
Selling point 3 — Local delivery
- All encryption, decryption, and execution happen locally
- MGC connects to no cloud, has no external endpoints
- The encrypted package can be delivered by email, USB, IM, GitHub Releases, private cloud drive — any way you like
- Even if the package is intercepted, without the corresponding node's private key it cannot be decrypted
Problem-to-solution map (market perspective)
| # |
User pain |
MGC 1.5.2 solution |
| P1 |
Customer can directly cat my .py files |
Full AES-256 encryption, no plaintext on disk |
| P2 |
Customer copies scripts to a colleague |
AES key bound to their node RSA — a different node cannot decrypt |
| P3 |
Multiple scripts use import; customer's machine changes paths |
ext08 auto-recognizes import / Path / subprocess, runtime sealed routing, no path dependency |
| P4 |
Customer modifies my code and stops paying |
AES signature verification, any modification immediately invalidates |
| P5 |
I have to maintain a "runbook"; customers can't set up dependencies |
ext05 auto-infers dependency list from imports, ext06 infers platforms |
| P6 |
Re-sealing for each customer is tedious |
mgc_seal_package handles folder-level sealing + node binding in one call |
Prerequisites
- Python 3.10+ (macOS 14+ Apple Silicon does NOT support Python 3.12)
- MGC Blackbox ≥ 1.5.2 (workflow auto-recognition + subprocess literal list runtime routing are fully supported in 1.5.2)
- Install:
pip install mgc-blackbox
- Run:
mgc (API at http://127.0.0.1:57219, WebUI at http://127.0.0.1:57218)
Three-step delivery (author side)
Step 1 — Store the workflow folder into MGC
my_workflow/
├── manifest.json
├── SKILL.md
├── run.py
├── helpers/
│ ├── fetch.py
│ └── parse.py
└── config/
└── settings.json
mgc_save_file(
path="./my_workflow",
info_owner="my_workflow",
diff_2="my_workflow",
)
This step automatically:
- Parses each script's
argparse and writes ext02
- Scans imports and writes
ext05 (dependency list)
- Infers
ext06 (platform list)
- Builds
ext08 (cross-script call graph)
Step 2 — Get the customer's RSA public key
# Customer runs this on their own machine (WebUI or MCP)
node_pub = mgc_get(
info_type="__NODE_PUB__",
info_owner="__NODE_PUB__",
)
# Customer sends you the multi-line PEM (public key is not secret; any channel works)
WebUI path (1.4.7+ recommended): WebUI → Skill page → Settings dropdown → Node Public Key → copy multi-line PEM.
⚠️ ext04 must contain real \n newlines; do not concatenate into a single line.
Step 3 — One-click seal
mgc_seal_package(
info_owner="my_workflow",
diff_2="my_workflow",
ext04=node_pub, # customer's PEM
)
# → generates .mgc_file
Send the .mgc_file to the customer through any channel.
Three-step receive (customer side)
Step 1 — Import the encrypted package
mgc_save_file(path="./received.mgc_file")
# MGC decrypts the package into local records
Step 2 — Browse the structure
# List package entries (metadata only, no plaintext)
mgc_find(info_owner="my_workflow", diff_2="my_workflow")
# Read manifest (plaintext, explains the workflow structure)
mgc_get(info_type="file", info_owner="my_workflow", diff_2="my_workflow")
# Read SKILL.md (plaintext, follow the instructions to call scripts)
mgc_get(info_type="file", info_owner="my_workflow", diff_2="my_workflow", diff_3="SKILL.md")
Step 3 — Black-box run
mgc_run(info_owner="my_workflow", diff_2="my_workflow")
# → {"pid": 12345, "status": "started"}
# AI only gets the launch status, never the source
Three critical rules
Rule 1 — Same-package paths are OK; cross-package calls use the MGC API
Scripts inside the same folder package can freely use import / relative paths / subprocess** — MGC 1.5.2's ext08 automatically recognizes and routes them through sealed execution at runtime. No need to rewrite as API calls.
Only cross-folder-package calls (different info_owner + diff_2) require the MGC API:
import os, requests
with open(os.path.expanduser("~/.mgc/database/mgc_black_box/.mgc_token")) as f:
MGC_TOKEN = f.read().strip()
def call_remote_script(info_owner, ext02=None):
return requests.post(
"http://127.0.0.1:57219/api/mgc/sensitive/get",
headers={"X-MGC-Token": MGC_TOKEN},
json={
"info_type": "script",
"info_owner": info_owner,
"diff_1": info_owner,
"action": "run",
"ext01": "python",
"ext02": ext02,
},
).json()
Rule 2 — Author's SKILL.md is plaintext (by design)
The author's SKILL.md must be plaintext — it is the routing instruction for the customer: which script to call in which scenario, in what order, with what parameters. Without it, the customer cannot use the package at all.
This is the public API contract, not implementation detail. Core logic must go in the scripts — see the next rule.
Rule 3 — Put core algorithm in scripts, not in prompts
Both SKILL.md and prompts are plaintext — the customer can read them. Therefore:
| ✅ Do this |
❌ Don't do this |
Put core algorithm in run.py |
Put core algorithm in SKILL.md |
| SKILL.md says "when to call run.py, what args to pass" |
SKILL.md says "the full business flow is…" (with details) |
| Business rules, thresholds, formulas → in scripts |
Business rules written in prompts |
The prompt is the customer-visible "manual". The algorithm is what you're selling — it must be locked inside the scripts.
Recognizable cross-script patterns (MGC 1.5.2 complete table)
Source: MGC skill_spec §2.4. When you save a folder via mgc_save_file, MGC statically parses every script to build the cross-script call graph (ext08). At runtime, MGC intercepts these patterns and routes them through sealed execution — no files on disk, no plaintext, no rewrites.
| Pattern |
Code example |
ext08 edge kind |
Recognized? |
from import |
from config import DEFAULT_CITY |
from_import |
Yes |
from import with alias |
from helpers.fetch import get_weather as gw |
from_import (asname preserved) |
Yes |
Plain import |
import helpers.parse |
import |
Yes |
Relative path via Path |
Path(__file__).parent / "config.py" |
path |
Yes |
Relative path via open() |
open("config.json") against sibling file |
path |
Yes (recognition only in the current version; runtime routing is not yet supported) |
| Subprocess with relative path |
subprocess.run([sys.executable, str(Path(__file__).parent / "config.py"), ...]) |
path (recognized via the Path(...) literal above; runtime also intercepts the subprocess call) |
Yes — only when the caller and target were saved into MGC together as one workflow package. |
| Subprocess with literal list |
subprocess.run(['helper.py', '--x']) (or from subprocess import run; run([...])) |
subprocess (callee field records which subprocess function: run / Popen / call / check_call / check_output) |
Yes — same package rule as above. Runtime interception runs the helper as sealed subprocess. |
| Dynamic import |
importlib.import_module(module_name) |
— |
No — MGC statically parses only string literals; dynamic names are not recognized. At runtime, Python's standard import will attempt to resolve the name (typically fails with ModuleNotFoundError). |
| Absolute path |
open("/Users/alice/scripts/config.py") |
— |
No — absolute paths are not portable and cannot be sealed. Use MGC location addressing instead. |
| Cross-subdirectory relative path |
subprocess.run([list, "../y.py"]) or Path(__file__).parent.parent / "y.py" when .. resolves outside the caller's directory |
— |
No — see Scope below. |
| Function-level call without import |
A function defined in another file called only by reference (no import / from-import / literal Path referencing it) |
— |
No — the parser only inspects string literals reachable via the conventional forms above. |
Scope (1.5.2):
- ✅ Cross-script calls are recognized within the same folder (
info_owner + diff_2 of the caller and the callee must be identical).
- ❌ Same folder, different subdirectory (e.g.
pkg_root/CROSS-FOLDER/x.py → ../y.py) — not recognized. The parser treats .. as out-of-scope, so ext08 will not contain the edge. Place helpers and drivers in one directory.
- ❌ Function-level calls that don't appear as
import / from-import / Path literals in source — not recognized.
Key invariants:
- The
argparse on each script is independent — the driver's args go to the driver's ext02, each helper's args go to the helper's own ext02.
Path(__file__).parent / "x.py" resolves correctly on macOS, Linux (POSIX), and Windows (\ separator) — MGC normalizes via _normalize_path in subprocess_adapter.
- Subprocess output flows through normally —
capture_output=True, text=True works because the launched helper is a real Python interpreter with UTF-8 decoding.
Limits. The cross-script call only works when both scripts are saved together. To orchestrate scripts across different packages, use the REST API pattern — pass the MGC location (info_owner) of the target script.
Error codes and troubleshooting
| Code |
Meaning |
Resolution |
DIFF2_MISMATCH |
Script used from-import but target script is not in the same folder package |
Put both scripts into the same mgc_save_file package; or use MGC API |
DEP_MISSING |
A dependency in ext05 is not installed on the customer's machine |
pip install <missing dep> (MGC does NOT auto-install) |
PLATFORM_INCOMPAT |
The ext06 platform list doesn't include the current OS |
Re-save on a supported platform, or extend platform branches in code |
args_not_recognized |
argparse parsing failed |
Check add_argument usage; ensure literal default= |
dynamic_args_detected |
Default value uses dynamic computation (e.g. datetime.now()) |
Use literal defaults, or pass via ext02 explicitly |
Invalid PEM format |
ext04 is not multi-line PEM |
Copy from mgc_get(info_type='__NODE_PUB__') verbatim, preserving \n |
When to use vs. when not to use (boundaries)
| ✅ Good fit |
❌ Not a good fit |
| Selling or licensing Python small tools |
Open-source scripts (use GitHub) |
| Delivering internal small systems to clients |
Large SaaS products (use cloud solutions) |
| Cross-node execution of automation workflows |
Single-machine personal scripts (no need to seal) |
| "Tool packs" in paid knowledge products |
Customer machines with full source environment for re-development |
Comparison with alternatives
| Dimension |
GitHub private repo |
SaaS encryption service |
License server |
MGC Sealed Delivery |
| Requires cloud |
Yes |
Yes |
Yes |
No |
| Monthly cost |
Medium |
High |
Medium |
None |
| Prevents source leak |
❌ Private but visible |
⚠️ Service-dependent |
❌ Server-side visible |
✅ Completely invisible |
| Prevents resell |
❌ |
⚠️ Service-dependent |
⚠️ Service-dependent |
✅ Node-locked, cannot resell |
| Offline delivery |
❌ |
❌ |
❌ |
✅ Any channel |
| Good for small systems |
⚠️ |
❌ Heavy |
⚠️ Heavy |
✅ Light |
MCP tools quick reference
| Tool |
Purpose |
Required params |
mgc_save_file |
Store a local folder (auto-recognizes workflow) |
path, info_owner |
mgc_seal_package |
Seal a package for target node |
info_owner, ext04 (PEM), output_dir |
mgc_save |
Store a single script (not in a package) |
info_type, info_owner, content |
mgc_seal |
Seal a single script |
info_owner, ext04 (PEM) |
mgc_run |
Black-box execution |
info_type="script", info_owner, diff_1 |
mgc_get |
Retrieve value / retrieve node_pub |
info_type, info_owner |
mgc_find |
Fuzzy search |
info_owner, match_mode |
mgc_list |
List all metadata |
— |
mgc_package |
Plaintext packaging within same trust zone |
info_owner |
mgc_open_webui |
Open WebUI |
— |
Related skills
- MGC Blackbox (Cross-Device Script Authorization) — Single-script sealing (lighter weight)
- MGC Blackbox Meta Skill — Full reference for all MGC capabilities
Contact
1---2spec: usk/3.03id: seal-workflow-licensing-en4version: 1.2.05name: sealed-workflow-en6description: "For small-system and workflow local delivery scenarios: seal Python script collections into single-node-authorized local packages. Scripts keep their original code (import / relative paths / subprocess all supported) — MGC 1.5.2 auto-routes through sealed execution. Delivered packages cannot be read, modified, or resold. Zero cloud, zero exposure."7author: MirginCipher Team8license: MIT9tags: anti-piracy, encrypted-delivery, zero-exposure, workflow-licensing, local-delivery, node-authorized, sealed-cross-script, auto-recognized-workflow, script-sales, small-system-delivery, knowledge-products, mgc, blackbox10platform_compatibility: windows, macos, linux11mcp_tools: mgc_save, mgc_save_file, mgc_get, mgc_run, mgc_find, mgc_list, mgc_seal, mgc_seal_package, mgc_package, mgc_open_webui12requirements:13 mgc_version: ">=1.5.2"14install: pip install mgc-blackbox>=1.5.215runtime: mgc16port: 5721917files:18 example_dir: example/19changelog:20 - version: 1.2.021 changes:22 - Upgraded to MGC 1.5.2: included ext08 auto-recognition and sealed cross-script import23 - Added market scenario opener (script sales / small system delivery / workflow licensing / knowledge products)24 - Added problem-to-solution map (hardcoded paths, config dependencies, missing libraries, platform incompatibility)25 - Added error code handling (DIFF2_MISMATCH / DEP_MISSING / PLATFORM_INCOMPAT)26 - Rewrote Rule 1: changed from 'forbidden paths' to 'same-package paths auto-sealed'27 - Added tags/keywords: sealed-cross-script, auto-recognized-workflow, script-sales, small-system-delivery, local-delivery, one-key-per-node28 - version: 1.0.029 changes:30 - Initial release. Based on MGC 1.5.0, introduces sealing & licensing of skill packages / workflow folders31metadata:32 source: https://skillmd.com/skills/zkeviny/sealed-workflow-en33---3435# One-liner3637**Seal Python small-systems / workflows into local packages — one AES key per node, no source code readable, no cloud, no exposure.**3839---4041# Who is this for?4243| # | Scenario | Pain point |44|---|----------|------------|45| 1 | **Selling scripts / small tools** — Independent developer writes a data-processing / report / scraper script, wants to sell 100 copies | Fear of unlimited copying and reselling; a regular zip means gifting source |46| 2 | **Delivering internal small systems** — Vendor hands a small system built from scripts to a client | Client gets the source and may modify it or hand it to a third party |47| 3 | **Delivering enterprise automation** — Automation consultant packages a workflow for an enterprise | Each enterprise needs its own license; keys cannot be shared |48| 4 | **Paid knowledge products** — Selling an automation method as a content product | Let users run it, but cannot leak the core method |4950> Common requirement: **delivery = authorization, and it must be one-key-per-node, one-node-per-key.**5152---5354# Three new selling points (unique to MGC 1.5.2)5556## Selling point 1 — Zero rewrite5758Write your workflow as you would normally:5960- `from helpers.fetch import get_weather`61- `import config`62- `Path(__file__).parent / "settings.json"`63- `subprocess.run([sys.executable, "helper.py"])`6465MGC 1.5.2's `ext08` **automatically recognizes** these `import` / `relative-path` / `subprocess` relationships. At runtime, execution is routed through sealed execution:6667- ✅ Files **never land on the customer's disk**68- ✅ **No path on the customer's machine** can `cat` the source directly69- ✅ **No need to rewrite scripts as API-call patterns**7071> Compared with traditional approaches: traditional schemes require you to rewrite scripts as "call by info_owner", turning 5 lines of calls into 50 lines. MGC 1.5.2 takes over for you.7273## Selling point 2 — One key per node7475Each customer receives an **independent AES key**:7677- The key is **encrypted by the target node's RSA public key** (RSA-2048)78- AES-256 encrypts each script file79- Customer node has no private key = cannot get the content80- After decrypting, the customer node **cannot re-seal** for a third party (the key is bound to their node)8182```83Author node Customer node84─────────── ────────────85mgc_save_file(path="./workflow")86mgc_seal_package(ext04=customer_pub)87 │88 ▼89 encrypted package (.mgc_file)90 │91 └──── any channel ─────► mgc_save_file(path="./received.mgc_file")92 mgc_run(...)93```9495## Selling point 3 — Local delivery9697- All encryption, decryption, and execution happen **locally**98- MGC connects to no cloud, has no external endpoints99- The encrypted package can be delivered by email, USB, IM, GitHub Releases, private cloud drive — **any way you like**100- Even if the package is intercepted, without the corresponding node's private key it cannot be decrypted101102---103104# Problem-to-solution map (market perspective)105106| # | User pain | MGC 1.5.2 solution |107|---|-----------|---------------------|108| P1 | Customer can directly `cat` my `.py` files | Full AES-256 encryption, **no plaintext on disk** |109| P2 | Customer copies scripts to a colleague | AES key bound to their node RSA — **a different node cannot decrypt** |110| P3 | Multiple scripts use `import`; customer's machine changes paths | `ext08` auto-recognizes `import / Path / subprocess`, **runtime sealed routing**, no path dependency |111| P4 | Customer modifies my code and stops paying | AES signature verification, **any modification immediately invalidates** |112| P5 | I have to maintain a "runbook"; customers can't set up dependencies | `ext05` auto-infers dependency list from imports, `ext06` infers platforms |113| P6 | Re-sealing for each customer is tedious | `mgc_seal_package` handles folder-level sealing + node binding in one call |114115---116117# Prerequisites118119- **Python 3.10+** (macOS 14+ Apple Silicon does NOT support Python 3.12)120- **MGC Blackbox ≥ 1.5.2** (workflow auto-recognition + subprocess literal list runtime routing are fully supported in 1.5.2)121- Install: `pip install mgc-blackbox`122- Run: `mgc` (API at `http://127.0.0.1:57219`, WebUI at `http://127.0.0.1:57218`)123124---125126# Three-step delivery (author side)127128## Step 1 — Store the workflow folder into MGC129130```131my_workflow/132├── manifest.json133├── SKILL.md134├── run.py135├── helpers/136│ ├── fetch.py137│ └── parse.py138└── config/139 └── settings.json140```141142```python143mgc_save_file(144 path="./my_workflow",145 info_owner="my_workflow",146 diff_2="my_workflow",147)148```149150This step automatically:151- Parses each script's `argparse` and writes `ext02`152- Scans imports and writes `ext05` (dependency list)153- Infers `ext06` (platform list)154- Builds `ext08` (cross-script call graph)155156## Step 2 — Get the customer's RSA public key157158```python159# Customer runs this on their own machine (WebUI or MCP)160node_pub = mgc_get(161 info_type="__NODE_PUB__",162 info_owner="__NODE_PUB__",163)164# Customer sends you the multi-line PEM (public key is not secret; any channel works)165```166167> **WebUI path (1.4.7+ recommended)**: WebUI → Skill page → Settings dropdown → Node Public Key → copy multi-line PEM.168>169> ⚠️ `ext04` must contain real `\n` newlines; do not concatenate into a single line.170171## Step 3 — One-click seal172173```python174mgc_seal_package(175 info_owner="my_workflow",176 diff_2="my_workflow",177 ext04=node_pub, # customer's PEM178)179# → generates .mgc_file180```181182Send the `.mgc_file` to the customer through any channel.183184---185186# Three-step receive (customer side)187188## Step 1 — Import the encrypted package189190```python191mgc_save_file(path="./received.mgc_file")192# MGC decrypts the package into local records193```194195## Step 2 — Browse the structure196197```python198# List package entries (metadata only, no plaintext)199mgc_find(info_owner="my_workflow", diff_2="my_workflow")200201# Read manifest (plaintext, explains the workflow structure)202mgc_get(info_type="file", info_owner="my_workflow", diff_2="my_workflow")203204# Read SKILL.md (plaintext, follow the instructions to call scripts)205mgc_get(info_type="file", info_owner="my_workflow", diff_2="my_workflow", diff_3="SKILL.md")206```207208## Step 3 — Black-box run209210```python211mgc_run(info_owner="my_workflow", diff_2="my_workflow")212# → {"pid": 12345, "status": "started"}213# AI only gets the launch status, never the source214```215216---217218# Three critical rules219220## Rule 1 — Same-package paths are OK; cross-package calls use the MGC API221222Scripts inside the **same folder package** can freely use `import / relative paths / subprocess`** — MGC 1.5.2's `ext08` automatically recognizes and routes them through sealed execution at runtime. **No need to rewrite as API calls.**223224Only **cross-folder-package calls** (different `info_owner + diff_2`) require the MGC API:225226```python227import os, requests228229with open(os.path.expanduser("~/.mgc/database/mgc_black_box/.mgc_token")) as f:230 MGC_TOKEN = f.read().strip()231232def call_remote_script(info_owner, ext02=None):233 return requests.post(234 "http://127.0.0.1:57219/api/mgc/sensitive/get",235 headers={"X-MGC-Token": MGC_TOKEN},236 json={237 "info_type": "script",238 "info_owner": info_owner,239 "diff_1": info_owner,240 "action": "run",241 "ext01": "python",242 "ext02": ext02,243 },244 ).json()245```246247## Rule 2 — Author's SKILL.md is plaintext (by design)248249The author's SKILL.md must be plaintext — it is the **routing instruction** for the customer: which script to call in which scenario, in what order, with what parameters. Without it, the customer cannot use the package at all.250251> This is the public API contract, not implementation detail. **Core logic must go in the scripts** — see the next rule.252253## Rule 3 — Put core algorithm in scripts, not in prompts254255Both SKILL.md and prompts are **plaintext** — the customer can read them. Therefore:256257| ✅ Do this | ❌ Don't do this |258|-----------|------------------|259| Put core algorithm in `run.py` | Put core algorithm in SKILL.md |260| SKILL.md says "when to call run.py, what args to pass" | SKILL.md says "the full business flow is…" (with details) |261| Business rules, thresholds, formulas → in scripts | Business rules written in prompts |262263> The prompt is the customer-visible "manual". **The algorithm is what you're selling** — it must be locked inside the scripts.264265---266267# Recognizable cross-script patterns (MGC 1.5.2 complete table)268269> Source: MGC skill_spec §2.4. When you save a folder via `mgc_save_file`, MGC statically parses every script to build the cross-script call graph (`ext08`). At runtime, MGC intercepts these patterns and routes them through sealed execution — **no files on disk, no plaintext, no rewrites**.270271| Pattern | Code example | ext08 edge kind | Recognized? |272|---------|-------------|-----------------|-------------|273| `from` import | `from config import DEFAULT_CITY` | `from_import` | Yes |274| `from` import with alias | `from helpers.fetch import get_weather as gw` | `from_import` (asname preserved) | Yes |275| Plain `import` | `import helpers.parse` | `import` | Yes |276| Relative path via `Path` | `Path(__file__).parent / "config.py"` | `path` | Yes |277| Relative path via `open()` | `open("config.json")` against sibling file | `path` | Yes (recognition only in the current version; runtime routing is not yet supported) |278| Subprocess with relative path | `subprocess.run([sys.executable, str(Path(__file__).parent / "config.py"), ...])` | `path` (recognized via the `Path(...)` literal above; runtime also intercepts the subprocess call) | Yes — only when the caller and target were saved into MGC together as one workflow package. |279| Subprocess with literal list | `subprocess.run(['helper.py', '--x'])` (or `from subprocess import run; run([...])`) | `subprocess` (`callee` field records which subprocess function: `run` / `Popen` / `call` / `check_call` / `check_output`) | Yes — same package rule as above. Runtime interception runs the helper as sealed subprocess. |280| Dynamic import | `importlib.import_module(module_name)` | — | No — MGC statically parses only string literals; dynamic names are not recognized. At runtime, Python's standard import will attempt to resolve the name (typically fails with `ModuleNotFoundError`). |281| Absolute path | `open("/Users/alice/scripts/config.py")` | — | No — absolute paths are not portable and cannot be sealed. Use MGC location addressing instead. |282| Cross-subdirectory relative path | `subprocess.run([list, "../y.py"])` or `Path(__file__).parent.parent / "y.py"` when `..` resolves outside the caller's directory | — | No — see Scope below. |283| Function-level call without import | A function defined in another file called only by reference (no `import` / `from-import` / literal `Path` referencing it) | — | No — the parser only inspects string literals reachable via the conventional forms above. |284285**Scope (1.5.2):**286287- ✅ Cross-script calls are recognized **within the same folder** (`info_owner + diff_2` of the caller and the callee must be identical).288- ❌ **Same folder, different subdirectory** (e.g. `pkg_root/CROSS-FOLDER/x.py → ../y.py`) — not recognized. The parser treats `..` as out-of-scope, so `ext08` will not contain the edge. Place helpers and drivers in one directory.289- ❌ **Function-level calls** that don't appear as `import` / `from-import` / `Path` literals in source — not recognized.290291**Key invariants:**292293- The `argparse` on each script is independent — the driver's args go to the driver's `ext02`, each helper's args go to the helper's own `ext02`.294- `Path(__file__).parent / "x.py"` resolves correctly on macOS, Linux (POSIX), and Windows (`\` separator) — MGC normalizes via `_normalize_path` in `subprocess_adapter`.295- Subprocess output flows through normally — `capture_output=True, text=True` works because the launched helper is a real Python interpreter with UTF-8 decoding.296297**Limits.** The cross-script call only works when both scripts are saved together. To orchestrate scripts across different packages, use the REST API pattern — pass the MGC location (`info_owner`) of the target script.298299---300301# Error codes and troubleshooting302303| Code | Meaning | Resolution |304|------|---------|------------|305| `DIFF2_MISMATCH` | Script used `from-import` but **target script is not in the same folder package** | Put both scripts into the same `mgc_save_file` package; or use MGC API |306| `DEP_MISSING` | A dependency in `ext05` is not installed on the customer's machine | `pip install <missing dep>` (MGC does NOT auto-install) |307| `PLATFORM_INCOMPAT` | The `ext06` platform list doesn't include the current OS | Re-save on a supported platform, or extend platform branches in code |308| `args_not_recognized` | `argparse` parsing failed | Check `add_argument` usage; ensure literal `default=` |309| `dynamic_args_detected` | Default value uses dynamic computation (e.g. `datetime.now()`) | Use literal defaults, or pass via `ext02` explicitly |310| `Invalid PEM format` | `ext04` is not multi-line PEM | Copy from `mgc_get(info_type='__NODE_PUB__')` verbatim, preserving `\n` |311312---313314# When to use vs. when not to use (boundaries)315316| ✅ Good fit | ❌ Not a good fit |317|-----------|------------------|318| Selling or licensing Python small tools | Open-source scripts (use GitHub) |319| Delivering internal small systems to clients | Large SaaS products (use cloud solutions) |320| Cross-node execution of automation workflows | Single-machine personal scripts (no need to seal) |321| "Tool packs" in paid knowledge products | Customer machines with full source environment for re-development |322323---324325# Comparison with alternatives326327| Dimension | GitHub private repo | SaaS encryption service | License server | **MGC Sealed Delivery** |328|-----------|------------------------|-------------------------|-----------------|------------------------|329| Requires cloud | Yes | Yes | Yes | **No** |330| Monthly cost | Medium | High | Medium | **None** |331| Prevents source leak | ❌ Private but visible | ⚠️ Service-dependent | ❌ Server-side visible | ✅ **Completely invisible** |332| Prevents resell | ❌ | ⚠️ Service-dependent | ⚠️ Service-dependent | ✅ **Node-locked, cannot resell** |333| Offline delivery | ❌ | ❌ | ❌ | ✅ **Any channel** |334| Good for small systems | ⚠️ | ❌ Heavy | ⚠️ Heavy | ✅ **Light** |335336---337338# MCP tools quick reference339340| Tool | Purpose | Required params |341|------|---------|-----------------|342| `mgc_save_file` | Store a local folder (auto-recognizes workflow) | path, info_owner |343| `mgc_seal_package` | Seal a package for target node | info_owner, ext04 (PEM), output_dir |344| `mgc_save` | Store a single script (not in a package) | info_type, info_owner, content |345| `mgc_seal` | Seal a single script | info_owner, ext04 (PEM) |346| `mgc_run` | Black-box execution | info_type="script", info_owner, diff_1 |347| `mgc_get` | Retrieve value / retrieve node_pub | info_type, info_owner |348| `mgc_find` | Fuzzy search | info_owner, match_mode |349| `mgc_list` | List all metadata | — |350| `mgc_package` | Plaintext packaging within same trust zone | info_owner |351| `mgc_open_webui` | Open WebUI | — |352353---354355# Related skills356357- **MGC Blackbox (Cross-Device Script Authorization)** — Single-script sealing (lighter weight)358- **MGC Blackbox Meta Skill** — Full reference for all MGC capabilities359360---361362# Contact363364- **Main repo**: https://github.com/zkeviny/MGC-Blackbox365- **Issues**: https://github.com/zkeviny/MGC-Blackbox/issues366- **Contact**: mirgincipher@outlook.com