Skip to main content
The Palyra tool execution framework provides a secure, multi-layered environment for running agent-generated commands and plugins. Security is enforced through a combination of Cedar-based authorization policies, resource quotas, and operating system-level sandboxing. The system distinguishes between built-in tools (e.g., memory search, vault access) and external capabilities (e.g., shell commands, WASM plugins) that require stricter isolation.

Execution Architecture Overview

When an agent requests a tool call, the palyrad daemon orchestrates a multi-stage validation and execution pipeline:
  1. Authorization: The request is evaluated against Cedar policies to check if the principal (agent/user) has the required capabilities for the specific tool.
  2. Resource Allocation: Budget tracking ensures the run does not exceed the maximum allowed tool calls.
  3. Sandbox Selection: Based on the ToolCallConfig, the execution is routed to the appropriate sandbox tier (B or C) or the WASM runtime.
  4. Attestation: Upon completion, a ToolAttestation is generated, capturing the executor used and the execution’s cryptographic hash.

System Flow: Tool Request to Sandbox

The following diagram illustrates how a natural language intent results in a sandboxed process execution via the palyrad daemon. Diagram: Tool Execution Lifecycle Sources: crates/palyra-daemon/src/tool_protocol.rs#19-26, crates/palyra-daemon/src/tool_protocol.rs#322-330, crates/palyra-policy/src/lib.rs#217-220

Core Components

1. Tool Protocol and Authorization

The ToolCallConfig defines the boundaries for tool execution, including timeouts and allowed capabilities like ProcessExec or Network. Every tool call must pass through decide_tool_call, which uses the Cedar policy engine to evaluate the request context (principal, device, channel) against a set of rules. For details, see Tool Protocol and Cedar Policy Authorization.

2. Sandbox Process Runner (Tiers B & C)

For executing shell commands and external binaries, Palyra uses a tiered sandboxing approach managed by run_constrained_process crates/palyra-daemon/src/sandbox_runner.rs#147-151.
TierEnforcement MechanismPlatform
Tier BUnix rlimit (CPU/Memory) and workspace scope validation.Unix-like crates/palyra-daemon/src/sandbox_runner.rs#65-66
Tier COS-level namespaces/containers (e.g., bwrap, sandbox-exec).Linux, macOS, Windows crates/palyra-sandbox/src/lib.rs#8-13
The runner enforces Egress Enforcement Modes (None, Preflight, Strict) to control network access during execution crates/palyra-daemon/src/sandbox_runner.rs#47-51. For details, see Sandbox Process Runner (Tier B and Tier C).

3. WASM Plugin Runtime

Palyra supports extensible “Skills” implemented as WebAssembly (WASM) plugins. This provides a high-performance, language-agnostic way to add capabilities without granting full shell access.
  • Runtime: Built on wasmtime, providing fine-grained “fuel” budgeting and memory limits crates/palyra-daemon/src/tool_protocol.rs#115-127.
  • Isolation: Plugins are restricted to the WIT (Wasm Interface Type) surface, preventing unauthorized system calls.
For details, see WASM Plugin Runtime and Skills.

Security Guardrails

The execution environment includes several hardcoded safety measures to prevent common exploitation patterns: Diagram: Sandbox Constraint Mapping Sources: crates/palyra-daemon/src/sandbox_runner.rs#168-195, crates/palyra-sandbox/src/lib.rs#107-120

Child Pages

Sources: crates/palyra-daemon/src/tool_protocol.rs, crates/palyra-daemon/src/sandbox_runner.rs, crates/palyra-policy/src/lib.rs, crates/palyra-sandbox/src/lib.rs

Child Pages