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 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.23.0

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.23.0
File Size Uploaded Provenance Actions
sericite-0.23.0.tar.gz 556.4 kB With provenance Details for sericite-0.23.0.tar.gz

Built distribution (wheel)

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

Total release size: 647.4 kB

Release files / sericite-0.23.0.tar.gz

Download URL sericite-0.23.0.tar.gz
Size 556.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7af936955baa5919340d2aa9e4a5566b41f670ac95d6fe55817793f601390c99
BLAKE2b-256 checksum
How to use checksums
978c5ae74099921413bcbb7673478be24c2891bb234df02e7ebaa48d67803664
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 29, 2026.

Transparency log

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

Download URL sericite-0.23.0-py3-none-any.whl
Size 91.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c2adb9f5533ae876400ddcbd71f9379b3f3903c6825d35dbed1bf1485fa648d
BLAKE2b-256 checksum
How to use checksums
5ea21d643cffcf4b3b9bd347759853cfb20e155bd93377a600f597271891857a
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 29, 2026.

Transparency log

Security for sericite 0.23.0

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.23.0.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 29, 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.23.0 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