ephemora-cell 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. ephemora_cell-1.0.0/LICENSE +201 -0
  2. ephemora_cell-1.0.0/PKG-INFO +258 -0
  3. ephemora_cell-1.0.0/README.md +227 -0
  4. ephemora_cell-1.0.0/ephemora_cell/__init__.py +66 -0
  5. ephemora_cell-1.0.0/ephemora_cell/builder.py +325 -0
  6. ephemora_cell-1.0.0/ephemora_cell/cli.py +406 -0
  7. ephemora_cell-1.0.0/ephemora_cell/egress_sidecar.py +275 -0
  8. ephemora_cell-1.0.0/ephemora_cell/engine_pool.py +266 -0
  9. ephemora_cell-1.0.0/ephemora_cell/execution_report.py +377 -0
  10. ephemora_cell-1.0.0/ephemora_cell/process_executor.py +276 -0
  11. ephemora_cell-1.0.0/ephemora_cell/process_worker.py +352 -0
  12. ephemora_cell-1.0.0/ephemora_cell/profiles.py +80 -0
  13. ephemora_cell-1.0.0/ephemora_cell/state.py +191 -0
  14. ephemora_cell-1.0.0/ephemora_cell/wasi_02.py +458 -0
  15. ephemora_cell-1.0.0/ephemora_cell/wasi_runtime.py +1118 -0
  16. ephemora_cell-1.0.0/ephemora_cell/wasm_inspector.py +108 -0
  17. ephemora_cell-1.0.0/ephemora_cell.egg-info/PKG-INFO +258 -0
  18. ephemora_cell-1.0.0/ephemora_cell.egg-info/SOURCES.txt +51 -0
  19. ephemora_cell-1.0.0/ephemora_cell.egg-info/dependency_links.txt +1 -0
  20. ephemora_cell-1.0.0/ephemora_cell.egg-info/entry_points.txt +3 -0
  21. ephemora_cell-1.0.0/ephemora_cell.egg-info/requires.txt +8 -0
  22. ephemora_cell-1.0.0/ephemora_cell.egg-info/top_level.txt +2 -0
  23. ephemora_cell-1.0.0/ephemora_cell_mcp/__init__.py +25 -0
  24. ephemora_cell-1.0.0/ephemora_cell_mcp/__main__.py +40 -0
  25. ephemora_cell-1.0.0/ephemora_cell_mcp/engine.py +147 -0
  26. ephemora_cell-1.0.0/ephemora_cell_mcp/protocol.py +98 -0
  27. ephemora_cell-1.0.0/ephemora_cell_mcp/server.py +244 -0
  28. ephemora_cell-1.0.0/ephemora_cell_mcp/tool_registry.py +146 -0
  29. ephemora_cell-1.0.0/ephemora_cell_mcp/tools/echo.json +11 -0
  30. ephemora_cell-1.0.0/ephemora_cell_mcp/tools/echo.wasm +0 -0
  31. ephemora_cell-1.0.0/ephemora_cell_mcp/transport.py +69 -0
  32. ephemora_cell-1.0.0/pyproject.toml +70 -0
  33. ephemora_cell-1.0.0/setup.cfg +4 -0
  34. ephemora_cell-1.0.0/tests/test_analytical_profile.py +179 -0
  35. ephemora_cell-1.0.0/tests/test_builder.py +335 -0
  36. ephemora_cell-1.0.0/tests/test_cli.py +268 -0
  37. ephemora_cell-1.0.0/tests/test_component.py +288 -0
  38. ephemora_cell-1.0.0/tests/test_disk_quota.py +137 -0
  39. ephemora_cell-1.0.0/tests/test_effective_preopens.py +203 -0
  40. ephemora_cell-1.0.0/tests/test_egress_sidecar.py +215 -0
  41. ephemora_cell-1.0.0/tests/test_engine_pool.py +273 -0
  42. ephemora_cell-1.0.0/tests/test_execution_report.py +457 -0
  43. ephemora_cell-1.0.0/tests/test_gc_heap_knob.py +69 -0
  44. ephemora_cell-1.0.0/tests/test_io_budget.py +378 -0
  45. ephemora_cell-1.0.0/tests/test_mcp_adapter.py +540 -0
  46. ephemora_cell-1.0.0/tests/test_process_executor.py +426 -0
  47. ephemora_cell-1.0.0/tests/test_run_io_budgets.py +221 -0
  48. ephemora_cell-1.0.0/tests/test_sandbox_cleanup.py +135 -0
  49. ephemora_cell-1.0.0/tests/test_security.py +924 -0
  50. ephemora_cell-1.0.0/tests/test_state.py +251 -0
  51. ephemora_cell-1.0.0/tests/test_threads_baseline.py +243 -0
  52. ephemora_cell-1.0.0/tests/test_wasm_inspector.py +45 -0
  53. ephemora_cell-1.0.0/tests/test_wvm_wasm_runtime.py +254 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" file as part of its distribution,
