Skip to content

Commit 9519dc7

Browse files
docs: add realistic architecture comparison matrix and verified example workflows
1 parent 6f32f59 commit 9519dc7

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
# autonomous-code-execution-engine
1+
# CodeShield: Autonomous Code Execution Engine
22

33
[![CI](https://img.shields.io/github/actions/workflow/status/AlgorithmicMind/autonomous-code-execution-engine/ci.yml?branch=main&label=CI)](https://github.com/AlgorithmicMind/autonomous-code-execution-engine/actions)
44
[![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue)](https://www.python.org/)
55
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
66
[![Code Style: Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)
77

8-
**Deterministic, Isolated, and Self-Healing Python Code Execution Engine for LLM Agents.**
8+
> Deterministic, Isolated, and Self-Healing Python Execution Runtime for AI Agents.
99
1010
This open-source engine executes Python code generated by LLMs inside a disposable, isolated sandbox, validates it statically with the Python `ast` module, and recovers from runtime errors through a deterministic self-healing loop backed by local heuristics and optional Google Gemini-powered patch generation.
1111

12+
## Comparison
13+
14+
| Feature | Vanilla `subprocess` | Docker Container | CodeShield (This Engine) |
15+
| :--- | :--- | :--- | :--- |
16+
| **Startup Overhead** | ~5 – 10 ms | ~1,500 – 3,000 ms | **Sub-second (~30–250 ms via `uv`)** |
17+
| **Isolation Mechanism** | None (Host Process) | Container Namespaces / cgroups | **Ephemeral Virtualenv (`tempfile` + `uv`)** |
18+
| **AST Security Gate** | ❌ None | ❌ None | **✅ Static AST inspection (`os.system`, `eval`)** |
19+
| **Silent Failure Detection** | ❌ None | ❌ None | **✅ Regex scanning for empty DataFrames/NaNs** |
20+
| **Self-Healing Loop** | ❌ None | ❌ None | **✅ 3-Tier Traceback Diagnosis + Gemini Patch** |
21+
1222
---
1323

1424
## Architecture
@@ -125,6 +135,16 @@ Run the included demo:
125135
python demo.py
126136
```
127137

138+
### Verified Example Workflows
139+
140+
The `examples/` directory contains self-contained recipes that have been executed and verified:
141+
142+
```bash
143+
python examples/01_basic_sandboxing.py # isolated execution with timing
144+
python examples/02_security_gatekeeper.py # AST rejection of unsafe code
145+
python examples/03_llm_healing_workflow.py # self-healing with Gemini or local fallback
146+
```
147+
128148
### CLI Usage
129149

130150
Execute any Python file directly from the terminal with the built-in CLI:

0 commit comments

Comments
 (0)