Skip to main content
The Palyra Skills system provides a secure, auditable, and sandboxed framework for extending the daemon’s capabilities. It encompasses the entire lifecycle of an extension—from packaging and cryptographic signing to execution within a WebAssembly (Wasm) runtime with fine-grained capability grants.

Skill Artifact Lifecycle

A “Skill” is a signed bundle containing Wasm modules, metadata, and security manifests. The lifecycle is managed by the palyra-skills crate and the palyra skills CLI command group.

1. Packaging and Signing

Skills are packaged into a specific archive format (.palyra-skill) containing a skill.toml manifest, Wasm modules, and cryptographic signatures.

2. Verification and Trust (TOFU)

Palyra employs a Trust-on-First-Use (TOFU) model for skill publishers, managed via a TrustStore.

Artifact Structure Diagram

This diagram bridges the physical file structure to the internal logic used during verification. Title: Skill Artifact Verification Flow Sources: crates/palyra-skills/src/lib.rs#1-24, crates/palyra-cli/src/commands/skills.rs#106-141

Plugin Runtime (Wasmtime)

The palyra-plugins-runtime crate provides the execution environment for Skill modules using wasmtime. It enforces strict isolation and resource limits.

Execution Model

The WasmRuntime manages the lifecycle of a single execution call:
  1. Instantiation: Creates a wasmtime::Store with RuntimeStoreState containing limits and capability handles crates/palyra-plugins/runtime/src/lib.rs#161-172.
  2. Fuel Injection: Uses Wasmtime’s fuel mechanism to limit CPU cycles crates/palyra-plugins/runtime/src/lib.rs#174-174.
  3. Epoch Interruption: Handles wall-clock timeouts via an async-friendly epoch deadline crates/palyra-plugins/runtime/src/lib.rs#175-177.

Capability Sandboxing

Plugins cannot access the host system directly. They interact through a set of host functions (imports) that are gated by CapabilityGrantSet.
CapabilityHost Function PrefixDescription
HTTPhost_capability_http_Gated by http_egress_allowlist in manifest.
Secretshost_capability_secret_Access to specific Vault keys mapped to the skill.
Storagehost_capability_storage_Prefixed filesystem access within the state root.
Channelshost_capability_channel_Interaction with specific chat connectors.
Sources: crates/palyra-plugins/runtime/src/lib.rs#3-9, crates/palyra-plugins/runtime/src/lib.rs#42-48, crates/palyra-skills/examples/echo-http/skill.toml#24-41

Runtime Execution Diagram

This diagram maps the palyra-daemon runner to the underlying wasmtime primitives. Title: Wasm Plugin Execution Pipeline Sources: crates/palyra-daemon/src/wasm_plugin_runner.rs#96-126, crates/palyra-plugins/runtime/src/lib.rs#105-186

Quarantine and Security Audit

The daemon implements a quarantine mechanism for skills that fail security checks or lack explicit operator approval.

Quarantine Triggers

A skill enters a quarantined state if:
  • Signature Mismatch: The artifact signature does not match the pinned key in the TrustStore.
  • Audit Failure: Static analysis detects risky imports or exceeds module size limits (DEFAULT_SKILL_AUDIT_MAX_MODULE_BYTES) crates/palyra-skills/src/lib.rs#14-14.
  • Policy Violation: The skill requests capabilities (e.g., broad filesystem access) not permitted by the global palyrad configuration.

Inventory Management

The CLI provides tools to inspect the status of installed skills and manage their lifecycle. Sources: crates/palyra-cli/src/output/skills.rs#4-119, crates/palyra-skills/src/lib.rs#12-24