You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ms-enclave is a modular and stable agent sandbox runtime environment that provides a secure isolated execution environment for applications. It achieves strong isolation through Docker containers, with accompanying local/HTTP managers and an extensible tool system, enabling you to safely and efficiently execute code in a controlled environment.
20
+
ms-enclave is a modular and stable sandbox runtime environment that provides a secure isolated execution environment for applications. It implements strong isolation through Docker containers, equipped with local/HTTP managers and an extensible tool system, helping you execute code safely and efficiently in a controlled environment.
21
21
22
-
- 🔒 Secure Isolation: Full isolation and resource limitation based on Docker
23
-
- 🧩 Modular: Extensible sandbox and tools (registration factory)
24
-
- ⚡ Stable Performance: Simple implementation, fast startup, lifecycle management
22
+
- 🔒 Secure Isolation: Complete isolation and resource limits based on Docker
23
+
- 🧩 Modular: Both sandboxes and tools are extensible (registered factory)
24
+
- ⚡ Stable Performance: Clean implementation, fast startup, with lifecycle management
- Docker daemon available on local machine (Notebook sandbox requires port 8888 open)
33
33
34
34
## Installation
35
35
@@ -51,9 +51,9 @@ pip install -e .
51
51
pip install -e '.[docker]'
52
52
```
53
53
54
-
## Quick Start: Minimal Example (SandboxFactory)
54
+
## Quick Start: Minimal Viable Example (SandboxFactory)
55
55
56
-
> Tools need to be explicitly enabled in the tools_config setting, otherwise they won't be registered.
56
+
> Tools need to be explicitly enabled in the configured tools_config, otherwise they won't be registered.
57
57
58
58
```python
59
59
import asyncio
@@ -72,7 +72,7 @@ async def main():
72
72
)
73
73
74
74
asyncwith SandboxFactory.create_sandbox(SandboxType.DOCKER, config) as sandbox:
75
-
# 1) Write a file
75
+
# 1) Write file
76
76
await sandbox.execute_tool('file_operation', {
77
77
'operation': 'write', 'file_path': '/sandbox/hello.txt', 'content': 'hi from enclave'
78
78
})
@@ -87,20 +87,20 @@ asyncio.run(main())
87
87
88
88
---
89
89
90
-
## Typical Usage Scenarios and Examples
90
+
## Typical Usage Patterns & Examples
91
91
92
-
-Directly using SandboxFactory: Create/destroy sandboxes in a single process—lightweight; suitable for scripts or one-off tasks
93
-
- Using LocalSandboxManager: Manage the lifecycle/cleanup of multiple sandboxes locally; suitable for service-oriented or multi-task parallel scenarios
94
-
- Using HttpSandboxManager: Unified sandbox management through remote HTTP services; suitable for cross-machine/distributed or more isolated deployments
92
+
-Direct use of SandboxFactory: Create/destroy sandboxes within a single process, most lightweight; suitable for scripts or one-time tasks
93
+
- Using LocalSandboxManager: Uniformly orchestrate lifecycle/cleanup of multiple sandboxes on local machine; suitable for service-oriented, multi-task parallel scenarios
94
+
- Using HttpSandboxManager: Manage sandboxes uniformly through remote HTTP service; suitable for cross-machine/distributed or stronger isolation deployments
95
95
96
96
### 1) Direct Sandbox Creation: SandboxFactory (Lightweight, Temporary)
97
97
98
-
Usage Scenarios:
98
+
Use Cases:
99
99
100
-
- Temporarily execute code in scripts or microservices
101
-
- Fine-grained control over sandbox lifecycle (cleanup upon context exit)
100
+
- Temporarily run a piece of code in scripts or microservices
101
+
- Fine-grained control over sandbox lifecycle (cleanup on context exit)
102
102
103
-
Example (Docker Sandbox + Python Execution):
103
+
Example (Docker sandbox + Python execution):
104
104
105
105
```python
106
106
import asyncio
@@ -120,12 +120,12 @@ async def main():
120
120
asyncio.run(main())
121
121
```
122
122
123
-
### 2) Local Unified Management: LocalSandboxManager (Multi-Sandbox, Lifecycle Management)
123
+
### 2) Local Unified Orchestration: LocalSandboxManager (Multiple Sandboxes, Lifecycle Management)
124
124
125
-
Usage Scenarios:
125
+
Use Cases:
126
126
127
-
-Create/manage multiple sandboxes within the same process (creation, query, stop, periodic cleanup)
128
-
-Unified view for monitoring stats and health
127
+
-Need to create/manage multiple sandboxes within the same process (create, query, stop, periodic cleanup)
128
+
-Want unified status view, statistics, and health checks
0 commit comments