Skip to main content

Sericite

CI PyPI Python License

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 --addons demos/sorting-arena/addons.py 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

Next step English 中文
Read the online manual Sericite manual Sericite 手册
Explore more complete applications More demos 更多演示
Write Sericite programs Sericite scripting manual Sericite 脚本手册
Run programs from a terminal Sericite CLI manual Sericite 命令行手册
Embed Sericite in a Python application Sericite-PY manual Sericite-PY 手册

Documentation

English 中文
Design notes 设计说明
Prior art 先例与相关工作
Architecture 架构说明
Security model 安全模型
Benchmarks 性能基准
Build journal 构建手记
Behind the scenes 幕后
AI-assisted development AI 辅助开发

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.

Metadata

Release files for sericite 0.22.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sericite 0.22.1
File Size Uploaded Provenance Actions
sericite-0.22.1.tar.gz 550.9 kB With provenance Details for sericite-0.22.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sericite 0.22.1
File Interpreter ABI Platform Actions
sericite-0.22.1-py3-none-any.whl Python 3 none any Details for sericite-0.22.1-py3-none-any.whl

Total release size: 640.1 kB

Release files / sericite-0.22.1.tar.gz

Download URL sericite-0.22.1.tar.gz
Size 550.9 kB
Tags Source
SHA-256 checksum
How to use checksums
03d9d379825ce44a6d26576983c8f6cc204b79aaa08de943994448e5df72c8e9
BLAKE2b-256 checksum
How to use checksums
a9745bbf41b1aa2c24959f36fd2eb8c23de0a0d71f532d4418f08425876eb397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / sericite-0.22.1-py3-none-any.whl

Download URL sericite-0.22.1-py3-none-any.whl
Size 89.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fae975ec8fe0f76ad1f6def286c6e9252f140db55a3d25ac6d84c6859888e946
BLAKE2b-256 checksum
How to use checksums
2c486914c0aa59e184be219d323151c824241db66ddf7ac83009d74d14bf73a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for sericite 0.22.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sericite-0.22.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.22.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page