Skip to main content
Palyra employs a defense-in-depth security architecture designed to execute untrusted agent-generated code and tool calls safely. The system integrates a formal policy engine, multi-tiered sandboxing, encrypted secret management, and a robust identity framework to ensure that every action is authenticated, authorized, and isolated.

Security Architecture Overview

The security posture of palyrad is governed by several interlocking subsystems that validate requests before they reach the execution runtime.

System Interplay Diagram

This diagram illustrates the flow of a tool execution request through the security subsystems. Sources: crates/palyra-daemon/src/tool_protocol.rs#37-44, crates/palyra-policy/src/lib.rs#1-10, crates/palyra-daemon/src/sandbox_runner.rs#1-80, crates/palyra-vault/src/lib.rs#1-20

Tool Execution & Sandbox Tiers

Palyra provides a multi-tiered approach to tool execution, allowing operators to balance performance and security. For details, see Tool Execution & Sandbox Tiers. Sources: crates/palyra-daemon/src/tool_protocol.rs#115-127, crates/palyra-daemon/src/sandbox_runner.rs#65-78, crates/palyra-sandbox/src/lib.rs#8-13

Policy Engine (Cedar)

The palyra-policy crate uses the Cedar policy language to evaluate if an action (e.g., tool.execute, vault.get) should be permitted based on the principal, resource, and context crates/palyra-policy/src/lib.rs#99-181. For details, see Policy Engine (Cedar). Sources: crates/palyra-policy/src/lib.rs#11-15, crates/palyra-policy/src/lib.rs#99-181, crates/palyra-policy/src/lib.rs#40-58

Vault & Secret Management

The palyra-vault crate manages sensitive credentials. It supports multiple backends, including the macOS Keychain, Linux Secret Service, and Windows DPAPI crates/palyra-vault/src/backend.rs#39-49. For details, see Vault & Secret Management. Sources: crates/palyra-vault/src/backend.rs#39-49, crates/palyra-vault/src/backend.rs#88-93, crates/palyra-vault/src/lib.rs#16-16

Identity, mTLS & Device Pairing

Security between the CLI, Web Console, and Daemon is anchored in mutual TLS (mTLS). The palyra-identity subsystem manages the Certificate Authority (CA) and device-specific certificates. For details, see Identity, mTLS & Device Pairing. Sources: crates/palyra-cli/tests/pairing_flow.rs#17-28, crates/palyra-cli/tests/pairing_flow.rs#112-140

Human-in-the-Loop Approvals

When the Policy Engine determines an action is “sensitive,” Palyra pauses execution and generates an ApprovalRecord. For details, see Human-in-the-Loop Approvals. Sources: crates/palyra-daemon/src/tool_protocol.rs#32-34, crates/palyra-daemon/src/tool_protocol.rs#253-264

Security Component Mapping

The following table maps high-level security concepts to their implementation entities in the codebase.
Security ConceptCode EntityPath
Sandbox Executionrun_constrained_processcrates/palyra-daemon/src/sandbox_runner.rs#147-151
Policy Evaluationevaluate_with_contextcrates/palyra-policy/src/lib.rs#211-215
Secret StorageBlobBackendcrates/palyra-vault/src/backend.rs#88-93
Tool MetadataToolMetadatacrates/palyra-daemon/src/tool_protocol.rs#67-70
Egress ControlEgressEnforcementModecrates/palyra-daemon/src/sandbox_runner.rs#47-51
Sources: crates/palyra-daemon/src/sandbox_runner.rs#147-151, crates/palyra-policy/src/lib.rs#211-215, crates/palyra-vault/src/backend.rs#88-93, crates/palyra-daemon/src/tool_protocol.rs#67-70, crates/palyra-daemon/src/sandbox_runner.rs#47-51

Child Pages