Sericite

Sericite is a scripting language and execution engine built around one idea: creating a fully isolated, arbitrarily nestable VM should be a cheap, first-class operation in the language itself.
Its syntax is a Python subset, but source code runs as Sericite's own instruction stream — never through Python exec/eval.
中文文档
Status
Pre-1.0 prototype. The engine is a Python reference implementation (codename Sericite-PY) with zero runtime dependencies; Python ≥ 3.12 is required. APIs and semantics may change before 1.0.
Security note. Sericite is designed for isolation, but the current prototype runs in the host process and has not been formally audited. Do not rely on it as the only boundary when executing adversarial code. See the security model for exactly what is and is not guaranteed.
Install
pip install sericite
Your first isolated program
Create play.sericite. A fresh VM looks for a file written before it existed, then leaves an answer in its own workspace:
write_file("/before.txt", "already here")
vm = VM("""
print(path_exists("/before.txt"))
write_file("/answer.txt", "42")
""")
print(vm.run(), end="")
workspace = vm.take_fs()
print(workspace.read_file("/answer.txt"))
Run it:
sericite play.sericite
Output:
False
42
An arena for untrusted code
Nine mutually untrusted programs enter a sorting tournament. Correct algorithms compete on instruction count; attempts to steal the answer, infinite loops, and output floods are disqualified without stopping the judge.
git clone https://github.com/LeoLoudWarden/sericite.git
cd sericite
sericite demos/sorting-arena/arena.sericite
An output excerpt (each run uses fresh random test cases):
RANK CONTESTANT TOTAL INSTRUCTIONS
1 quicksort 15,383
...
DQ answer-thief file_not_found
DQ output-flood resource_exhausted
DQ infinite-loop resource_exhausted
...
The arena survived every submission. The scoreboard only counts correct code.
How it works
Learn more
Documentation
What each document covers and whom it serves is maintained in the documentation index.
Roadmap
- More list/dict methods, string methods, and additional ergonomic syntax
- Broader performance benchmark coverage
- A normative language spec and a conformance test suite for future engines
- Evaluation of a native engine
The name
Sericite (绢云母) is a fine-grained mica: thin silky scales that stack into sheets and insulate. The name reflects layering, isolation, and lightness.
License
Apache-2.0 — see NOTICE.