107
+ then any Derivative Works that You distribute must include a
108
+ readable copy of the attribution notices contained within such
109
+ NOTICE file, excluding those notices that do not pertain to any
110
+ part of the Derivative Works, in at least one of the following
111
+ places: within a NOTICE in a Source form distribution, within
112
+ a NOTICE in documentation made available along with the Source
113
+ Distribution, or within a display generated by the Derivative
114
+ Works, if and wherever such third-party notices normally
115
+ appear. The contents of the NOTICE file are for informational
116
+ purposes only and do not modify the License. You may add Your
117
+ own attribution notices within Derivative Works that You
118
+ distribute, alongside or as an addendum to the NOTICE text from
119
+ the Work, provided that such additional attribution notices
120
+ cannot be construed as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions that
133
+ You may impose. If You wish to impose additional terms or
134
+ conditions upon Your Contributions, first submit a separate written
135
+ agreement to the Licensor granting authorization for the use of
136
+ Contributions under those terms.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Michael Soppa
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,258 @@
1
+ Metadata-Version: 2.4
2
+ Name: ephemora-cell
3
+ Version: 1.0.0
4
+ Summary: Ephemora Cell — Isolated WASM Sandbox
5
+ Author-email: Michael Soppa <m_soppa@outlook.de>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/MichaelS1011/ephemora-cell
8
+ Project-URL: Issues, https://github.com/MichaelS1011/ephemora-cell/issues
9
+ Keywords: wasm,webassembly,wasi,sandbox,isolation,agent,mcp
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Software Development :: Embedded Systems
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: wasmtime<48,>=36.0.12
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest<9; extra == "dev"
26
+ Requires-Dist: pytest-cov; extra == "dev"
27
+ Requires-Dist: black>=24; extra == "dev"
28
+ Requires-Dist: ruff>=0.5; extra == "dev"
29
+ Requires-Dist: bandit>=1.7; extra == "dev"
30
+ Dynamic: license-file
31
+
32
+ # Ephemora Cell
33
+
34
+ **Isolated WASM sandbox for untrusted code — sub-millisecond, capability-based. No network, no filesystem, no host access; capped at 128 MB memory / 1 M fuel / 30 s by default.**
35
+
36
+ <p align="center">
37
+ <a href="https://www.python.org/downloads/">
38
+ <img src="https://img.shields.io/badge/python-3.10%2B-blue" alt="Python 3.10+">
39
+ </a>
40
+ <a href="https://opensource.org/licenses/Apache-2.0">
41
+ <img src="https://img.shields.io/badge/license-Apache--2.0-green" alt="License">
42
+ </a>
43
+ <a href="https://github.com/MichaelS1011/ephemora-cell">
44
+ <img src="https://img.shields.io/badge/status-beta-yellow" alt="Status">
45
+ </a>
46
+ </p>
47
+
48
+ ## Quick Start
49
+
50
+ ```bash
51
+ git clone https://github.com/MichaelS1011/ephemora-cell.git
52
+ cd ephemora-cell
53
+ pip install -e .
54
+
55
+ # Run your first isolated module (compiled from examples/hello.wat):
56
+ ephemora-cell run examples/hello.wasm
57
+ ```
58
+
59
+ ```text
60
+ Hello from Ephemora Cell!
61
+ ```
62
+
63
+ ```python
64
+ from ephemora_cell import run_wasm
65
+
66
+ result = run_wasm("examples/hello.wasm")
67
+ print(result.stdout) # Hello from Ephemora Cell!
68
+ print(result.status.name) # SUCCESS
69
+ ```
70
+
71
+ ## Why Cell
72
+
73
+ - **AI agents and MCP tools execute untrusted code** — Docker, shells and system Python give no isolation guarantees at agent scale. Cell sandboxes every execution.
74
+ - **Enforced, not promised** — fuel metering (CPU), memory caps, epoch-based wall-clock timeouts, output caps and I/O budgets are enforced per run, with the effective posture attested in a signed execution record.
75
+ - **Sub-millisecond warm execution** — 0.16 ms guest / 0.46 ms end-to-end (pooled, measured) enables plugin and edge scale.
76
+
77
+ ## Features
78
+
79
+ - ⚡ **Fuel metering** — CPU limits per execution; catches infinite loops (~13 fuel/iteration, R² = 1.000)
80
+ - 🧠 **Memory limits** — 128 MB WASM memory max via `Store.set_limits`
81
+ - ⏱️ **Timeout** — 30 s wall-clock default (epoch interruption)
82
+ - 🔒 **Preopen deny** — 14 dangerous directories blocked by default (`/dev`, `/proc`, `/sys`, …)
83
+ - 🚫 **No network, no host access** — no socket, exec or fork APIs in WASI Preview1; imports rejected at instantiate
84
+ - 📦 **Output capping** — stdout/stderr capped at 10 KB (prevents buffer bloat)
85
+ - 🧬 **Dual-ABI** — WASI Preview1 (default) and WASI 0.2 components (opt-in via `abi="component"` or auto-detection)
86
+ - 🧱 **I/O budgets** — walls for host work, not just guest compute: `WASIConfig(io_cpu_seconds=…, io_budget_bytes=…)` (defaults 2.0 s / 64 MiB; `None` = unlimited for trusted runs; measured attack basis in `benchmarks/io_dos/`)
87
+
88
+ Also included: **memory64 opt-in** (`memory64=True` / `--memory64`, off by default), **GC-heap declared cap** (`max_gc_heap_mb`, recorded in the security baseline — wasmtime-py 47 binds no GC-heap limiter, fuel remains the effective bound), **named state** (`state_set`/`state_get` host imports, capped at 64 entries · 256 KiB · 1 MiB per session), and an **egress sidecar** reference mediator (allowlist-validated host-side API calls, no guest sockets — [docs/egress_patterns.md](docs/egress_patterns.md)).
89
+
90
+ ## Performance
91
+
92
+ | Scenario (n=1000, `examples/hello.wasm`, Mac M5, wasmtime 47.0.1) | Wall median | Wall p95 | Guest median |
93
+ |------|--------|------|------|
94
+ | **Pooled engine** (`io_budget_bytes=None`, trusted runs) | **0.46 ms** | 0.60 ms | 0.16 ms |
95
+ | **Default path** (`io_budget_bytes=64 MiB`, per-run engine) | 0.92 ms | 1.26 ms | 0.60 ms |
96
+
97
+ *Measured 2026-08-29, reproducible: `python benchmarks/pool_vs_budget.py` (raw: `benchmarks/results/2026-08-29/pool_vs_budget.json`, `measured:true`). Budgeted runs force a per-run engine (ADR-002).*
98
+
99
+ Docker comparison (2026-08-30, live, same Mac): `docker run` python:3.12-slim 171 ms vs Cell 0.40 ms cold = **427×** — reproducible: `python benchmarks/competitive_benchmark.py` (raw: `benchmarks/results/2026-08-30/competitive_benchmark.json`, `docker_measured:true`). Agentic workloads (50 tool-calls, n=500 pooled): 0.24–0.26 ms median, p95 0.29 ms — detail in [docs/performance.md](docs/performance.md).
100
+
101
+ ## Architecture
102
+
103
+ ```mermaid
104
+ flowchart TB
105
+ guest["Guest WASM Module<br/>(isolated)"]
106
+ subgraph sandbox["WASI Sandbox — capability-based isolation"]
107
+ fuel["Fuel Meter<br/>~13 fuel/iteration"]
108
+ mem["Memory Limit<br/>128 MB max"]
109
+ timeout["Timeout Guard<br/>epoch interruption"]
110
+ syscalls["WASI Preview1 — capability-based,<br/>preopened dirs only<br/>fd_read · fd_write · path_open · clock_time_get<br/>proc_exit · environ_get · random_get"]
111
+ end
112
+ blocked["Blocked by design:<br/>exec · fork · socket · /dev · /proc · /sys · threads"]
113
+
114
+ guest --> syscalls
115
+ fuel -.-> sandbox
116
+ mem -.-> sandbox
117
+ timeout -.-> sandbox
118
+ sandbox -.-> blocked
119
+ ```
120
+
121
+ ## Security
122
+
123
+ Ephemora Cell blocks attack vectors that are fully allowed in Docker (verified on DGX Spark GB10):
124
+
125
+ | Attack Vector | Docker | Ephemora Cell |
126
+ |---|---|---|
127
+ | Shell access (`os.system`) | ALLOWED | **BLOCKED** — no exec/system in WASI Preview1 |
128
+ | Fork (`os.fork`) | ALLOWED | **BLOCKED** — no fork() in WASI Preview1 |
129
+ | Network (`socket`) | ALLOWED | **BLOCKED** — no socket() in WASI Preview1 |
130
+ | fsync (`os.fsync`) | ALLOWED | **BLOCKED** — import-level rejection at instantiate |
131
+ | Host FS (`/etc/passwd`) | ALLOWED | **BLOCKED** — preopen default-deny |
132
+ | Symlink escape | ALLOWED | **BLOCKED** — dangerous directory filter |
133
+ | Multi-threading | ALLOWED | **BLOCKED** — `wasm_threads=False` enforced |
134
+ | Env access | ALLOWED | **BLOCKED** — controlled via `allow_env` |
135
+
136
+ **Result: 8/8 attack vectors blocked (live-verified** via [`benchmarks/verify_8_vectors.py`](benchmarks/verify_8_vectors.py)**).** Docker attacks are measured live per run via [`benchmarks/competitive_benchmark.py`](benchmarks/competitive_benchmark.py) — never hardcoded.
137
+
138
+ Full details: [SECURITY.md](SECURITY.md) (policy, execution-path control matrix, known limitations) · [docs/threat-model.md](docs/threat-model.md) (adversary model, trust boundaries, residual risks) · [docs/security_posture.md](docs/security_posture.md) (arXiv 2509.11242 evaluation, fuel boundary, related research).
139
+
140
+ ## Compatibility & Integrations
141
+
142
+ Ephemora Cell is a WASM execution primitive, not a framework library — drop it into any agent framework, use it with any LLM, compile from any language that targets WASM. Integration tests live in [`integration/`](integration/): Hermes, NemoClaw, LangGraph, CrewAI, AutoGen, OpenAI Agents SDK, Semantic Kernel, and model independence (tested live against Ollama). The pattern is always the same: **`execute(wasm_path)` → isolated result.**
143
+
144
+ ### MCP Server
145
+
146
+ Ephemora Cell ships a dependency-free MCP stdio server whose tools are WASM modules executed inside the Cell — determinism, fuel metering, 10 KB output cap, no network, SEP-2787-ready signed execution records:
147
+
148
+ ```bash
149
+ pip install -e . # from a clone (PyPI package ships with the first release)
150
+ ephemora-cell-mcp # bundled echo tool included; register your own: --tools-dir ./tools
151
+ ```
152
+
153
+ See [docs/mcp.md](docs/mcp.md) and [docs/comparison-mcp-servers.md](docs/comparison-mcp-servers.md).
154
+
155
+ ### Programming Languages (WASM Universal)
156
+
157
+ Any language that compiles to WASM works — Cell executes the `.wasm`, it does not know the source language. One-command build: `ephemora-cell build <source>` detects the toolchain and maps failed builds to actionable hints from the measured friction matrix (`benchmarks/build_friction/`).
158
+
159
+ | Language | Compiler | Verified |
160
+ |----------|----------|----------|
161
+ | Rust | `cargo build --target wasm32-wasip1` | ✅ Compiled + executed (CI) |
162
+ | Go | `GOOS=wasip1 GOARCH=wasm go build` | ✅ Compiled + executed (CI) |
163
+ | C | wasi-sdk `clang --target=wasm32-wasip1` | ✅ Compiled + executed (CI) |
164
+ | AssemblyScript | `asc --runtime stub` | ✅ Compiled + executed (CI) |
165
+ | Zig | `zig build-exe -target wasm32-wasi` | ✅ Compiled + executed (CI) |
166
+ | Python | — | Guidance: run on a wasi-python interpreter (no AOT exists) |
167
+
168
+ All five compiled-language gates verify on every push: the CI `build-recipes` job installs each toolchain and runs a real build + sandbox execution per language ([`.github/workflows/ci.yml`](.github/workflows/ci.yml)).
169
+
170
+ **Platforms:** macOS (Apple M5, ARM64) ✅ · Ubuntu 24.04 (x86_64, CI) ✅ · DGX Spark GB10 (Grace ARM64) ✅
171
+
172
+ ## Configuration
173
+
174
+ ```python
175
+ from ephemora_cell import WASISandbox, WASIConfig
176
+
177
+ config = WASIConfig(
178
+ max_memory_mb=64, # 64 MB WASM memory
179
+ max_fuel=500_000, # CPU fuel (None = unlimited)
180
+ timeout_seconds=10, # Wall-clock timeout
181
+ allow_dirs=("/data",), # Only /data pre-opened
182
+ )
183
+
184
+ sandbox = WASISandbox(config=config)
185
+ result = sandbox.run("examples/hello.wasm", args=["--input", "file.txt"])
186
+ ```
187
+
188
+ `result` contains: `status` (`ExecutionStatus.SUCCESS | ERROR | TIMEOUT | FUEL_EXHAUSTED | MEMORY_EXCEEDED`), `exit_code`, `stdout`/`stderr` (capped at 10 KB), `elapsed_ms`, `fuel_consumed`.
189
+
190
+ ```bash
191
+ ephemora-cell run examples/hello.wasm # execute
192
+ ephemora-cell run examples/hello.wasm --json # JSON on stdout, guest output on stderr
193
+ ephemora-cell run examples/hello.wasm --profile analytical
194
+ ephemora-cell inspect examples/hello.wasm # module metadata
195
+ ephemora-cell benchmark examples/hello.wasm --n 300
196
+ ```
197
+
198
+ Explicit CLI flags override the selected `--profile`; profiles add nothing you did not ask for. `--profile analytical` runs data-analysis workloads beyond the 128 MB wall (64-bit memories, 4.5 GiB linear memory, 50 M fuel, 120 s timeout — measured guarantees in `benchmarks/analytical_breakpoint/`, design in [docs/decisions/ADR-003](docs/decisions/ADR-003-analytical-profile.md)). In `--json` mode the payload includes `security_baseline` and `stdin_capped`; piped stdin beyond 9,216 B is refused (wasmtime host cap) — use a preopened file for bigger inputs.
199
+
200
+ ## Use Cases
201
+
202
+ ### Plugin Systems
203
+
204
+ Run user-uploaded plugins in isolation — even if they are malicious:
205
+
206
+ ```python
207
+ from ephemora_cell import WASISandbox, WASIConfig
208
+
209
+ # Only /data is accessible — no /etc, no network, no shell
210
+ config = WASIConfig(allow_dirs=("/data",), max_fuel=500_000)
211
+ sandbox = WASISandbox(config=config)
212
+ result = sandbox.run("user_plugin.wasm")
213
+ ```
214
+
215
+ ### AI Agent Code Execution
216
+
217
+ Sandbox LLM-generated code — prevent credential theft, infinite loops, and network exfiltration:
218
+
219
+ ```python
220
+ result = run_wasm(
221
+ "llm_generated.wasm",
222
+ max_fuel=200_000,
223
+ timeout_seconds=5,
224
+ allow_dirs=("/input", "/output")
225
+ )
226
+ # Output capped at 10KB — no buffer bloat
227
+ csv_analysis = result.stdout
228
+ ```
229
+
230
+ More recipes — serverless functions, air-gapped validation, WASI 0.2 components, FastAPI integration — in [docs/recipes.md](docs/recipes.md).
231
+
232
+ ## Limitations
233
+
234
+ **What Ephemora Cell guarantees:** host isolation (the guest cannot access host filesystem, network, or processes outside preopened directories) and resource limits (CPU via fuel, memory, wall-clock time).
235
+
236
+ **What Ephemora Cell does NOT guarantee:** it does not evaluate whether guest code is *good* (a well-crafted module can still produce unexpected output within its budget); I/O system calls run on the host and cost minimal fuel (the 10 KB output budget caps captured output; see the fuel boundary analysis in [docs/security_posture.md](docs/security_posture.md)); and it does not provide multi-tenant isolation between concurrent modules sharing the same host process.
237
+
238
+ Execution paths differ materially: the default runs the guest **inside your process**; `run_isolated()` adds OS-level walls (rlimits, disk quota, I/O CPU watchdog, hard kill). The full control matrix is in [SECURITY.md](SECURITY.md).
239
+
240
+ Language-interpreter guidance (CPython-WASI, custom interpreters) is in [docs/languages.md](docs/languages.md).
241
+
242
+ ## Testing & Verification
243
+
244
+ 357 tests · 74% statement coverage · 8/8 attack vectors blocked · CI-enforced on every push (tests, coverage, pip-audit, SBOM) — see [`.github/workflows/ci.yml`](.github/workflows/ci.yml) and the verification commands in [docs/security_posture.md](docs/security_posture.md).
245
+
246
+ ## Relationship to Ephemora
247
+
248
+ Ephemora Cell is the open-source isolation layer (Apache 2.0, standalone — no Ephemora dependency). The Ephemora enterprise edition builds on Cell's isolation for production and regulated deployments. Cell is complete for isolation; the enterprise edition is complete for operation — see [docs/enterprise.md](docs/enterprise.md) for when that conversation is worth having.
249
+
250
+ ## License
251
+
252
+ Apache 2.0 — See `LICENSE`.
253
+
254
+ ---
255
+
256
+ *Isolated. Limited. Deterministic.*
257
+
258
+ Created by [Michael Soppa](https://www.linkedin.com/in/michael-soppa).