Add shared safety constants for provider subagents.

This commit is contained in:
CREDO23 2026-04-29 16:25:28 +02:00
parent dce08e8b25
commit 8ddfa6ac6f

View file

@ -0,0 +1,40 @@
"""Shared constants for provider subagent safety policies."""
from __future__ import annotations
# Generic mutation-deny patterns for read-only specialist roles.
WRITE_TOOL_DENY_PATTERNS: tuple[str, ...] = (
"*create*",
"*update*",
"*delete*",
"*send*",
"*write*",
"*edit*",
"*move*",
"*mkdir*",
"*upload*",
"edit_file",
"write_file",
"move_file",
"mkdir",
"update_memory",
"update_memory_team",
"update_memory_private",
)
# Tools that mutate virtual KB filesystem or parent/global chat state.
# Provider specialists should not mutate these surfaces directly.
NON_PROVIDER_STATE_MUTATION_DENY: frozenset[str] = frozenset(
{
# Exact tool names from shared deny patterns.
*{
name
for name in WRITE_TOOL_DENY_PATTERNS
if "*" not in name
},
# Additional non-provider state mutation controls.
"write_todos",
"task",
}
)