isolattice 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. isolattice-0.1.0/LICENSE +201 -0
  2. isolattice-0.1.0/PKG-INFO +332 -0
  3. isolattice-0.1.0/README.md +285 -0
  4. isolattice-0.1.0/pyproject.toml +255 -0
  5. isolattice-0.1.0/pyproject.toml.orig +216 -0
  6. isolattice-0.1.0/src/isolattice/__init__.py +205 -0
  7. isolattice-0.1.0/src/isolattice/_artifacts.py +219 -0
  8. isolattice-0.1.0/src/isolattice/_async.py +117 -0
  9. isolattice-0.1.0/src/isolattice/backend.py +294 -0
  10. isolattice-0.1.0/src/isolattice/backends/__init__.py +19 -0
  11. isolattice-0.1.0/src/isolattice/backends/_bootstrap.py +123 -0
  12. isolattice-0.1.0/src/isolattice/backends/_cli.py +304 -0
  13. isolattice-0.1.0/src/isolattice/backends/_kubernetes_network.py +191 -0
  14. isolattice-0.1.0/src/isolattice/backends/_linux_helper.py +514 -0
  15. isolattice-0.1.0/src/isolattice/backends/_macos_helper.py +281 -0
  16. isolattice-0.1.0/src/isolattice/backends/_mounts.py +90 -0
  17. isolattice-0.1.0/src/isolattice/backends/_native.py +129 -0
  18. isolattice-0.1.0/src/isolattice/backends/_podman_log_filter.py +77 -0
  19. isolattice-0.1.0/src/isolattice/backends/_windows_helper.py +504 -0
  20. isolattice-0.1.0/src/isolattice/backends/docker.py +1622 -0
  21. isolattice-0.1.0/src/isolattice/backends/kubernetes.py +1930 -0
  22. isolattice-0.1.0/src/isolattice/backends/linux.py +937 -0
  23. isolattice-0.1.0/src/isolattice/backends/macos.py +925 -0
  24. isolattice-0.1.0/src/isolattice/backends/podman.py +2347 -0
  25. isolattice-0.1.0/src/isolattice/backends/windows.py +986 -0
  26. isolattice-0.1.0/src/isolattice/backends/windows_appcontainer.py +1004 -0
  27. isolattice-0.1.0/src/isolattice/commands.py +64 -0
  28. isolattice-0.1.0/src/isolattice/configuration.py +316 -0
  29. isolattice-0.1.0/src/isolattice/contracts.py +120 -0
  30. isolattice-0.1.0/src/isolattice/errors.py +56 -0
  31. isolattice-0.1.0/src/isolattice/events.py +117 -0
  32. isolattice-0.1.0/src/isolattice/models.py +941 -0
  33. isolattice-0.1.0/src/isolattice/observability.py +666 -0
  34. isolattice-0.1.0/src/isolattice/otel.py +229 -0
  35. isolattice-0.1.0/src/isolattice/py.typed +0 -0
  36. isolattice-0.1.0/src/isolattice/quotas.py +227 -0
  37. isolattice-0.1.0/src/isolattice/remote/__init__.py +32 -0
  38. isolattice-0.1.0/src/isolattice/remote/_attach.py +129 -0
  39. isolattice-0.1.0/src/isolattice/remote/_journal.py +216 -0
  40. isolattice-0.1.0/src/isolattice/remote/_placement.py +138 -0
  41. isolattice-0.1.0/src/isolattice/remote/_wire.py +428 -0
  42. isolattice-0.1.0/src/isolattice/remote/client.py +846 -0
  43. isolattice-0.1.0/src/isolattice/remote/server.py +1148 -0
  44. isolattice-0.1.0/src/isolattice/resolution.py +223 -0
  45. isolattice-0.1.0/src/isolattice/runtime.py +1646 -0
  46. isolattice-0.1.0/src/isolattice/s3.py +565 -0
  47. isolattice-0.1.0/src/isolattice/shutdown.py +151 -0
  48. isolattice-0.1.0/src/isolattice/signing.py +136 -0
  49. isolattice-0.1.0/src/isolattice/storage.py +436 -0
  50. isolattice-0.1.0/src/isolattice/supervision.py +439 -0
  51. isolattice-0.1.0/src/isolattice/termination.py +224 -0
  52. isolattice-0.1.0/src/isolattice/testing.py +351 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,332 @@
