DocsSecurityTier System

Tier System

Every tool in Ryvos has a base security tier. The SecurityGate evaluates each call and may escalate the effective tier based on input inspection.

Tier Definitions

T0 — Safe

Read-only operations with no side effects. Always auto-approved.

ToolDescription
readRead file contents
globFile pattern matching
grepFull-text search in files
memory_searchSearch across session history (FTS5)

T1 — Low Risk

Reversible writes and low-risk network operations. Auto-approved by default.

ToolDescription
web_fetchFetch and parse web pages
web_searchWeb search (Tavily)
memory_writeWrite to persistent memory

T2 — Medium Risk

File modifications and system changes. Requires approval by default.

ToolDescription
writeCreate or overwrite files
editLine-based file editing
apply_patchApply patch files

T3 — High Risk

Shell execution, network operations, and agent spawning. Always requires approval.

ToolDescription
bashExecute shell commands
spawn_agentCreate child agent

T4 — Critical / Dangerous

Matched by dangerous pattern detection. Always denied, no override.

Examples: rm -rf /, DROP TABLE, curl|bash, mkfs, dd if=

Effective Tier Calculation

The effective tier is the maximum of:

  1. The tool's base tier
  2. Any escalation from dangerous pattern matching
effective_tier = max(tool.tier, pattern_escalation)

For example, bash has base tier T3. If the command matches rm -rf, it's escalated to T4.

Security Policy

The policy maps tiers to actions:

[security]
auto_approve_up_to = "t1"   # T0-T1: Allow
deny_above = null            # Only T4 denied (set to "t3" for stricter)
approval_timeout_secs = 60   # T2-T3: Approval with timeout
Effective TierPolicy Decision
T0Allow
T1Allow
T2NeedsApproval
T3NeedsApproval
T4Deny

Sub-Agent Policy

Spawned agents run under a stricter policy:

[security.sub_agent_policy]
auto_approve_up_to = "t0"   # Only T0 auto-approved
deny_above = "t2"           # T3+ denied entirely

This prevents the LLM from escalating privileges by spawning agents that execute dangerous commands.

Customization

You can adjust the tier boundaries to match your risk tolerance:

# Paranoid mode — approve everything
[security]
auto_approve_up_to = "t0"
 
# YOLO mode — auto-approve all except T4
[security]
auto_approve_up_to = "t3"
 
# Air-gapped — deny all network + shell
[security]
deny_above = "t1"