fix(agent): close untrusted-context gate bypasses

This commit is contained in:
RaresKeY
2026-08-15 01:58:32 +00:00
parent 329f9d298d
commit 2295504141
16 changed files with 287 additions and 66 deletions
+7 -1
View File
@@ -18,17 +18,23 @@ from types import SimpleNamespace
import pytest
from src.tool_execution import (
NO_TOOL_SECURITY_CONTEXT,
_AGENT_WORKDIR,
_active_workspace,
_resolve_search_root,
_resolve_tool_path,
_resolve_tool_path_in_workspace,
agent_cwd,
execute_tool_block,
execute_tool_block as _execute_tool_block,
get_active_workspace,
)
async def execute_tool_block(*args, **kwargs):
kwargs.setdefault("security_context", NO_TOOL_SECURITY_CONTEXT)
return await _execute_tool_block(*args, **kwargs)
def _block(tool, content=""):
return SimpleNamespace(tool_type=tool, content=content)