1
+ Metadata-Version: 2.4
2
+ Name: isolattice
3
+ Version: 0.1.0
4
+ Summary: Asynchronous, cross-platform sandbox execution framework with explicit, verified backend capabilities.
5
+ Keywords: sandbox,isolation,containment,asyncio,podman,docker,kubernetes,appcontainer,namespaces,security
6
+ Author: S. Muni Harish
7
+ Author-email: S. Muni Harish <samamuniharish@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Framework :: AsyncIO
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Programming Language :: Python :: 3.15
22
+ Classifier: Topic :: Security
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: System :: Systems Administration
25
+ Classifier: Typing :: Typed
26
+ Requires-Dist: isolattice[s3,otel,fastapi,signing,remote] ; extra == 'all'
27
+ Requires-Dist: fastapi>=0.162.2,<1 ; extra == 'fastapi'
28
+ Requires-Dist: httpx2>=2.16.0,<3 ; extra == 'fastapi'
29
+ Requires-Dist: opentelemetry-api>=1.45.2,<2 ; extra == 'otel'
30
+ Requires-Dist: opentelemetry-sdk>=1.45.2,<2 ; extra == 'otel'
31
+ Requires-Dist: aiohttp>=3.14.5,<4 ; extra == 'remote'
32
+ Requires-Dist: aiobotocore>=3.10.0,<4 ; extra == 's3'
33
+ Requires-Dist: cryptography>=50.0.2,<51.0.0 ; extra == 'signing'
34
+ Requires-Python: >=3.12
35
+ Project-URL: Homepage, https://github.com/smuniharish/isolattice
36
+ Project-URL: Documentation, https://isolattice.readthedocs.io/en/latest/
37
+ Project-URL: Changelog, https://github.com/smuniharish/isolattice/blob/main/CHANGELOG.md
38
+ Project-URL: Issues, https://github.com/smuniharish/isolattice/issues
39
+ Project-URL: Repository, https://github.com/smuniharish/isolattice
40
+ Provides-Extra: all
41
+ Provides-Extra: fastapi
42
+ Provides-Extra: otel
43
+ Provides-Extra: remote
44
+ Provides-Extra: s3
45
+ Provides-Extra: signing
46
+ Description-Content-Type: text/markdown
47
+
48
+ <p align="center">
49
+ <img src="https://raw.githubusercontent.com/smuniharish/isolattice/main/docs/assets/logo.svg" alt="Isolattice logo" width="96">
50
+ </p>
51
+
52
+ <h1 align="center">Isolattice</h1>
53
+
54
+ <p align="center">
55
+ <img src="https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14%20%7C%203.15-blue.svg" alt="Python 3.12 | 3.13 | 3.14 | 3.15">
56
+ <img src="https://img.shields.io/badge/status-production--stable-brightgreen.svg" alt="Development status: production/stable">
57
+ <img src="https://img.shields.io/badge/typing-typed-blue.svg" alt="Typed">
58
+ <img src="https://img.shields.io/badge/dependencies-none-brightgreen.svg" alt="No runtime dependencies">
59
+ <a href="https://github.com/smuniharish/isolattice/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License: Apache 2.0"></a>
60
+ </p>
61
+
62
+ **Asynchronous, capability-aware sandbox execution for Python.**
63
+
64
+ Isolattice provides a typed API for running workloads under backend-specific
65
+ security and resource policies. It discovers available capabilities, rejects
66
+ required guarantees that cannot be enforced, and verifies termination against
67
+ the owned execution boundary. The same API supports Podman, the Docker API,
68
+ Kubernetes, Linux namespaces, macOS Seatbelt, Windows AppContainer and Windows
69
+ Job Objects.
70
+
71
+ The Production/Stable development status describes package maturity; it does
72
+ not certify individual backends, configurations or workloads.
73
+
74
+ <p align="center">
75
+ <img src="https://raw.githubusercontent.com/smuniharish/isolattice/main/docs/assets/diagrams/architecture-overview.png" alt="Isolattice architecture" width="720">
76
+ </p>
77
+
78
+ > **Security scope:** Containers, Pods, Linux namespaces and AppContainers share
79
+ > the host or node kernel; kernel, engine, runtime and cluster exploits are
80
+ > outside the threat model. Windows Job Objects provide containment and resource
81
+ > control, not a security boundary. No backend is certified for hostile
82
+ > multi-tenant workloads, and an independent third-party security review has not
83
+ > been completed. See the [security guarantees](https://isolattice.readthedocs.io/en/latest/security/guarantees/)
84
+ > and [platform limitations](https://isolattice.readthedocs.io/en/latest/security/platform-limitations/).
85
+
86
+ ## Why Isolattice
87
+
88
+ Applications that run external commands or generated code need explicit
89
+ policies, bounded execution and reliable cleanup. Isolattice provides these
90
+ through a common interface while preserving the differences between platforms.
91
+
92
+ | Requirement | Approach |
93
+ | --- | --- |
94
+ | Backend-specific enforcement | Each backend reports capabilities as supported, limited or unsupported, with evidence for the configured host |
95
+ | Required policies | Requested guarantees and budgets are enforced or rejected with `SandboxCapabilityError` |
96
+ | Resource ownership | Execution boundaries are tracked by identity, with cleanup on completion, failure and cancellation |
97
+ | Termination verification | An unverified stop is reported as unknown rather than successful termination |
98
+ | Portable integration | One async API supports native, container, Kubernetes and remote backends |
99
+
100
+ Isolattice does not replace a container engine, orchestrator or virtual machine.
101
+ Applications must select a backend appropriate for their workload and threat
102
+ model.
103
+
104
+ ## Highlights
105
+
106
+ - **Async lifecycle.** Create, run, stream, cancel, stop and close through async
107
+ APIs. Pause and resume are available on supported Linux, Podman and Docker
108
+ configurations. Async context managers own cleanup.
109
+ - **Fail-closed policies.** Network access, root writability, resource limits
110
+ and timeouts are enforced or refused according to backend capabilities.
111
+ - **Kubernetes network policies.** Optional owned deny-all and CIDR/protocol/port
112
+ allowlists, with an in-Pod enforcement probe before workload release. The CNI
113
+ and cluster policy administration remain trusted.
114
+ - **Capability discovery.** `Sandbox.discover()` reports capability states and
115
+ evidence for the configured backend.
116
+ - **Verified termination.** Graceful and forced termination, retries and a
117
+ cleanup deadline; unfinished cleanup remains owned and is reported.
118
+ - **Bounded output.** Stream stdout and stderr with per-stream limits and
119
+ truncation indicators.
120
+ - **Snapshots and checkpoints.** Workspace snapshots on Podman, Docker Engine and
121
+ every native backend except Windows Job Objects, whole-container snapshots on
122
+ Podman and Docker Engine, and CRIU checkpoints on rootful Podman. SHA-256
123
+ manifests are verified on read; optional Ed25519 signatures authenticate
124
+ manifests against caller-configured trusted keys.
125
+ - **Extensible through ABCs.** Bring your own `ArtifactStore`, `EventSink`,
126
+ `CommandRunner` or `Backend`. A local store is built in and an S3 store is an
127
+ optional extra. OpenTelemetry integrations provide lifecycle metrics and
128
+ tracing.
129
+ - **Remote service.** Use authenticated, owner-scoped sessions with server-side
130
+ leases and crash reconciliation.
131
+ - **Typed and lightweight.** The core has no runtime dependencies, ships type
132
+ hints and supports Python 3.12 to 3.15.
133
+
134
+ ## Backends
135
+
136
+ | Backend | Boundary | Live-tested on |
137
+ | --- | --- | --- |
138
+ | `PodmanBackend` | One restricted container per execution; rootless by default | CI on Ubuntu: rootless, rootful runc with CRIU, and a remote engine over `ssh://`. Locally: Podman machine on Windows 11 |
139
+ | `DockerBackend` | One restricted container per execution through the Docker Engine API | CI: Docker Engine on Ubuntu. Locally: Podman's Docker-compatible API |
140
+ | `KubernetesBackend` | One owned Pod per execution; optional owned NetworkPolicy and in-Pod enforcement probe | Single-node kind cluster, in CI and locally |
141
+ | `LinuxNamespaceBackend` | User, PID, mount, network, IPC and UTS namespaces, delegated cgroup v2, seccomp and Landlock | CI on Ubuntu 24.04 and WSL 2, each with a delegated systemd scope |
142
+ | `MacOSSeatbeltBackend` | One process under a deny-default Seatbelt profile; no network or process creation; runs as the calling user | CI on macOS 15 and 26, Apple silicon and Intel |
143
+ | `WindowsAppContainerBackend` | Less-privileged AppContainer inside nested Job Objects; no network | CI on Windows Server, and Windows 11 |
144
+ | `WindowsJobBackend` | Job Object containment and budgets. **Not a security boundary:** files, network and registry stay reachable | CI on Windows Server, and Windows 11 |
145
+
146
+ On macOS, workloads can use `MacOSSeatbeltBackend` or a container backend
147
+ connected to a Podman machine or remote engine. The core suite and Seatbelt
148
+ backend are tested on macOS 15 and 26, on Apple silicon and Intel.
149
+
150
+ Remote execution is available through a remote container engine or the optional
151
+ `isolattice[remote]` service. The service provides authenticated, owner-scoped
152
+ sessions, TLS beyond loopback, leases, idempotent session creation and
153
+ reconciliation of owned resources after a crash. It transfers checkpoints but
154
+ does not transfer snapshots or pause requests.
155
+
156
+ The [tested platforms](https://isolattice.readthedocs.io/en/latest/reference/tested-platforms/)
157
+ page describes the configurations and evidence for each CI job. The
158
+ [platform limitations](https://isolattice.readthedocs.io/en/latest/security/platform-limitations/)
159
+ page documents backend-specific restrictions.
160
+
161
+ ## Installation
162
+
163
+ Install from a local checkout:
164
+
165
+ ```bash
166
+ git clone https://github.com/smuniharish/isolattice.git
167
+ cd isolattice
168
+ python -m pip install . # core, no runtime dependencies
169
+ python -m pip install ".[s3]" # S3 artifact storage
170
+ python -m pip install ".[otel]" # OpenTelemetry metrics and tracing
171
+ python -m pip install ".[fastapi]" # FastAPI example dependencies
172
+ python -m pip install ".[signing]" # Ed25519 artifact signing
173
+ python -m pip install ".[remote]" # Remote service and client
174
+ ```
175
+
176
+ Once a release is available on PyPI, the core can also be installed with
177
+ `python -m pip install isolattice`.
178
+
179
+ Podman requires its client and an explicit connection; Docker requires its
180
+ client and an API endpoint; Kubernetes requires `kubectl` and a kubeconfig. The
181
+ Linux namespace backend also needs a delegated cgroup v2 subtree. See the
182
+ [installation guide](https://isolattice.readthedocs.io/en/latest/getting-started/installation/)
183
+ for platform prerequisites.
184
+
185
+ ## Quickstart
186
+
187
+ The following example uses a rootless Podman connection with a read-only root,
188
+ no network and required memory and process limits. The image must already exist
189
+ on the connection, and the memory and pids cgroup controllers must be delegated.
190
+ Replace `podman-machine-default` with your configured connection name.
191
+
192
+ ```python
193
+ import asyncio
194
+
195
+ from isolattice import Capability, ExecutionRequest, PodmanBackend, Sandbox, SandboxPolicy
196
+
197
+
198
+ async def main() -> None:
199
+ backend = PodmanBackend(
200
+ connection="podman-machine-default", image="docker.io/library/alpine:3.22"
201
+ )
202
+ policy = SandboxPolicy(
203
+ memory_bytes=128 * 1024 * 1024,
204
+ process_limit=32,
205
+ required_capabilities=(Capability.MEMORY_LIMIT, Capability.PROCESS_LIMIT),
206
+ )
207
+ request = ExecutionRequest(
208
+ argv=(
209
+ "/bin/sh",
210
+ "-c",
211
+ "echo hello from $(hostname); wget -q -T 2 -O- http://example.com || echo network: blocked",
212
+ ),
213
+ timeout=10,
214
+ )
215
+ async with Sandbox(backend=backend) as sandbox, await sandbox.create(policy=policy) as instance:
216
+ result = await instance.run(request)
217
+ print(result.stdout.decode(), end="")
218
+ print("exit code:", result.exit_code)
219
+ print("termination:", result.termination.state)
220
+
221
+
222
+ asyncio.run(main())
223
+ ```
224
+
225
+ Example output:
226
+
227
+ ```text
228
+ hello from 33a5a6dd24ba
229
+ network: blocked
230
+ exit code: 0
231
+ termination: terminated
232
+ ```
233
+
234
+ If the required controllers are unavailable, the policy is rejected:
235
+
236
+ ```text
237
+ isolattice.errors.SandboxCapabilityError: resource limits require delegated controllers: memory, pids
238
+ ```
239
+
240
+ Isolattice does not pull images. Podman workloads receive only the environment
241
+ provided by the caller; set `PATH` explicitly or use absolute executable paths.
242
+ The [quickstart](https://isolattice.readthedocs.io/en/latest/getting-started/quickstart/)
243
+ covers streaming, cancellation and additional backends.
244
+
245
+ ## Extensibility
246
+
247
+ Extension points are abstract base classes supplied explicitly by the
248
+ application. Plugins are not discovered or loaded implicitly.
249
+
250
+ - **`ArtifactStore`** stores snapshots and checkpoints. Isolattice creates and
251
+ verifies their integrity manifests; `isolattice.testing.check_artifact_store`
252
+ checks custom stores against the contract.
253
+ - **`EventSink`** receives typed lifecycle events without workload output or
254
+ secrets.
255
+ - **`CommandRunner`** controls invocation of `podman`, `docker` and `kubectl`.
256
+ - **`Backend`**, **`BackendSession`** and **`TerminationDriver`** provide
257
+ integration points for additional isolation technologies.
258
+
259
+ See [custom integrations](https://isolattice.readthedocs.io/en/latest/guides/custom-integrations/)
260
+ and [custom backends](https://isolattice.readthedocs.io/en/latest/guides/custom-backend/).
261
+
262
+ ## Examples
263
+
264
+ The [`examples/`](https://github.com/smuniharish/isolattice/tree/main/examples)
265
+ directory contains runnable programs exercised by live tests on configured
266
+ backends:
267
+
268
+ - [First sandbox on Podman](https://github.com/smuniharish/isolattice/blob/main/examples/01-getting-started/podman_hello.py)
269
+ - [Resource limits and instance budgets](https://github.com/smuniharish/isolattice/tree/main/examples/04-resource-management)
270
+ - [Streaming and cancellation](https://github.com/smuniharish/isolattice/blob/main/examples/06-async-and-cancellation/podman_stream_cancel.py)
271
+ - [Linux namespaces and Windows AppContainer](https://github.com/smuniharish/isolattice/tree/main/examples/08-native-backends)
272
+ - [Docker API](https://github.com/smuniharish/isolattice/blob/main/examples/09-container-integrations/docker_isolated_run.py)
273
+ and [Kubernetes](https://github.com/smuniharish/isolattice/blob/main/examples/10-kubernetes/kubernetes_isolated_run.py)
274
+ - [Workspace and container snapshots](https://github.com/smuniharish/isolattice/tree/main/examples/12-snapshots)
275
+ - [CRIU checkpoints](https://github.com/smuniharish/isolattice/blob/main/examples/13-checkpoints/podman_checkpoint.py)
276
+ - [Failure handling](https://github.com/smuniharish/isolattice/blob/main/examples/18-failure-scenarios/podman_failures.py)
277
+
278
+ ## Planned enhancements
279
+
280
+ The following enhancements are proposed and are not available today. No
281
+ delivery date is committed.
282
+
283
+ - **Restore into a live process:** CRIU restore creates a new process tree; it
284
+ does not merge checkpoint state into an already-running process. Supporting
285
+ this requires a different restore mechanism or backend.
286
+ - **Rootless checkpoints:** The current Podman/CRIU path requires a rootful
287
+ engine. Rootless support would require a verified privilege and containment
288
+ model; see the [CRIU Podman guide](https://www.criu.org/Podman).
289
+ - **Keep TCP connections on runc:** the tested runc restore path cannot
290
+ re-establish these connections and leaves loopback down. The option is
291
+ supported only on crun; runc support depends on a compatible upstream runtime
292
+ or a separately validated restore path.
293
+
294
+ See [feature coverage](https://isolattice.readthedocs.io/en/latest/development/feature-coverage/)
295
+ and the [architecture review](https://isolattice.readthedocs.io/en/latest/development/architecture-review/)
296
+ for the full feature ledger, other proposed enhancements and backend limitations.
297
+
298
+ ## Documentation
299
+
300
+ Full documentation: **[isolattice.readthedocs.io](https://isolattice.readthedocs.io/en/latest/)**
301
+
302
+ - [Getting started](https://isolattice.readthedocs.io/en/latest/getting-started/)
303
+ - [Concepts](https://isolattice.readthedocs.io/en/latest/concepts/introduction/)
304
+ - [Backends](https://isolattice.readthedocs.io/en/latest/backends/podman/)
305
+ - [Security model and guarantees](https://isolattice.readthedocs.io/en/latest/security/guarantees/)
306
+ - [Architecture](https://isolattice.readthedocs.io/en/latest/architecture/02-architecture-overview/)
307
+ - [API reference](https://isolattice.readthedocs.io/en/latest/api/)
308
+
309
+ Two [Agent Skills](https://isolattice.readthedocs.io/en/latest/agent-skills/)
310
+ provide guidance for coding agents such as Claude Code, Codex, Cursor and GitHub
311
+ Copilot. `isolattice` covers backend execution and fail-closed policies;
312
+ `isolattice-extend` covers custom stores, event sinks, runners and backends:
313
+
314
+ ```bash
315
+ npx skills add smuniharish/isolattice
316
+ ```
317
+
318
+ Changes are listed in the
319
+ [changelog](https://github.com/smuniharish/isolattice/blob/main/CHANGELOG.md).
320
+
321
+ ## Contributing
322
+
323
+ Contributions are welcome. See
324
+ [CONTRIBUTING.md](https://github.com/smuniharish/isolattice/blob/main/CONTRIBUTING.md)
325
+ for the development setup and checks, and
326
+ [SECURITY.md](https://github.com/smuniharish/isolattice/blob/main/SECURITY.md)
327
+ to report a vulnerability.
328
+
329
+ ## License
330
+
331
+ Apache License 2.0. See
332
+ [LICENSE](https://github.com/smuniharish/isolattice/blob/main/LICENSE).