mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-06 14:22:47 +02:00
Add shared safety constants for provider subagents.
This commit is contained in:
parent
dce08e8b25
commit
8ddfa6ac6f
1 changed files with 40 additions and 0 deletions
40
surfsense_backend/app/agents/new_chat/subagents/constants.py
Normal file
40
surfsense_backend/app/agents/new_chat/subagents/constants.py
Normal 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",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue