> ## Documentation Index
> Fetch the complete documentation index at: https://nono.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> Capability-based sandboxing for Python applications

The nono Python SDK provides OS-enforced sandboxing using Landlock (Linux) and Seatbelt (macOS). Once a sandbox is applied, unauthorized operations are structurally impossible.

## Features

> [card] OS-Enforced Security
>
> Sandboxing enforced at the kernel level, not application level. Cannot be bypassed by the sandboxed process.

> [card] Capability-Based
>
> Explicitly grant access to files, directories, and network. Everything else is denied by default.

> [card] Network Proxy
>
> Domain-filtered, credential-injected network access. Sandboxed processes reach only allowed hosts. Real API keys never leave the supervisor.

> [card] Filesystem Rollback
>
> Content-addressable snapshots with Merkle-committed state. Roll back any changes made by a sandboxed agent.

> [card] Cross-Platform
>
> Works on Linux (Landlock) and macOS (Seatbelt) with a unified API.

> [card] Type-Safe
>
> Full type stubs for IDE autocompletion and static type checking with mypy.

## Quick Example

```python theme={null}
from nono_py import CapabilitySet, AccessMode, apply, is_supported

# Check platform support
if not is_supported():
    print("Sandboxing not supported on this platform")
    exit(1)

# Build capability set
caps = CapabilitySet()
caps.allow_path("/tmp", AccessMode.READ_WRITE)
caps.allow_file("/etc/hosts", AccessMode.READ)
caps.block_network()

# Apply sandbox (irreversible!)
apply(caps)

# Process is now sandboxed
# - Can read/write in /tmp
# - Can read /etc/hosts
# - Cannot access network
# - Cannot access any other files
```

## When to Use

The Python SDK is ideal for:

* **AI Agent Supervisors**: Orchestrate sandboxed agents with network filtering, credential injection, and filesystem rollback
* **Plugin Systems**: Isolate third-party plugins from your main application
* **Data Processing**: Limit file access when processing untrusted data
* **Testing**: Ensure tests don't accidentally modify system files

## Platform Support

| Platform | Backend | Requirements |
| - | - | - |
| Linux | Landlock | Kernel 5.13+ with Landlock enabled |
| macOS | Seatbelt | macOS 10.5+ |
| Windows | - | Not supported |

> [!NOTE]
>
> Use `is_supported()` to check if sandboxing is available at runtime.

## Next Steps

> [card] [Installation](https://nono.sh/docs/python/installation.md)
>
> Install the SDK with pip or from source

> [card] [Quickstart](https://nono.sh/docs/python/quickstart.md)
>
> Build your first sandboxed application

> [card] [API Reference](https://nono.sh/docs/python/api/capability-set.md)
>
> Explore the full API documentation

> [card] [Examples](https://nono.sh/docs/python/examples.md)
>
> See real-world usage patterns


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.