wardstone

Crates.iowardstone
lib.rswardstone
version0.1.0
created_at2025-12-14 20:26:51.083344+00
updated_at2025-12-14 20:26:51.083344+00
descriptionSandboxing system for secure tool execution (Seatbelt/Landlock) - magical containment
homepage
repositoryhttps://github.com/moltenlabs/molten
max_upload_size
id1985049
size65,490
Chris Mathew (chriscmathew-dorsia)

documentation

README

🛡️ Wardstone

Sandboxing system for secure tool execution - magical containment.

Crates.io Documentation License

Overview

Wardstone provides platform-specific sandboxing for AI agent tool execution:

  • macOS: Seatbelt (sandbox-exec) with auto-generated .sbpl policies
  • Linux: Landlock LSM for filesystem isolation
  • Windows: Windows Sandbox (planned)

Features

  • 🔒 Filesystem isolation (read/write/execute permissions)
  • 🌐 Network access control
  • ⏱️ Execution timeouts
  • 🎯 Path-based permissions
  • 🔧 Easy policy builder API

Installation

[dependencies]
wardstone = "0.1"

Usage

use wardstone::{SandboxPolicy, create_sandbox, NetworkPolicy};
use std::process::Command;

// Create a restrictive policy
let policy = SandboxPolicy::new()
    .allow_read("/usr")
    .allow_read("/lib")
    .allow_write("./output")
    .with_network(NetworkPolicy::None)
    .with_timeout(std::time::Duration::from_secs(60));

// Create platform-specific sandbox
let sandbox = create_sandbox(policy)?;

// Wrap a command with sandbox restrictions
let cmd = Command::new("./my-script.sh");
let sandboxed_cmd = sandbox.wrap_command(cmd)?;

Policy Builder

use wardstone::{SandboxPolicy, NetworkPolicy};

let policy = SandboxPolicy::default_for_tools("/home/user/project".into())
    .allow_read("/tmp")
    .allow_localhost()  // Allow localhost network only
    .allow_spawn(true); // Allow spawning subprocesses

Platform Support

Platform Implementation Status
macOS Seatbelt ✅ Complete
Linux Landlock ✅ Complete
Windows Windows Sandbox 🚧 Planned

Part of the Goblin Family

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt