Skip to main content
This guide walks through creating a sandboxed Python application step by step.

Basic Workflow

Every nono application follows the same pattern:
  1. Check support - Verify sandboxing is available
  2. Build capabilities - Define what the process can access
  3. Apply sandbox - Lock down the process (irreversible)
  4. Run application - Execute your code within the sandbox

Step 1: Check Platform Support

Always verify sandboxing is available before relying on it:

Step 2: Build Capabilities

Create a CapabilitySet and grant the permissions your application needs:

Access Modes

Only grant the minimum permissions your application needs. Excessive permissions defeat the purpose of sandboxing.

Step 3: Apply the Sandbox

Once you’ve defined capabilities, apply them:
This is irreversible. After apply(), there is no way to expand permissions. The sandbox persists for the lifetime of the process and all child processes.

Step 4: Run Your Application

After applying the sandbox, your code runs with restricted permissions:

Complete Example

Here’s a complete sandboxed application:

Query Without Applying

Use QueryContext to check permissions without applying the sandbox:
This is useful for:
  • Validating configurations before deployment
  • Building permission-checking UIs
  • Testing capability sets

Next Steps

API Reference

Full documentation for all classes and functions

Examples

Real-world usage patterns and recipes