Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/desktop/studio_server/tool_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
from kiln_ai.utils.exhaustive_error import raise_exhaustive_enum_error
from kiln_server.project_api import project_from_id
from kiln_server.task_api import task_from_id
from kiln_server.utils.agent_checks.policy import ALLOW_AGENT, DENY_AGENT
from kiln_server.utils.agent_checks.policy import (
ALLOW_AGENT,
DENY_AGENT,
agent_policy_require_approval,
)
from mcp.types import Tool as MCPTool
from pydantic import BaseModel, Field

Expand Down Expand Up @@ -818,7 +822,9 @@ def _validate_kiln_task_tool_task_and_run_config(
@app.post(
"/api/projects/{project_id}/kiln_task_tool",
tags=["Tools & MCP"],
openapi_extra=DENY_AGENT,
openapi_extra=agent_policy_require_approval(
"Register a Kiln task as a tool (also called a sub-agent), making it callable by other agents and run configs."
),
)
async def add_kiln_task_tool(
project_id: Annotated[
Expand Down Expand Up @@ -852,7 +858,9 @@ async def add_kiln_task_tool(
@app.patch(
"/api/projects/{project_id}/edit_kiln_task_tool/{tool_server_id}",
tags=["Tools & MCP"],
openapi_extra=DENY_AGENT,
openapi_extra=agent_policy_require_approval(
"Edit a Kiln task tool (also called a sub-agent), including its name, description, underlying task, or run config."
),
)
async def edit_kiln_task_tool(
project_id: Annotated[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"method": "patch",
"path": "/api/projects/{project_id}/edit_kiln_task_tool/{tool_server_id}",
"agent_policy": {
"permission": "deny",
"requires_approval": false
"permission": "allow",
"requires_approval": true,
"approval_description": "Edit a Kiln task tool (also called a sub-agent), including its name, description, underlying task, or run config."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"method": "post",
"path": "/api/projects/{project_id}/kiln_task_tool",
"agent_policy": {
"permission": "deny",
"requires_approval": false
"permission": "allow",
"requires_approval": true,
"approval_description": "Register a Kiln task as a tool (also called a sub-agent), making it callable by other agents and run configs."
}
}
Loading