Back to Checks
openai

OpenAI project hosted tools are limited to allowed ones

project_hosted_tools_restricted
Service: projectSeverity: high
OfficialVerifiedPrivate
Categories:gen-ai
Resource Type:OpenAIProject

Each active project's enabled hosted tools (file search, web search, image generation, MCP, code interpreter) are checked against allowed_hosted_tools (default: every tool except MCP).

Prowler logoProwlerprowler-provider-openai

Risk

Hosted tools let a model act outside the prompt: remote MCP servers and web search reach third parties, so a prompt injection can exfiltrate data or pull in untrusted content (OWASP LLM06, excessive agency).

Run this check with Prowler

Run in Prowler Cloud
Run
prowler openai --checks project_hosted_tools_restricted

Recommendation

Turn off the tools the project does not need in its tool permissions. A project can only turn off a tool when the organization's policy for that tool is set to selected projects, so change that first if the update is refused.

Remediation

CLI

curl -X POST https://api.openai.com/v1/organization/projects/<project_id>/hosted_tool_permissions -H "Authorization: Bearer $OPENAI_ADMIN_KEY" -H "Content-Type: application/json" -d '{"mcp": {"enabled": false}}'

Check Code

from prowler.lib.check.models import Check

from prowler_provider_openai.check_report import finding
from prowler_provider_openai.services.project.project_client import project_client


class project_hosted_tools_restricted(Check):
    def execute(self):
        tools = project_client.hosted_tools
        if tools is None:
            return []
        allowed = set(project_client.audit_config.get("allowed_hosted_tools") or [])
        findings = []
        for project in project_client.projects:
            if project["id"] not in tools:
                continue
            extra = sorted(t for t, on in tools[project["id"]].items() if on and t not in allowed)
            if extra:
                text = f"Project {project['name']} enables hosted tools not in allowed_hosted_tools: {', '.join(extra)}."
            else:
                text = f"Project {project['name']} enables only allowed hosted tools."
            findings.append(finding(self.metadata(), project, not extra, text))
        return findings