Installation

Prerequisites

  • Rust stable toolchain - install from rustup.rs
  • Linux - required for full functionality (seccomp-BPF, AppArmor, cgroups, nftables, overlayfs)
  • Recommended: Windows with WSL 2 (Debian) for development on Windows hosts

Optional tools used by specific features:

  • python3, node - needed for sandbox.exec with those runtimes
  • mdbook - to build this documentation

Building from Source

# Clone the repository
git clone <repo-url> Scarab-Runtime
cd Scarab-Runtime

# Build all crates
cargo build

# Run all tests (unit + integration)
cargo test

# Run enforcement tests (requires root - validates cgroups, AppArmor, seccomp)
sudo cargo test

Build artifacts are placed in target/debug/:

BinaryPath
agentdtarget/debug/agentd
ashtarget/debug/ash
example-agenttarget/debug/example-agent

Release Build

cargo build --release
# Binaries in target/release/

System Directories

agentd expects or creates these directories at runtime:

PathPurpose
/run/agentd/Unix socket (agentd.sock)
/var/lib/scarab-runtime/Agent install store, SQLite memory DB
/var/log/scarab-runtime/Audit log, observation logs

For development, agentd will create these under /tmp/agentd-* if it lacks permission to write to /run/ and /var/.

OpenRouter API Key

The lm.complete and lm.embed tools route LLM requests through OpenRouter. Set your key before starting agentd:

export OPENROUTER_API_KEY=sk-or-...

Or register it as a secret so agents can reference it via handle syntax:

ash secrets add openrouter-key