Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(agents.tsx): support granting agents access to subagents

Krrish Dholakia57a48e352695
diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
index 8d4bdffb2dd..939f1eb0f45 100644
--- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
+++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma
@@ -267,6 +267,7 @@ model LiteLLM_ObjectPermissionTable {
vector_stores String[] @default([])
agents String[] @default([])
agent_access_groups String[] @default([])
+ models String[] @default([])
blocked_tools String[] @default([]) // Tool names blocked for any key/team/user with this permission
teams LiteLLM_TeamTable[]
projects LiteLLM_ProjectTable[]
diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py
index 36790e9feae..add3ab4a1f6 100644
--- a/litellm/proxy/_types.py
+++ b/litellm/proxy/_types.py
@@ -1,59 +1,40 @@
import enum
import json
from datetime import datetime
-from typing import TYPE_CHECKING, Any, Callable, Dict, List, Literal, Optional, Union
+from typing import (TYPE_CHECKING, Any, Callable, Dict, List, Literal,
+ Optional, Union)
import httpx
-from pydantic import (
- BaseModel,
- ConfigDict,
- Field,
- Json,
- field_validator,
- model_validator,
-)
+from pydantic import (BaseModel, ConfigDict, Field, Json, field_validator,
+ model_validator)
from typing_extensions import Required, TypedDict
from litellm._uuid import uuid
from litellm.types.integrations.slack_alerting import AlertType
-from litellm.types.llms.openai import (
- AllMessageValues,
- OpenAIFileObject,
- ResponsesAPIResponse,
-)
-from litellm.types.mcp import (
- MCPAuthType,
- MCPCredentials,
- MCPTransport,
- MCPTransportType,
-)
+from litellm.types.llms.openai import (AllMessageValues, OpenAIFileObject,
+ ResponsesAPIResponse)
+from litellm.types.mcp import (MCPAuthType, MCPCredentials, MCPTransport,
+ MCPTransportType)
from litellm.types.mcp_server.mcp_server_manager import MCPInfo
from litellm.types.router import RouterErrors, UpdateRouterConfig
from litellm.types.secret_managers.main import KeyManagementSystem
-from litellm.types.utils import (
- CallTypes,
- CostBreakdown,
- EmbeddingResponse,
- GenericBudgetConfigType,
- ImageResponse,
- LiteLLMBatch,
- LiteLLMFineTuningJob,
- LiteLLMPydanticObjectBase,
- ModelResponse,
- ProviderField,
- StandardCallbackDynamicParams,
- StandardLoggingGuardrailInformation,
- StandardLoggingMCPToolCall,
- StandardLoggingModelInformation,
- StandardLoggingPayloadErrorInformation,
- StandardLoggingPayloadStatus,
- StandardLoggingVectorStoreRequest,
- StandardPassThroughResponseObject,
- TextCompletionResponse,
-)
+from litellm.types.utils import (CallTypes, CostBreakdown, EmbeddingResponse,
+ GenericBudgetConfigType, ImageResponse,
+ LiteLLMBatch, LiteLLMFineTuningJob,
+ LiteLLMPydanticObjectBase, ModelResponse,
+ ProviderField, StandardCallbackDynamicParams,
+ StandardLoggingGuardrailInformation,
+ StandardLoggingMCPToolCall,
+ StandardLoggingModelInformation,
+ StandardLoggingPayloadErrorInformation,
+ StandardLoggingPayloadStatus,
+ StandardLoggingVectorStoreRequest,
+ StandardPassThroughResponseObject,
+ TextCompletionResponse)
from litellm.types.videos.main import VideoObject
-from .types_utils.utils import get_instance_fn, validate_custom_validate_return_type
+from .types_utils.utils import (get_instance_fn,
+ validate_custom_validate_return_type)
if TYPE_CHECKING:
from opentelemetry.trace import Span as _Span
@@ -855,6 +836,7 @@ class LiteLLM_ObjectPermissionBase(LiteLLMPydanticObjectBase):
vector_stores: Optional[List[str]] = None
agents: Optional[List[str]] = None
agent_access_groups: Optional[List[str]] = None
+ models: Optional[List[str]] = None
class GenerateRequestBase(LiteLLMPydanticObjectBase):
@@ -2470,7 +2452,8 @@ class UserAPIKeyAuth(
This is used to track number of requests/spend for health check calls.
"""
- from litellm.constants import LITTELM_INTERNAL_HEALTH_SERVICE_ACCOUNT_NAME
+ from litellm.constants import \
+ LITTELM_INTERNAL_HEALTH_SERVICE_ACCOUNT_NAME
return cls(
api_key=LITTELM_INTERNAL_HEALTH_SERVICE_ACCOUNT_NAME,
@@ -2502,7 +2485,8 @@ class UserAPIKeyAuth(
This is used to track actions performed by automated system jobs.
"""
- from litellm.constants import LITELLM_INTERNAL_JOBS_SERVICE_ACCOUNT_NAME
+ from litellm.constants import \
+ LITELLM_INTERNAL_JOBS_SERVICE_ACCOUNT_NAME
return cls(
api_key=LITELLM_INTERNAL_JOBS_SERVICE_ACCOUNT_NAME,
@@ -2908,7 +2892,8 @@ class LiteLLM_AuditLogs(LiteLLMPydanticObjectBase):
@model_validator(mode="after")
def mask_api_keys(self):
- from litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMasker
+ from litellm.litellm_core_utils.sensitive_data_masker import \
+ SensitiveDataMasker
masker = SensitiveDataMasker(sensitive_patterns={"key"})
diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prisma
index 721c3e404d2..b68872e2ed8 100644
--- a/litellm/proxy/schema.prisma
+++ b/litellm/proxy/schema.prisma
@@ -267,6 +267,7 @@ model LiteLLM_ObjectPermissionTable {
vector_stores String[] @default([])
agents String[] @default([])
agent_access_groups String[] @default([])
+ models String[] @default([])
blocked_tools String[] @default([]) // Tool names blocked for any key/team/user with this permission
teams LiteLLM_TeamTable[]
projects LiteLLM_ProjectTable[]
diff --git a/litellm/types/agents.py b/litellm/types/agents.py
index 951fbfcabd1..efb2e73bfb5 100644
--- a/litellm/types/agents.py
+++ b/litellm/types/agents.py
@@ -172,6 +172,8 @@ class AgentObjectPermission(TypedDict, total=False):
mcp_servers: Optional[List[str]]
mcp_access_groups: Optional[List[str]]
mcp_tool_permissions: Optional[Dict[str, List[str]]]
+ models: Optional[List[str]]
+ agents: Optional[List[str]]
class AgentConfig(TypedDict, total=False):
diff --git a/schema.prisma b/schema.prisma
index 8d4bdffb2dd..939f1eb0f45 100644
--- a/schema.prisma
+++ b/schema.prisma
@@ -267,6 +267,7 @@ model LiteLLM_ObjectPermissionTable {
vector_stores String[] @default([])
agents String[] @default([])
agent_access_groups String[] @default([])
+ models String[] @default([])
blocked_tools String[] @default([]) // Tool names blocked for any key/team/user with this permission
teams LiteLLM_TeamTable[]
projects LiteLLM_ProjectTable[]
diff --git a/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx b/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx
index 0cec0331f43..5b739e5a16b 100644
--- a/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx
+++ b/ui/litellm-dashboard/src/components/agents/add_agent_form.tsx
@@ -6,6 +6,7 @@ import CreatedKeyDisplay from "../shared/CreatedKeyDisplay";
import {
createAgentCall,
getAgentCreateMetadata,
+ getAgentsList,
keyCreateForAgentCall,
keyListCall,
keyUpdateCall,
@@ -45,7 +46,7 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
const [agentTypeMetadata, setAgentTypeMetadata] = useState<AgentCreateInfo[]>([]);
const [loadingMetadata, setLoadingMetadata] = useState(false);
- // Step 1: key assignment state
+ // Step 3: key assignment state
const [keyAssignOption, setKeyAssignOption] = useState<"create_new" | "existing_key" | "skip">("create_new");
const [newKeyName, setNewKeyName] = useState<string>("");
const [newKeyModels, setNewKeyModels] = useState<string[]>([]);
@@ -54,8 +55,10 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
const [loadingKeys, setLoadingKeys] = useState(false);
const [availableModels, setAvailableModels] = useState<string[]>([]);
const [loadingModels, setLoadingModels] = useState(false);
+ const [availableAgents, setAvailableAgents] = useState<{agent_id: string; agent_name: string}[]>([]);
+ const [loadingAgents, setLoadingAgents] = useState(false);
- // Step 2: results
+ // Step 4: results
const [createdAgentName, setCreatedAgentName] = useState<string>("");
const [createdKeyValue, setCreatedKeyValue] = useState<string | null>(null);
const [assignedKeyAlias, setAssignedKeyAlias] = useState<string | null>(null);
@@ -82,9 +85,9 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
fetchMetadata();
}, []);
- // Fetch existing keys when assign key step becomes active (step 2)
+ // Fetch existing keys when Agent Management step becomes active (step 3)
useEffect(() => {
- if (currentStep === 2 && accessToken && existingKeys.length === 0) {
+ if (currentStep === 3 && accessToken && existingKeys.length === 0) {
const fetchKeys = async () => {
setLoadingKeys(true);
try {
@@ -100,9 +103,9 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
}
}, [currentStep, accessToken]);
- // Fetch available models when Assign Key step is active (same list as key generation)
+ // Fetch available models when Agent Management step is active (same list as key generation)
useEffect(() => {
- if (currentStep !== 2 || !accessToken || !userId || !userRole) return;
+ if ((currentStep !== 1 && currentStep !== 3) || !accessToken || !userId || !userRole) return;
let cancelled = false;
setLoadingModels(true);
modelAvailableCall(accessToken, userId, userRole)
@@ -125,6 +128,25 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
};
}, [currentStep, accessToken, userId, userRole]);
+ useEffect(() => {
+ if (currentStep !== 1 || !accessToken) return;
+ let cancelled = false;
+ setLoadingAgents(true);
+ getAgentsList(accessToken)
+ .then((response) => {
+ if (cancelled) return;
+ const agents = response?.agents ?? [];
+ setAvailableAgents(agents.map((a: any) => ({ agent_id: a.agent_id, agent_name: a.agent_name })));
+ })
+ .catch((error) => {
+ if (!cancelled) console.error("Error fetching agents:", error);
+ })
+ .finally(() => {
+ if (!cancelled) setLoadingAgents(false);
+ });
+ return () => { cancelled = true; };
+ }, [currentStep, accessToken]);
+
const selectedAgentTypeInfo = agentTypeMetadata.find(
(info) => info.agent_type === agentType
);
@@ -207,11 +229,14 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
// Build object_permission from MCP Tools step (allowed_mcp_servers_and_groups, mcp_tool_permissions)
const mcpServersAndGroups = values.allowed_mcp_servers_and_groups;
const mcpToolPermissions = values.mcp_tool_permissions || {};
- if (
- mcpServersAndGroups &&
- (mcpServersAndGroups.servers?.length > 0 || mcpServersAndGroups.accessGroups?.length > 0) ||
- Object.keys(mcpToolPermissions).length > 0
- ) {
+ const entitlementModels = values.entitlement_models || [];
+ const entitlementAgents = values.entitlement_agents || [];
+ const hasObjectPermission =
+ (mcpServersAndGroups?.servers?.length > 0 || mcpServersAndGroups?.accessGroups?.length > 0) ||
+ Object.keys(mcpToolPermissions).length > 0 ||
+ entitlementModels.length > 0 ||
+ entitlementAgents.length > 0;
+ if (hasObjectPermission) {
agentData.object_permission = {};
if (mcpServersAndGroups?.servers?.length > 0) {
agentData.object_permission.mcp_servers = mcpServersAndGroups.servers;
@@ -222,6 +247,12 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
if (Object.keys(mcpToolPermissions).length > 0) {
agentData.object_permission.mcp_tool_permissions = mcpToolPermissions;
}
+ if (entitlementModels.length > 0) {
+ agentData.object_permission.models = entitlementModels;
+ }
+ if (entitlementAgents.length > 0) {
+ agentData.object_permission.agents = entitlementAgents;
+ }
}
// Wire trace-id flags and budget controls into agent litellm_params (before create call)
@@ -264,7 +295,7 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
setAssignedKeyAlias(keyInfo?.key_alias || selectedExistingKey.slice(0, 12) + "…");
}
- setCurrentStep(3);
+ setCurrentStep(4);
onSuccess();
} catch (error) {
console.error("Error creating agent:", error);
@@ -293,11 +324,54 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
onClose();
};
- const renderMCPToolsStep = () => (
+ const renderEntitlementsStep = () => (
<div className="space-y-4">
<p className="text-sm text-gray-600">
- Optionally restrict which MCP servers and tools this agent can use. Leave empty to allow all (subject to key/team permissions).
+ Configure which models, agents, and MCP tools this agent is allowed to use. Leave fields empty to allow all (subject to key/team permissions).
</p>
+
+ <Form.Item
+ label={<span className="text-sm font-medium text-gray-700">Allowed Models</span>}
+ name="entitlement_models"
+ tooltip="Restrict which models this agent can call. Leave empty to allow all."
+ >
+ <Select
+ mode="tags"
+ style={{ width: "100%" }}
+ placeholder={loadingModels ? "Loading models..." : "Select models (leave empty for all)"}
+ tokenSeparators={[","]}
+ loading={loadingModels}
+ showSearch
+ options={availableModels.map((m) => ({
+ label: getModelDisplayName(m),
+ value: m,
+ }))}
+ />
+ </Form.Item>
+
+ <Form.Item
+ label={<span className="text-sm font-medium text-gray-700">Allowed Agents (Sub-Agents)</span>}
+ name="entitlement_agents"
+ tooltip="Restrict which other agents this agent can invoke as sub-agents. Leave empty to allow all."
+ >
+ <Select
+ mode="multiple"
+ style={{ width: "100%" }}
+ placeholder={loadingAgents ? "Loading agents..." : "Select agents (leave empty for all)"}
+ loading={loadingAgents}
+ showSearch
+ filterOption={(input, option) =>
+ (option?.label as string ?? "").toLowerCase().includes(input.toLowerCase())
+ }
+ options={availableAgents.map((a) => ({
+ label: a.agent_name,
+ value: a.agent_id,
+ }))}
+ />
+ </Form.Item>
+
+ <Divider className="my-2" />
+
<Form.Item
label={
<span>
@@ -338,122 +412,121 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
</div>
)}
</Form.Item>
+ </div>
+ );
- <Collapse ghost className="mt-6" items={[
- {
- key: "tracing",
- label: <span className="text-sm font-medium text-gray-700">Tracing</span>,
- children: (
- <div className="space-y-4">
- <div className="flex items-center justify-between">
- <div>
- <span className="text-sm font-medium text-gray-700">
- Require x-litellm-trace-id on calls TO this agent
- </span>
- <p className="text-xs text-gray-500 mt-1">
- Only accept this agent being invoked with a trace-id (e.g. when used as a sub-agent).
- </p>
- </div>
- <Switch
- checked={requireTraceIdInbound}
- onChange={setRequireTraceIdInbound}
- />
- </div>
-
- <div className="flex items-center justify-between">
- <div>
- <span className="text-sm font-medium text-gray-700">
- Require x-litellm-trace-id on calls BY this agent
- </span>
- <p className="text-xs text-gray-500 mt-1">
- Requires LLM/MCP calls made by this agent to include x-litellm-trace-id for session tracking.
- </p>
- </div>
- <Switch
- checked={requireTraceIdOutbound}
- onChange={(checked) => {
- setRequireTraceIdOutbound(checked);
- if (!checked) {
- setMaxIterations(null);
- setMaxBudgetPerSession(null);
- }
- }}
- />
- </div>
+ const renderObservabilityStep = () => (
+ <div className="space-y-6">
+ <div>
+ <h4 className="text-sm font-medium text-gray-700 mb-3">Tracing</h4>
+ <div className="space-y-4">
+ <div className="flex items-center justify-between">
+ <div>
+ <span className="text-sm font-medium text-gray-700">
+ Require x-litellm-trace-id on calls TO this agent
+ </span>
+ <p className="text-xs text-gray-500 mt-1">
+ Only accept this agent being invoked with a trace-id (e.g. when used as a sub-agent).
+ </p>
</div>
- ),
- },
- {
- key: "budgets_and_rate_limits",
- label: <span className="text-sm font-medium text-gray-700">Budgets &amp; Rate Limits</span>,
- children: (
- <div className="space-y-4">
- {!requireTraceIdOutbound && (
- <div className="p-3 bg-yellow-50 border border-yellow-200 rounded-lg text-sm text-yellow-800">
- Enable &quot;Require x-litellm-trace-id on calls BY this agent&quot; in Tracing to configure budgets and rate limits.
- </div>
- )}
+ <Switch
+ checked={requireTraceIdInbound}
+ onChange={setRequireTraceIdInbound}
+ />
+ </div>
- <div className="text-sm font-medium text-gray-700">Session Budgets</div>
- <div className="grid grid-cols-2 gap-4">
- <div>
- <label className="text-sm text-gray-600 block mb-1">Max Iterations</label>
- <InputNumber
- className="w-full"
- min={1}
- placeholder="e.g. 25"
- disabled={!requireTraceIdOutbound}
- value={maxIterations}
- onChange={(val) => setMaxIterations(val)}
- />
- <p className="text-xs text-gray-400 mt-1">Hard cap on LLM calls per session</p>
- </div>
- <div>
- <label className="text-sm text-gray-600 block mb-1">Max Budget Per Session ($)</label>
- <InputNumber
- className="w-full"
- min={0.01}
- step={0.5}
- placeholder="e.g. 5.00"
- disabled={!requireTraceIdOutbound}
- value={maxBudgetPerSession}
- onChange={(val) => setMaxBudgetPerSession(val)}
- />
- <p className="text-xs text-gray-400 mt-1">Max spend per trace before returning 429</p>
- </div>
- </div>
+ <div className="flex items-center justify-between">
+ <div>
+ <span className="text-sm font-medium text-gray-700">
+ Require x-litellm-trace-id on calls BY this agent
+ </span>
+ <p className="text-xs text-gray-500 mt-1">
+ Requires LLM/MCP calls made by this agent to include x-litellm-trace-id for session tracking.
+ </p>
+ </div>
+ <Switch
+ checked={requireTraceIdOutbound}
+ onChange={(checked) => {
+ setRequireTraceIdOutbound(checked);
+ if (!checked) {
+ setMaxIterations(null);
+ setMaxBudgetPerSession(null);
+ }
+ }}
+ />
+ </div>
+ </div>
+ </div>
- <Divider className="my-2" />
+ <Divider className="my-0" />
- <div className="text-sm font-medium text-gray-700">Agent Rate Limits</div>
- <p className="text-xs text-gray-500">
- Global rate limits applied across all callers of this agent.
- </p>
- <div className="grid grid-cols-2 gap-4">
- <Form.Item label="TPM Limit" name="tpm_limit" className="mb-0">
- <InputNumber className="w-full" min={0} placeholder="e.g. 100000" disabled={!requireTraceIdOutbound} />
- </Form.Item>
- <Form.Item label="RPM Limit" name="rpm_limit" className="mb-0">
- <InputNumber className="w-full" min={0} placeholder="e.g. 100" disabled={!requireTraceIdOutbound} />
- </Form.Item>
- </div>
+ <div>
+ <h4 className="text-sm font-medium text-gray-700 mb-3">Budgets &amp; Rate Limits</h4>
+ <div className="space-y-4">
+ {!requireTraceIdOutbound && (
+ <div className="p-3 bg-yellow-50 border border-yellow-200 rounded-lg text-sm text-yellow-800">
+ Enable &quot;Require x-litellm-trace-id on calls BY this agent&quot; in Tracing to configure budgets and rate limits.
+ </div>
+ )}
- <div className="text-sm font-medium text-gray-700 mt-4">Per-Session Rate Limits</div>
- <p className="text-xs text-gray-500">
- Rate limits per session (x-litellm-trace-id). Each session gets its own counters.
- </p>
- <div className="grid grid-cols-2 gap-4">
- <Form.Item label="Session TPM Limit" name="session_tpm_limit" className="mb-0">
- <InputNumber className="w-full" min={0} placeholder="e.g. 10000" disabled={!requireTraceIdOutbound} />
- </Form.Item>
- <Form.Item label="Session RPM Limit" name="session_rpm_limit" className="mb-0">
- <InputNumber className="w-full" min={0} placeholder="e.g. 20" disabled={!requireTraceIdOutbound} />
- </Form.Item>
- </div>
+ <div className="text-sm font-medium text-gray-700">Session Budgets</div>
+ <div className="grid grid-cols-2 gap-4">
+ <div>
+ <label className="text-sm text-gray-600 block mb-1">Max Iterations</label>
+ <InputNumber
+ className="w-full"
+ min={1}
+ placeholder="e.g. 25"
+ disabled={!requireTraceIdOutbound}
+ value={maxIterations}
+ onChange={(val) => setMaxIterations(val)}
+ />
+ <p className="text-xs text-gray-400 mt-1">Hard cap on LLM calls per session</p>
</div>
- ),
- },
- ]} />
+ <div>
+ <label className="text-sm text-gray-600 block mb-1">Max Budget Per Session ($)</label>
+ <InputNumber
+ className="w-full"
+ min={0.01}
+ step={0.5}
+ placeholder="e.g. 5.00"
+ disabled={!requireTraceIdOutbound}
+ value={maxBudgetPerSession}
+ onChange={(val) => setMaxBudgetPerSession(val)}
+ />
+ <p className="text-xs text-gray-400 mt-1">Max spend per trace before returning 429</p>
+ </div>
+ </div>
+
+ <Divider className="my-2" />
+
+ <div className="text-sm font-medium text-gray-700">Agent Rate Limits</div>
+ <p className="text-xs text-gray-500">
+ Global rate limits applied across all callers of this agent.
+ </p>
+ <div className="grid grid-cols-2 gap-4">
+ <Form.Item label="TPM Limit" name="tpm_limit" className="mb-0">
+ <InputNumber className="w-full" min={0} placeholder="e.g. 100000" disabled={!requireTraceIdOutbound} />
+ </Form.Item>
+ <Form.Item label="RPM Limit" name="rpm_limit" className="mb-0">
+ <InputNumber className="w-full" min={0} placeholder="e.g. 100" disabled={!requireTraceIdOutbound} />
+ </Form.Item>
+ </div>
+
+ <div className="text-sm font-medium text-gray-700 mt-4">Per-Session Rate Limits</div>
+ <p className="text-xs text-gray-500">
+ Rate limits per session (x-litellm-trace-id). Each session gets its own counters.
+ </p>
+ <div className="grid grid-cols-2 gap-4">
+ <Form.Item label="Session TPM Limit" name="session_tpm_limit" className="mb-0">
+ <InputNumber className="w-full" min={0} placeholder="e.g. 10000" disabled={!requireTraceIdOutbound} />
+ </Form.Item>
+ <Form.Item label="Session RPM Limit" name="session_rpm_limit" className="mb-0">
+ <InputNumber className="w-full" min={0} placeholder="e.g. 20" disabled={!requireTraceIdOutbound} />
+ </Form.Item>
+ </div>
+ </div>
+ </div>
</div>
);
@@ -645,25 +718,6 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
placeholder="e.g. my-agent-key"
/>
</div>
- <div>
- <label className="text-sm text-gray-600 block mb-1">
- Allowed Models <span className="text-gray-400">(optional — leave empty for all models)</span>
- </label>
- <Select
- mode="tags"
- style={{ width: "100%" }}
- placeholder={loadingModels ? "Loading models..." : "e.g. gpt-4o, claude-3-5-sonnet"}
- value={newKeyModels}
- onChange={setNewKeyModels}
- tokenSeparators={[","]}
- loading={loadingModels}
- showSearch
- options={availableModels.map((m) => ({
- label: getModelDisplayName(m),
- value: m,
- }))}
- />
- </div>
</div>
)}
</div>
@@ -783,8 +837,9 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
{/* Step indicator */}
<Steps current={currentStep} size="small" className="mb-8">
<Step title="Configure" />
- <Step title="Agent Settings" />
- <Step title="Assign Key" />
+ <Step title="Entitlements" />
+ <Step title="Governance" />
+ <Step title="Agent Management" />
<Step title="Ready" />
</Steps>
@@ -793,21 +848,22 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
layout="vertical"
initialValues={
agentType === "a2a"
- ? { ...getDefaultFormValues(), allowed_mcp_servers_and_groups: { servers: [], accessGroups: [] }, mcp_tool_permissions: {} }
- : { allowed_mcp_servers_and_groups: { servers: [], accessGroups: [] }, mcp_tool_permissions: {} }
+ ? { ...getDefaultFormValues(), allowed_mcp_servers_and_groups: { servers: [], accessGroups: [] }, mcp_tool_permissions: {}, entitlement_models: [], entitlement_agents: [] }
+ : { allowed_mcp_servers_and_groups: { servers: [], accessGroups: [] }, mcp_tool_permissions: {}, entitlement_models: [], entitlement_agents: [] }
}
className="space-y-4"
>
{currentStep === 0 && renderConfigureStep()}
- {currentStep === 1 && renderMCPToolsStep()}
- {currentStep === 2 && renderAssignKeyStep()}
- {currentStep === 3 && renderReadyStep()}
+ {currentStep === 1 && renderEntitlementsStep()}
+ {currentStep === 2 && renderObservabilityStep()}
+ {currentStep === 3 && renderAssignKeyStep()}
+ {currentStep === 4 && renderReadyStep()}
</Form>
{/* Footer navigation */}
<div className="flex items-center justify-between pt-6 border-t border-gray-100 mt-6">
<div>
- {currentStep > 0 && currentStep < 3 && (
+ {currentStep > 0 && currentStep < 4 && (
<button
type="button"
onClick={handleBack}
@@ -818,7 +874,7 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
)}
</div>
<div className="flex gap-3">
- {currentStep < 3 && (
+ {currentStep < 4 && (
<Button variant="secondary" onClick={handleClose}>
Cancel
</Button>
@@ -834,11 +890,16 @@ const AddAgentForm: React.FC<AddAgentFormProps> = ({
</Button>
)}
{currentStep === 2 && (
+ <Button variant="primary" onClick={handleNext}>
+ Next →
+ </Button>
+ )}
+ {currentStep === 3 && (
<Button variant="primary" loading={isSubmitting} onClick={handleCreateAgent}>
{isSubmitting ? "Creating..." : "Create Agent →"}
</Button>
)}
- {currentStep === 3 && (
+ {currentStep === 4 && (
<Button variant="primary" onClick={handleClose}>
Done
</Button>