Skip to content
Open
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: 14 additions & 0 deletions api/server/middleware/accessResources/canAccessAgentFromBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,21 @@ const canAccessAgentFromBody = (options) => {
const { endpoint, agent_id } = req.body;
let agentId = agent_id;

// Check if endpoint is in allowedProviders (provider-only endpoints)
// These endpoints can only be used through created agents, not via ephemeral access
const allowedProviders = req.config?.endpoints?.agents?.allowedProviders || [];
const isProviderOnly = allowedProviders.includes(endpoint);

if (!isAgentsEndpoint(endpoint)) {
// If this is a provider-only endpoint, completely block direct access
// These must go through the agents endpoint, not as standalone requests
if (isProviderOnly) {
return res.status(403).json({
error: 'Forbidden',
message:
'This endpoint can only be accessed through created agents with proper permissions',
});
}
agentId = Constants.EPHEMERAL_AGENT_ID;
}

Expand Down
3 changes: 3 additions & 0 deletions librechat.n1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ mcpServers:
chatMenu: false
requiresOAuth: false
endpoints:
agents:
allowedProviders:
- "LangGraph Agents"
azureOpenAI:
# Endpoint-level configuration
titleModel: "gpt-4o"
Expand Down
3 changes: 3 additions & 0 deletions librechat.n2a.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ mcpServers:
chatMenu: false
requiresOAuth: false
endpoints:
agents:
allowedProviders:
- "LangGraph Agents"
azureOpenAI:
# Endpoint-level configuration
titleModel: "gpt-4o"
Expand Down
3 changes: 3 additions & 0 deletions librechat.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ mcpServers:
chatMenu: false
requiresOAuth: false
endpoints:
agents:
allowedProviders:
- "LangGraph Agents"
azureOpenAI:
# Endpoint-level configuration
titleModel: "gpt-4o"
Expand Down